/* ==================== PDF COMPRESSOR STYLES ==================== */

/* Override body background for this page */
body {
    background: linear-gradient(135deg, #0f1419 0%, #1a2332 50%, #0f1419 100%) !important;
    color: var(--text-primary);
}

.pdf-compress-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 20px;
    color: var(--text-primary);
}

.header-section {
    text-align: center;
    margin-bottom: 40px;
}

.header-section h1 {
    color: var(--text-primary);
    font-size: 2.5rem;
    margin-bottom: 15px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 15px;
    font-weight: 800;
}

.header-section h1 i {
    color: #f79112;
}

.subtitle {
    color: var(--text-secondary);
    font-size: 1.2rem;
    margin: 0;
}

/* Upload Section */
.upload-section {
    background: rgba(255, 255, 255, 0.05);
    border: 2px solid var(--primary-light);
    border-radius: 20px;
    padding: 30px;
    box-shadow: var(--shadow-md);
    margin-bottom: 40px;
    backdrop-filter: blur(10px);
    position: relative;
}

.drop-zone-pdf {
    border: 3px dashed var(--primary-light);
    border-radius: 15px;
    padding: 40px 30px;
    text-align: center;
    cursor: pointer;
    transition: all 0.3s ease;
    background: rgba(255, 255, 255, 0.03);
    position: relative;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    min-height: 220px;
}

.drop-zone-pdf:hover {
    border-color: #f79112;
    background: rgba(247, 145, 18, 0.1);
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(247, 145, 18, 0.3);
}

.drop-zone-pdf.drag-over {
    border-color: #f79112;
    background: rgba(247, 145, 18, 0.15);
    transform: scale(1.02);
}

.drop-zone-pdf.loading {
    pointer-events: none;
    opacity: 0.7;
}

/* Upload Progress Bar */
.upload-progress-container {
    width: 100%;
    margin-top: 20px;
    animation: fadeIn 0.3s ease;
}

.upload-progress-bar {
    width: 100%;
    height: 30px;
    background: rgba(255, 255, 255, 0.05);
    border: 2px solid var(--primary-light);
    border-radius: 15px;
    overflow: hidden;
    box-shadow: inset 0 2px 5px rgba(0,0,0,0.3);
}

