/**
 * All-in-One PDF Converter Tool — Frontend Styles
 * Version: 1.2.0
 */

/* ── Reset ── */
.pdf-converter-container *,
.pct-overlay * {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

/* ── Container ── */
.pdf-converter-container {
    max-width: 960px;
    margin: 40px auto;
    padding: 20px;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
}

/* ── Card ── */
.pdf-converter-card {
    background: #ffffff;
    border-radius: 18px;
    box-shadow: 0 6px 32px rgba(0,0,0,0.09);
    padding: 44px 40px;
}

/* ── Header ── */
.pdf-converter-header {
    text-align: center;
    margin-bottom: 36px;
}
.pdf-converter-header h2 {
    font-size: 30px;
    font-weight: 800;
    color: #1a202c;
    margin-bottom: 8px;
    letter-spacing: -0.5px;
}
.pdf-converter-header p {
    font-size: 15px;
    color: #718096;
}

/* ── Error banner ── */
.pct-error-message {
    display: none;
    background: #fef2f2;
    border: 1.5px solid #fca5a5;
    border-radius: 10px;
    padding: 14px 18px;
    margin-bottom: 20px;
    color: #991b1b;
    font-size: 14px;
    font-weight: 600;
    text-align: center;
}
.pct-error-message.show { display: block; }

/* ════════════════════════════
   UPLOAD AREA
════════════════════════════ */
.pdf-upload-area {
    border: 2.5px dashed #d1d5db;
    border-radius: 14px;
    padding: 56px 30px 48px;
    text-align: center;
    background: #fafafa;
    cursor: pointer;
    transition: border-color .25s, background .25s, transform .2s;
    position: relative;
}
.pdf-upload-area:hover,
.pdf-upload-area.dragover {
    border-color: #ff6a59;
    background: #fff8f7;
    transform: translateY(-2px);
}

.upload-svg-icon {
    width: 72px;
    height: 72px;
    margin: 0 auto 18px;
}
.upload-svg-icon svg { width: 100%; height: 100%; }

.pdf-upload-area h3 {
    font-size: 19px;
    font-weight: 700;
    color: #2d3748;
    margin-bottom: 6px;
}
.pdf-upload-area > p {
    font-size: 14px;
    color: #9ca3af;
    margin-bottom: 20px;
}
.upload-limit-note {
    margin-top: 14px !important;
    font-size: 12px !important;
    color: #c0c7d0 !important;
}

.btn-browse {
    display: inline-block;
    background: #ff6a59;
    color: #fff;
    padding: 11px 32px;
    border-radius: 8px;
    font-weight: 700;
    font-size: 14px;
    border: none;
    cursor: pointer;
    transition: background .2s, transform .2s, box-shadow .2s;
}
.btn-browse:hover {
    background: #e85544;
    transform: translateY(-2px);
    box-shadow: 0 4px 14px rgba(255,106,89,.35);
}

/* ════════════════════════════
   STEP 2 WRAPPER
════════════════════════════ */
.pct-step2 { animation: pct-fade-in .35s ease; }

@keyframes pct-fade-in {
    from { opacity: 0; transform: translateY(12px); }
    to   { opacity: 1; transform: translateY(0); }
}

/* ── File Info Panel ── */
.file-info-panel {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 14px;
    background: #f0fdf4;
    border: 1.5px solid #86efac;
    border-radius: 12px;
    padding: 16px 20px;
    margin-bottom: 28px;
    flex-wrap: wrap;
}

.fip-left {
    display: flex;
    align-items: center;
    gap: 14px;
    flex: 1;
    min-width: 0;
}

.fip-pdf-icon { width: 40px; height: 40px; flex-shrink: 0; }
.fip-pdf-icon svg { width: 100%; height: 100%; }

.fip-meta { min-width: 0; }

.fip-name {
    font-weight: 700;
    color: #166534;
    font-size: 14px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 320px;
}
.fip-size {
    font-size: 12px;
    color: #15803d;
    margin-top: 3px;
}

.fip-actions {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-shrink: 0;
}

/* Replace button */
.btn-replace {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    background: #2b323c;
    color: #fff;
    border: none;
    padding: 8px 15px;
    border-radius: 7px;
    font-size: 12px;
    font-weight: 700;
    cursor: pointer;
    transition: background .2s, transform .2s;
    white-space: nowrap;
}
.btn-replace:hover { background: #020c1a; transform: translateY(-1px); }

/* Remove button */
.btn-remove-file {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    background: #ef4444;
    color: #fff;
    border: none;
    padding: 8px 15px;
    border-radius: 7px;
    font-size: 12px;
    font-weight: 700;
    cursor: pointer;
    transition: background .2s, transform .2s;
    white-space: nowrap;
}
.btn-remove-file:hover { background: #dc2626; transform: translateY(-1px); }

/* ════════════════════════════
   FORMAT SELECTION
════════════════════════════ */
.format-selection {
    margin-bottom: 28px;
}
.format-selection h3 {
    font-size: 16px;
    font-weight: 700;
    color: #374151;
    margin-bottom: 14px;
}
.format-options {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(130px, 1fr));
    gap: 12px;
}
.format-option { position: relative; }
.format-option input[type="radio"] {
    position: absolute;
    opacity: 0;
    pointer-events: none;
}
.format-option label {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 5px;
    background: #fff;
    border: 2px solid #e5e7eb;
    border-radius: 12px;
    padding: 18px 12px;
    cursor: pointer;
    transition: border-color .2s, background .2s, box-shadow .2s;
    font-weight: 700;
    font-size: 14px;
    color: #374151;
    user-select: none;
}
.format-option label:hover {
    border-color: #ff6a59;
    background: #fff8f7;
}
.format-option input[type="radio"]:checked + label {
    border-color: #ff6a59;
    background: #ff6a59;
    color: #fff;
    box-shadow: 0 4px 14px rgba(255,106,89,.3);
}
.format-icon {
    font-size: 28px;
    display: block;
}
.format-desc {
    font-size: 11px;
    font-weight: 500;
    opacity: .75;
}
.format-option input[type="radio"]:checked + label .format-desc {
    opacity: .9;
}

/* ════════════════════════════
   CONVERT BUTTON
════════════════════════════ */
.convert-button-wrapper {
    text-align: center;
    margin-bottom: 28px;
}
.btn-convert {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    background: #F3BD15;
    color: #1a202c;
    border: none;
    padding: 17px 56px;
    border-radius: 12px;
    font-size: 17px;
    font-weight: 800;
    cursor: pointer;
    transition: background .2s, transform .2s, box-shadow .2s;
    box-shadow: 0 4px 16px rgba(243,189,21,.32);
    letter-spacing: .2px;
}
.btn-convert:hover {
    background: #d9a913;
    transform: translateY(-3px);
    box-shadow: 0 7px 22px rgba(243,189,21,.42);
}
.btn-convert:disabled {
    opacity: .55;
    cursor: not-allowed;
    transform: none;
}

/* ════════════════════════════
   RESULT AREA
════════════════════════════ */
.result-area {
    background: linear-gradient(135deg, #f0fdf4 0%, #dcfce7 100%);
    border: 2px solid #86efac;
    border-radius: 16px;
    padding: 36px 30px;
    text-align: center;
    margin-bottom: 28px;
    animation: pct-fade-in .4s ease;
}
.result-check {
    width: 64px;
    height: 64px;
    background: #22c55e;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 18px;
    font-size: 30px;
    color: #fff;
    font-weight: 700;
    box-shadow: 0 4px 18px rgba(34,197,94,.35);
}
.result-area h3 {
    font-size: 22px;
    font-weight: 800;
    color: #166534;
    margin-bottom: 8px;
}
.result-count {
    font-size: 14px;
    color: #15803d;
    margin-bottom: 24px;
}
.result-buttons {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 14px;
    flex-wrap: wrap;
}
.btn-download {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    background: #22c55e;
    color: #fff;
    border: none;
    padding: 13px 32px;
    border-radius: 10px;
    font-size: 15px;
    font-weight: 700;
    cursor: pointer;
    transition: background .2s, transform .2s, box-shadow .2s;
    text-decoration: none;
}
.btn-download:hover {
    background: #16a34a;
    transform: translateY(-2px);
    box-shadow: 0 5px 14px rgba(34,197,94,.35);
    color: #fff;
}
.btn-convert-another {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    background: #fff;
    color: #374151;
    border: 2px solid #d1d5db;
    padding: 11px 26px;
    border-radius: 10px;
    font-size: 14px;
    font-weight: 700;
    cursor: pointer;
    transition: border-color .2s, transform .2s, box-shadow .2s;
}
.btn-convert-another:hover {
    border-color: #ff6a59;
    color: #ff6a59;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(255,106,89,.15);
}

/* ════════════════════════════
   FEATURES SECTION
════════════════════════════ */
.features-section {
    margin-top: 40px;
    padding-top: 36px;
    border-top: 1px solid #f0f0f0;
}
.features-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 20px;
}
.feature-item { text-align: center; }
.feature-icon { font-size: 36px; margin-bottom: 10px; }
.feature-item h4 {
    font-size: 14px;
    font-weight: 700;
    color: #2d3748;
    margin-bottom: 6px;
}
.feature-item p {
    font-size: 12px;
    color: #9ca3af;
    line-height: 1.55;
}

/* ════════════════════════════
   POPUP OVERLAY
════════════════════════════ */
.pct-overlay {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,.52);
    z-index: 999999;
    align-items: center;
    justify-content: center;
    backdrop-filter: blur(3px);
}
.pct-overlay.show { display: flex; }

.pct-popup {
    background: #fff;
    border-radius: 20px;
    padding: 44px 48px 40px;
    text-align: center;
    width: 90%;
    max-width: 400px;
    box-shadow: 0 20px 60px rgba(0,0,0,.25);
    animation: pct-popup-in .3s cubic-bezier(.34,1.56,.64,1);
}
@keyframes pct-popup-in {
    from { opacity: 0; transform: scale(.85) translateY(20px); }
    to   { opacity: 1; transform: scale(1) translateY(0); }
}

.pct-popup-icon {
    width: 70px;
    height: 70px;
    margin: 0 auto 20px;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* Spinner ring */
.pct-spinner {
    width: 60px;
    height: 60px;
    border: 5px solid #f3f4f6;
    border-top-color: #ff6a59;
    border-right-color: #F3BD15;
    border-radius: 50%;
    animation: pct-spin .75s linear infinite;
}
@keyframes pct-spin { to { transform: rotate(360deg); } }

/* Success checkmark inside popup */
.pct-popup-icon.success {
    background: #dcfce7;
    border-radius: 50%;
    width: 70px;
    height: 70px;
}
.pct-popup-icon.success::after {
    content: '✓';
    font-size: 34px;
    font-weight: 800;
    color: #22c55e;
    line-height: 1;
}
.pct-popup-icon.success .pct-spinner { display: none; }

.pct-popup-title {
    font-size: 18px;
    font-weight: 800;
    color: #1a202c;
    margin-bottom: 8px;
}
.pct-popup-sub {
    font-size: 13px;
    color: #6b7280;
    margin-bottom: 22px;
    line-height: 1.55;
}

/* Progress bar inside popup */
.pct-popup-bar-wrap {
    background: #f3f4f6;
    border-radius: 999px;
    height: 8px;
    overflow: hidden;
    margin-bottom: 10px;
}
.pct-popup-bar {
    height: 100%;
    width: 0%;
    background: linear-gradient(90deg, #ff6a59 0%, #F3BD15 100%);
    border-radius: 999px;
    transition: width .4s ease;
}
.pct-popup-percent {
    font-size: 13px;
    font-weight: 700;
    color: #374151;
}

/* ════════════════════════════
   RESPONSIVE
════════════════════════════ */
@media (max-width: 700px) {
    .pdf-converter-card { padding: 28px 20px; }
    .pdf-converter-header h2 { font-size: 22px; }
    .format-options { grid-template-columns: repeat(2, 1fr); gap: 8px; }
    .features-grid { grid-template-columns: repeat(2, 1fr); }
    .btn-convert { width: 100%; justify-content: center; }
    .pct-popup { padding: 34px 24px 30px; }
}
@media (max-width: 480px) {
    .fip-name { max-width: 180px; }
    .fip-actions { flex-direction: column; width: 100%; }
    .btn-replace, .btn-remove-file { width: 100%; justify-content: center; }
    .format-options { grid-template-columns: 1fr; }
    .features-grid { grid-template-columns: 1fr; }
    .result-buttons { flex-direction: column; }
    .btn-download, .btn-convert-another { width: 100%; justify-content: center; }
}
