/*!
 * PDF Compressor Pro - Frontend Styles
 * Version: 2.0
 */

/* ============================================
   MAIN WRAPPER
   ============================================ */
.pdf-compressor-wrapper {
    max-width: 850px;
    margin: 30px auto;
    background: #ffffff;
    border-radius: 20px;
    padding: 30px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.08);
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
    color: #1e293b;
    transition: all 0.3s ease;
}

.pdf-compressor-wrapper[data-theme="dark"] {
    background: #1e293b;
    color: #f1f5f9;
}

/* ============================================
   HEADER
   ============================================ */
.pdfc-header {
    text-align: center;
    margin-bottom: 25px;
    padding-bottom: 20px;
    border-bottom: 2px solid #f1f5f9;
}

.pdfc-header h2 {
    font-size: 2rem;
    font-weight: 800;
    color: #6366f1;
    margin-bottom: 8px;
    letter-spacing: -0.5px;
}

.pdfc-header p {
    color: #64748b;
    font-size: 1rem;
    margin: 0;
}

[data-theme="dark"] .pdfc-header {
    border-bottom-color: #334155;
}

[data-theme="dark"] .pdfc-header h2 {
    color: #818cf8;
}

[data-theme="dark"] .pdfc-header p {
    color: #94a3b8;
}

/* ============================================
   UPLOAD ZONE
   ============================================ */
.pdfc-upload-zone {
    border: 3px dashed #c7d2fe;
    border-radius: 16px;
    padding: 45px 25px;
    text-align: center;
    background: #f8faff;
    cursor: pointer;
    transition: all 0.3s ease;
    margin-bottom: 25px;
    position: relative;
    overflow: hidden;
}

.pdfc-upload-zone::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(135deg, rgba(99, 102, 241, 0.03) 0%, rgba(139, 92, 246, 0.03) 100%);
    pointer-events: none;
}

.pdfc-upload-zone:hover {
    border-color: #6366f1;
    background: #eef2ff;
    transform: translateY(-3px);
    box-shadow: 0 10px 30px rgba(99, 102, 241, 0.1);
}

.pdfc-upload-zone.dragover {
    border-color: #4f46e5;
    background: #e0e7ff;
    transform: scale(1.02);
    box-shadow: 0 15px 40px rgba(99, 102, 241, 0.15);
}

.pdfc-upload-icon {
    font-size: 4rem;
    margin-bottom: 15px;
    display: block;
    animation: float 3s ease-in-out infinite;
}

@keyframes float {
    0%, 100% { transform: translateY(0px); }
    50% { transform: translateY(-10px); }
}

.pdfc-upload-zone h3 {
    font-size: 1.3rem;
    font-weight: 600;
    color: #1e293b;
    margin: 10px 0;
}

.pdfc-upload-zone p {
    color: #64748b;
    margin: 5px 0;
}