.upload-progress-fill {
    height: 100%;
    background: linear-gradient(90deg, var(--accent-color) 0%, #f79112 100%);
    transition: width 0.3s ease;
    border-radius: 15px;
    display: flex;
    align-items: center;
    justify-content: flex-end;
    padding-right: 10px;
    color: white;
    font-weight: bold;
    font-size: 0.85rem;
}

.upload-progress-text {
    margin-top: 10px;
    color: var(--text-primary);
    font-weight: 600;
    font-size: 0.95rem;
    text-align: center;
}

.upload-content {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    width: 100%;
}

.upload-icon {
    margin-bottom: 20px;
}

.upload-icon i {
    font-size: 3rem;
    color: #f79112;
    animation: bounce 2s infinite;
}

@keyframes bounce {
    0%, 100% {
        transform: translateY(0);
    }
    50% {
        transform: translateY(-10px);
    }
}

.drop-zone-pdf h3 {
    color: var(--text-primary);
    font-size: 1.5rem;
    margin: 10px 0;
}

.drop-zone-pdf p {
    color: var(--text-secondary);
    font-size: 1rem;
    margin: 10px 0 20px 0;
}

.supported-formats {
    margin-top: 15px;
}

.supported-formats small {
    color: #f79112;
    font-size: 0.9rem;
}

.supported-formats i {
    margin-right: 5px;
}

/* Compress Section */
.compress-section {
    margin-top: 24px;
    animation: fadeIn 0.5s ease;
}

.compress-grid {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(0, 1.5fr);
    gap: 24px;
    align-items: start;
}

.file-info-column {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.file-info-card {
    background: rgba(15, 20, 25, 0.9);
    border-radius: 14px;
    padding: 18px 20px;
    border: 1px solid rgba(255, 255, 255, 0.12);
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.4);
}

.file-info-card h3 {
    margin: 0 0 12px 0;
    font-size: 1.05rem;
    color: var(--text-primary);
    display: flex;
    align-items: center;
    gap: 8px;
}

.file-info-card h3 i {
    color: #f79112;
}

.file-info-card ul {
    list-style: none;
    padding: 0;
    margin: 0;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.file-info-card li {
    font-size: 0.9rem;
    color: var(--text-secondary);
    display: flex;
    justify-content: space-between;
    gap: 10px;
}

.file-info-card li span {
    opacity: 0.85;
}

.file-info-card li strong {
    color: var(--text-primary);
    overflow-wrap: anywhere;
    word-break: break-word;
}

.compressed-size {
    color: #4ade80 !important;
    font-weight: 700;
}

.reduction-percent {
    color: #f79112 !important;
    font-weight: 700;
}

/* Quality Selection Card */
.quality-selection-card {
    background: rgba(15, 20, 25, 0.9);
    border-radius: 14px;
    padding: 18px 20px;
    border: 1px solid rgba(255, 255, 255, 0.12);
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.4);
}

.quality-selection-card h3 {
    margin: 0 0 16px 0;
    font-size: 1.05rem;
    color: var(--text-primary);
    display: flex;
    align-items: center;
    gap: 8px;
}

.quality-selection-card h3 i {
    color: #f79112;
}

.quality-options {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.quality-option {
    display: block;
    cursor: pointer;
    transition: all 0.3s ease;
}

.quality-option input[type="radio"] {
    display: none;
}

.quality-content {
    background: rgba(255, 255, 255, 0.03);
    border: 2px solid rgba(255, 255, 255, 0.1);
    border-radius: 10px;
    padding: 14px 16px;
    transition: all 0.3s ease;
}

.quality-option:hover .quality-content {
    border-color: rgba(247, 145, 18, 0.5);
    background: rgba(247, 145, 18, 0.05);
}

.quality-option input[type="radio"]:checked + .quality-content {
    border-color: #f79112;
    background: rgba(247, 145, 18, 0.15);
    box-shadow: 0 0 0 2px rgba(247, 145, 18, 0.2);
}

.quality-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 6px;
}

.quality-name {
    color: var(--text-primary);
    font-weight: 600;
    font-size: 1rem;
}

.quality-badge {
    background: rgba(255, 255, 255, 0.1);
    color: var(--text-secondary);
    padding: 4px 10px;
    border-radius: 12px;
    font-size: 0.8rem;
    font-weight: 600;
}

.quality-badge.recommended {
    background: linear-gradient(135deg, #f79112 0%, #ff6b35 100%);
    color: white;
}

.quality-desc {
    color: var(--text-secondary);
    font-size: 0.85rem;
    margin: 0;
    line-height: 1.4;
}

/* Action Section */
.compress-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    align-items: center;
    justify-content: center;
    margin-top: 30px;
}

.convert-section {
    margin-top: 0;
}

/* Buttons */
.btn-primary {
    background: var(--accent-color);
    color: white;
    border: none;
    padding: 15px 40px;
    border-radius: 50px;
    cursor: pointer;
    font-size: 1.1rem;
    font-weight: 600;
    transition: all 0.3s ease;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    box-shadow: 0 4px 15px rgba(74, 144, 226, 0.4);
    text-align: center;
}

.btn-primary:hover {
    transform: translateY(-3px);
    background: #f79112;
    box-shadow: 0 6px 20px rgba(247, 145, 18, 0.6);
}

.btn-primary:active {
    transform: translateY(-1px);
}

.btn-primary:disabled {
    opacity: 0.6;
    cursor: not-allowed;
    transform: none;
}

.btn-large {
    padding: 18px 50px;
    font-size: 1.2rem;
}

.btn-secondary {
    background-color: transparent;
    color: var(--text-primary);
    border: 2px solid var(--primary-light);
    padding: 10px 20px;
    border-radius: 8px;
    cursor: pointer;
    font-size: 0.95rem;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    gap: 8px;
    font-weight: 600;
}

.btn-secondary:hover {
    background-color: var(--primary-light);
    border-color: #f79112;
    transform: translateY(-2px);
}

.btn-clear {
    align-self: flex-start;
    width: auto;
}

.progress-container {
    margin-top: 25px;
    animation: fadeIn 0.3s ease;
}

.progress-bar {
    width: 100%;
    height: 30px;
    background: rgba(255, 255, 255, 0.05);
    border: 2px solid var(--primary-light);
    border-radius: 15px;
    overflow: hidden;
    box-shadow: inset 0 2px 5px rgba(0,0,0,0.3);
}

.progress-fill {
    height: 100%;
    width: 100%;
    background: linear-gradient(90deg, var(--accent-color) 0%, #f79112 100%);
    display: flex;
    align-items: center;
    justify-content: flex-end;
    padding-right: 10px;
    color: white;
    font-weight: bold;
    border-radius: 15px;
    /* GPU acceleration - runs on compositor thread, won't freeze */
    transform-origin: left;
    transform: scaleX(0);
    will-change: transform;
    backface-visibility: hidden;
    -webkit-backface-visibility: hidden;
}

.progress-text {
    margin-top: 10px;
    color: var(--text-primary);
    font-weight: 600;
    font-size: 1rem;
}

/* Modal Popup */
.pdf-modal-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.65);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
    z-index: 9999;
    backdrop-filter: blur(6px);
}

.pdf-modal {
    width: min(560px, 100%);
    background: rgba(15, 20, 25, 0.96);
    border: 2px solid var(--primary-light);
    border-radius: 16px;
    box-shadow: 0 18px 60px rgba(0, 0, 0, 0.6);
    overflow: hidden;
}

.pdf-modal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 16px 18px;
    background: rgba(255, 255, 255, 0.04);
    border-bottom: 1px solid rgba(255, 255, 255, 0.12);
}

.pdf-modal-title {
    margin: 0;
    font-size: 1.15rem;
    font-weight: 800;
    color: var(--text-primary);
}

.pdf-modal-close {
    border: none;
    background: transparent;
    color: var(--text-secondary);
    cursor: pointer;
    padding: 6px 8px;
    border-radius: 10px;
    transition: all 0.2s ease;
}

.pdf-modal-close:hover {
    color: #f79112;
    background: rgba(247, 145, 18, 0.12);
}

.pdf-modal-message {
    padding: 16px 18px 0 18px;
    color: var(--text-secondary);
    font-size: 1rem;
    line-height: 1.6;
}

.pdf-modal-actions {
    padding: 16px 18px 18px 18px;
    display: flex;
    justify-content: flex-end;
}

/* Instructions Section */
.instructions-section {
    background: rgba(255, 255, 255, 0.05);
    border: 2px solid var(--primary-light);
    border-radius: 20px;
    padding: 40px;
    box-shadow: var(--shadow-md);
    margin-bottom: 40px;
    backdrop-filter: blur(10px);
}

.instructions-section h2 {
    color: var(--text-primary);
    font-size: 2rem;
    margin-bottom: 30px;
    text-align: center;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 15px;
    font-weight: 800;
}

.instructions-section h2 i {
    color: #f79112;
}

.steps-container {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 30px;
}

.step-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    gap: 20px;
    padding: 20px;
    background: rgba(255, 255, 255, 0.03);
    border: 2px solid var(--primary-light);
    border-radius: 12px;
    transition: all 0.3s ease;
}

.step-item:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 25px rgba(247, 145, 18, 0.3);
    border-color: #f79112;
    background: rgba(255, 255, 255, 0.05);
}