.pdfc-browse-btn {
    display: inline-block;
    background: linear-gradient(135deg, #6366f1 0%, #8b5cf6 100%);
    color: #ffffff;
    padding: 14px 35px;
    border: none;
    border-radius: 30px;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    margin-top: 15px;
    transition: all 0.3s ease;
    box-shadow: 0 4px 15px rgba(99, 102, 241, 0.3);
    letter-spacing: 0.3px;
}

.pdfc-browse-btn:hover {
    transform: translateY(-3px);
    box-shadow: 0 8px 25px rgba(99, 102, 241, 0.45);
    background: linear-gradient(135deg, #4f46e5 0%, #7c3aed 100%);
}

.pdfc-browse-btn:active {
    transform: translateY(-1px);
}

.pdfc-limit-text {
    margin-top: 15px !important;
    font-size: 0.85rem !important;
    color: #94a3b8 !important;
}

[data-theme="dark"] .pdfc-upload-zone {
    background: #0f172a;
    border-color: #334155;
}

[data-theme="dark"] .pdfc-upload-zone:hover {
    background: #1e293b;
    border-color: #6366f1;
}

[data-theme="dark"] .pdfc-upload-zone h3 {
    color: #f1f5f9;
}

/* ============================================
   QUALITY SELECTOR
   ============================================ */
.pdfc-quality-selector {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 10px;
    margin-bottom: 20px;
}

.pdfc-q-btn {
    padding: 14px 8px;
    background: #ffffff;
    border: 2px solid #e2e8f0;
    border-radius: 12px;
    cursor: pointer;
    font-weight: 600;
    font-size: 0.9rem;
    color: #475569;
    transition: all 0.3s ease;
    text-align: center;
    white-space: nowrap;
}

.pdfc-q-btn:hover {
    border-color: #818cf8;
    color: #4f46e5;
    background: #f8faff;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.05);
}

.pdfc-q-btn.active {
    border-color: #6366f1;
    background: #eef2ff;
    color: #4f46e5;
    box-shadow: 0 4px 15px rgba(99, 102, 241, 0.2);
    position: relative;
}

.pdfc-q-btn.active::after {
    content: '✓';
    position: absolute;
    top: 6px;
    right: 10px;
    font-size: 0.8rem;
    color: #6366f1;
    font-weight: bold;
}

[data-theme="dark"] .pdfc-q-btn {
    background: #1e293b;
    border-color: #334155;
    color: #cbd5e1;
}

[data-theme="dark"] .pdfc-q-btn:hover {
    border-color: #6366f1;
    background: #334155;
}

[data-theme="dark"] .pdfc-q-btn.active {
    background: #312e81;
    border-color: #6366f1;
    color: #c4b5fd;
}

/* ============================================
   FILE LIST
   ============================================ */
.pdfc-file-list {
    margin: 15px 0;
    max-height: 300px;
    overflow-y: auto;
    scrollbar-width: thin;
    scrollbar-color: #cbd5e1 #f1f5f9;
}

.pdfc-file-list::-webkit-scrollbar {
    width: 6px;
}

.pdfc-file-list::-webkit-scrollbar-track {
    background: #f1f5f9;
    border-radius: 10px;
}

.pdfc-file-list::-webkit-scrollbar-thumb {
    background: #cbd5e1;
    border-radius: 10px;
}

.pdfc-file-list::-webkit-scrollbar-thumb:hover {
    background: #94a3b8;
}

.pdfc-file-item {
    display: flex;
    align-items: center;
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    border-radius: 10px;
    padding: 12px 16px;
    margin-bottom: 8px;
    gap: 12px;
    transition: all 0.2s ease;
    animation: slideIn 0.3s ease;
}

@keyframes slideIn {
    from {
        opacity: 0;
        transform: translateX(-20px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

.pdfc-file-item:hover {
    background: #ffffff;
    border-color: #c7d2fe;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.06);
}

.pdfc-file-info {
    flex: 1;
    min-width: 0;
}

.pdfc-file-name {
    font-weight: 600;
    color: #1e293b;
    font-size: 0.95rem;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    margin-bottom: 3px;
}

.pdfc-file-size {
    color: #64748b;
    font-size: 0.85rem;
}

.pdfc-remove-btn {
    background: #fee2e2;
    color: #ef4444;
    border: none;
    width: 30px;
    height: 30px;
    border-radius: 50%;
    cursor: pointer;
    font-size: 1.2rem;
    font-weight: bold;
    flex-shrink: 0;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    line-height: 1;
}

.pdfc-remove-btn:hover {
    background: #fecaca;
    color: #dc2626;
    transform: rotate(90deg);
}

[data-theme="dark"] .pdfc-file-item {
    background: #1e293b;
    border-color: #334155;
}

[data-theme="dark"] .pdfc-file-item:hover {
    background: #334155;
}

[data-theme="dark"] .pdfc-file-name {
    color: #f1f5f9;
}

[data-theme="dark"] .pdfc-file-size {
    color: #94a3b8;
}

/* ============================================
   COMPRESS BUTTON
   ============================================ */
.pdfc-compress-btn {
    width: 100%;
    padding: 16px;
    background: linear-gradient(135deg, #10b981 0%, #059669 100%);
    color: #ffffff;
    border: none;
    border-radius: 12px;
    font-size: 1.1rem;
    font-weight: 700;
    cursor: pointer;
    margin-top: 15px;
    transition: all 0.3s ease;
    box-shadow: 0 4px 15px rgba(16, 185, 129, 0.3);
    letter-spacing: 0.5px;
}

.pdfc-compress-btn:hover:not(:disabled) {
    transform: translateY(-3px);
    box-shadow: 0 8px 25px rgba(16, 185, 129, 0.45);
    background: linear-gradient(135deg, #059669 0%, #047857 100%);
}

.pdfc-compress-btn:active:not(:disabled) {
    transform: translateY(-1px);
}

.pdfc-compress-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    filter: grayscale(30%);
}

/* ============================================
   PROGRESS BAR
   ============================================ */
.pdfc-progress {
    margin: 20px 0;
}

.pdfc-progress-bar {
    width: 100%;
    height: 10px;
    background: #e2e8f0;
    border-radius: 5px;
    overflow: hidden;
    box-shadow: inset 0 2px 4px rgba(0, 0, 0, 0.06);
}

.pdfc-progress-fill {
    height: 100%;
    background: linear-gradient(90deg, #10b981, #34d399, #6ee7b7);
    background-size: 200% 100%;
    width: 0%;
    transition: width 0.4s ease;
    border-radius: 5px;
    animation: shimmer 2s linear infinite;
}

@keyframes shimmer {
    0% { background-position: 200% 0; }
    100% { background-position: -200% 0; }
}

.pdfc-progress-text {
    text-align: center;
    margin-top: 10px;
    color: #64748b;
    font-weight: 500;
    font-size: 0.95rem;
}

/* ============================================
   RESULTS
   ============================================ */
.pdfc-results {
    margin-top: 25px;
    animation: fadeInUp 0.5s ease;
}

@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.pdfc-results h3 {
    font-size: 1.3rem;
    font-weight: 700;
    color: #059669;
    margin-bottom: 15px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.pdfc-result-item {
    background: #f0fdf4;
    border-left: 4px solid #10b981;
    border-radius: 10px;
    padding: 15px 18px;
    margin-bottom: 10px;
    animation: slideIn 0.4s ease;
    transition: all 0.3s ease;
}

.pdfc-result-item:hover {
    box-shadow: 0 4px 12px rgba(16, 185, 129, 0.1);
}

.pdfc-result-item .pdfc-result-name {
    font-weight: 600;
    color: #1e293b;
    margin-bottom: 8px;
    font-size: 0.95rem;
}

.pdfc-result-item .pdfc-result-stats {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 8px;
    margin-bottom: 10px;
    font-size: 0.9rem;
}

.pdfc-badge {
    display: inline-block;
    background: #d1fae5;
    color: #065f46;
    padding: 4px 12px;
    border-radius: 20px;
    font-weight: 700;
    font-size: 0.8rem;
    letter-spacing: 0.3px;
}

.pdfc-download-btn {
    display: inline-block;
    background: #6366f1;
    color: #ffffff !important;
    padding: 8px 20px;
    border-radius: 8px;
    text-decoration: none !important;
    font-weight: 600;
    font-size: 0.9rem;
    cursor: pointer;
    transition: all 0.3s ease;
    border: none;
}

.pdfc-download-btn:hover {
    background: #4f46e5;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(99, 102, 241, 0.3);
    color: #ffffff !important;
}

.pdfc-summary {
    background: linear-gradient(135deg, #d1fae5, #a7f3d0);
    padding: 16px 20px;
    border-radius: 12px;
    margin-top: 12px;
    text-align: center;
    font-weight: 600;
    border: 1px solid #6ee7b7;
}

.pdfc-summary .pdfc-badge {
    background: #059669;
    color: #ffffff;
}

[data-theme="dark"] .pdfc-results h3 {
    color: #34d399;
}

[data-theme="dark"] .pdfc-result-item {
    background: #064e3b;
    border-left-color: #34d399;
}

[data-theme="dark"] .pdfc-result-item .pdfc-result-name {
    color: #f1f5f9;
}

/* ============================================
   RESPONSIVE
   ============================================ */
@media (max-width: 768px) {
    .pdf-compressor-wrapper {
        margin: 15px;
        padding: 20px;
        border-radius: 15px;
    }
    
    .pdfc-header h2 {
        font-size: 1.5rem;
    }
    
    .pdfc-quality-selector {
        grid-template-columns: repeat(2, 1fr);
    }
    
    .pdfc-upload-zone {
        padding: 30px 15px;
    }
    
    .pdfc-upload-icon {
        font-size: 3rem;
    }
}

@media (max-width: 480px) {
    .pdf-compressor-wrapper {
        margin: 10px;
        padding: 15px;
    }
    
    .pdfc-quality-selector {
        grid-template-columns: 1fr 1fr;
        gap: 8px;
    }
    
    .pdfc-q-btn {
        padding: 10px 6px;
        font-size: 0.8rem;
    }
    
    .pdfc-browse-btn {
        padding: 12px 25px;
        font-size: 0.9rem;
    }
    
    .pdfc-compress-btn {
        padding: 14px;
        font-size: 1rem;
    }
}