.step-number {
    width: 50px;
    height: 50px;
    background: linear-gradient(135deg, #f79112 0%, #ff6b35 100%);
    color: white;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
    font-weight: bold;
    flex-shrink: 0;
    box-shadow: 0 4px 15px rgba(247, 145, 18, 0.4);
}

.step-content h3 {
    color: var(--text-primary);
    margin-top: 0;
    margin-bottom: 10px;
    font-size: 1.2rem;
    font-weight: 700;
}

.step-content p {
    color: var(--text-secondary);
    margin: 0;
    line-height: 1.6;
}

/* FAQ Section */
.faq-section {
    background: rgba(255, 255, 255, 0.05);
    border: 2px solid var(--primary-light);
    border-radius: 20px;
    padding: 40px;
    box-shadow: var(--shadow-md);
    margin-bottom: 40px;
    backdrop-filter: blur(10px);
}

.faq-section h2 {
    color: var(--text-primary);
    font-size: 2rem;
    margin-bottom: 30px;
    text-align: center;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 15px;
    font-weight: 800;
}

.faq-section h2 i {
    color: #f79112;
}

.faq-container {
    max-width: 900px;
    margin: 0 auto;
}

.faq-item-pdf {
    margin-bottom: 15px;
    border: 2px solid var(--primary-light);
    border-radius: 8px;
    overflow: hidden;
    background: rgba(255, 255, 255, 0.03);
    transition: all 0.3s ease;
}

.faq-item-pdf:hover {
    border-color: #f79112;
}

.faq-question-pdf {
    padding: 15px 15px 15px 40px;
    background-color: rgba(255, 255, 255, 0.05);
    cursor: pointer;
    font-weight: 600;
    color: var(--text-primary);
    position: relative;
    font-size: 1.1em;
    transition: all 0.3s ease;
}

.faq-question-pdf::before {
    content: '+';
    position: absolute;
    left: 15px;
    top: 50%;
    transform: translateY(-50%);
    font-size: 1.5em;
    font-weight: normal;
    line-height: 1;
    transition: transform 0.3s ease;
    color: #f79112;
}

.faq-item-pdf.active .faq-question-pdf {
    background-color: rgba(247, 145, 18, 0.2);
    color: var(--text-primary);
    border-bottom: 2px solid #f79112;
}

.faq-item-pdf.active .faq-question-pdf::before {
    content: '-';
    transform: translateY(-50%) rotate(180deg);
}

.faq-answer-pdf {
    background-color: rgba(255, 255, 255, 0.03);
    padding: 0 15px;
    max-height: 0;
    overflow: hidden;
    transition: all 0.5s ease;
}

.faq-item-pdf.active .faq-answer-pdf {
    padding: 15px;
    max-height: 1000px;
}

.faq-answer-pdf p {
    margin: 0;
    font-size: 1.1em;
    line-height: 1.6;
    color: var(--text-secondary);
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Responsive */
@media (max-width: 900px) {
    .compress-grid {
        grid-template-columns: minmax(0, 1fr);
    }
    
    .file-info-column {
        gap: 12px;
    }
    
    .btn-clear {
        width: 100%;
        justify-content: center;
    }
}

@media (max-width: 600px) {
    .pdf-compress-container {
        padding: 14px;
    }

    .upload-section {
        padding: 20px;
    }

    .header-section h1 {
        font-size: 2rem;
    }

    .subtitle {
        font-size: 1rem;
    }

    .steps-container {
        grid-template-columns: 1fr;
    }

    .file-info-card,
    .quality-selection-card {
        padding: 16px;
    }

    .file-info-card li {
        flex-direction: column;
        align-items: flex-start;
        gap: 6px;
    }

    .file-info-card li span {
        font-size: 0.85rem;
    }

    .file-info-card li strong {
        width: 100%;
        text-align: left;
    }

    .compress-actions {
        flex-direction: column;
    }

    .instructions-section,
    .faq-section {
        padding: 30px 20px;
    }

    .steps-container {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 480px) {
    .header-section h1 {
        font-size: 1.6rem;
        gap: 10px;
    }

    .subtitle {
        font-size: 0.95rem;
    }

    .drop-zone-pdf h3 {
        font-size: 1.25rem;
    }

    .btn-primary {
        font-size: 0.95rem;
        padding: 12px 24px;
    }

    .btn-secondary {
        font-size: 0.9rem;
        padding: 8px 14px;
        justify-content: center;
    }

    .instructions-section h2,
    .faq-section h2 {
        font-size: 1.5rem;
        gap: 10px;
    }

    .faq-question-pdf {
        font-size: 1rem;
    }

    .faq-answer-pdf p {
        font-size: 1rem;
    }
}
