/* --- SCOPED CSS: PREMIUM DARK CONVERTER --- */
@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700&display=swap');

#smart-converter {
    /* --- THEME PALETTE --- */
    --bg-dark: #02040a;       /* Pitch black background */
    --card-bg: #0f1117;       /* Dark card background */
    --border: #1e293b;        /* Borders */
    --primary: #3067ff;       /* Indigo */
    --primary-glow: rgba(99, 102, 241, 0.4);
    --text-white: #ffffff;
    --text-grey: #94a3b8;
    
    font-family: 'Inter', sans-serif;
    width: 100%;
    padding: 5% 0 0 0;
    box-sizing: border-box;
    color: var(--text-white);
    line-height: 1.5;
}

#smart-converter * { box-sizing: border-box; }

#smart-converter .converter-seo-hero {
    max-width: 1440px;
    margin: 0 auto 26px;
    padding: 30px;
    border: 1px solid rgba(48, 103, 255, 0.3);
    border-radius: 24px;
    background:
        linear-gradient(135deg, rgba(48, 103, 255, 0.18), rgba(255, 255, 255, 0.035) 45%, rgba(15, 17, 23, 0.96)),
        var(--card-bg);
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.45);
}

#smart-converter .converter-kicker {
    display: inline-flex;
    color: #7da0ff;
    font-size: 0.78rem;
    font-weight: 800;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    margin-bottom: 10px;
}

#smart-converter .converter-seo-hero h2 {
    max-width: 980px;
    margin: 0 0 12px;
    color: var(--text-white);
    font-size: clamp(1.7rem, 3vw, 3rem);
    font-weight: 800;
    line-height: 1.16;
}

#smart-converter .converter-seo-hero p {
    max-width: 1020px;
    margin: 0;
    color: var(--text-grey);
    font-size: 1rem;
    line-height: 1.75;
}

#smart-converter .converter-seo-points {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin-top: 22px;
}

#smart-converter .converter-seo-points span {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    min-height: 38px;
    padding: 8px 12px;
    border: 1px solid rgba(48, 103, 255, 0.34);
    border-radius: 10px;
    background: rgba(48, 103, 255, 0.12);
    color: rgba(255, 255, 255, 0.86);
    font-size: 0.83rem;
    font-weight: 800;
}

#smart-converter .converter-seo-points i {
    color: #7da0ff;
}

/* --- MAIN CARD --- */
#smart-converter .converter-card {
    max-width: 1440px;
    margin: 0 auto;
    background: var(--card-bg);
    border: 1px solid var(--border);
    border-radius: 24px;
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.5);
    overflow: hidden;
    position: relative;
}

/* Premium Top Gradient Line */
#smart-converter .converter-card::before {
    content: '';
    position: absolute;
    top: 0; left: 0; right: 0;
    height: 2px;
    background: linear-gradient(90deg, transparent, var(--primary), transparent);
    opacity: 0.8;
}

/* --- HEADER --- */
#smart-converter .header-section {
    padding: 30px 40px;
    background: linear-gradient(to bottom, #161b22, #0f1117);
    border-bottom: 1px solid var(--border);
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 20px;
}

#smart-converter h1 {
    font-size: 1.25rem;
    font-weight: 700;
    margin: 0;
    color: white;
    display: flex;
    align-items: center;
    gap: 10px;
}

#smart-converter .converter-subtitle {
    color: var(--text-grey);
    font-size: 0.9rem;
    margin-top: 5px;
}

#smart-converter .badge {
    background: rgba(99, 102, 241, 0.1);
    color: var(--primary);
    font-size: 0.75rem;
    padding: 4px 8px;
    border-radius: 6px;
    border: 1px solid rgba(99, 102, 241, 0.2);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

/* Conversion Bar */
#smart-converter .conversion-bar {
    display: flex;
    align-items: center;
    gap: 10px;
    background: #0b0d11;
    padding: 6px 10px;
    border-radius: 10px;
    border: 1px solid var(--border);
}

#smart-converter .label-txt {
    color: var(--text-grey);
    font-size: 0.85rem;
    padding: 0 5px;
    font-weight: 500;
}

#smart-converter .magic-select {
    background: #1e293b;
    color: white;
    border: 1px solid #334155;
    padding: 6px 12px;
    border-radius: 6px;
    font-size: 0.85rem;
    font-weight: 600;
    cursor: pointer;
    outline: none;
    transition: 0.2s;
}

#smart-converter .magic-select:hover { border-color: var(--primary); }
#smart-converter .arrow { color: var(--text-grey); font-size: 0.9rem; }

/* --- UPLOAD ZONE (FIXED) --- */
#smart-converter .upload-container {
    padding: 40px;
}

#smart-converter .drop-zone {
    /* Layout */
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    width: 100%;
    
    /* Design */
    background-image: 
        radial-gradient(circle at center, rgba(99, 102, 241, 0.08) 0%, transparent 70%);
    border: 2px dashed var(--border);
    border-radius: 16px;
    padding: 60px 20px;
    text-align: center;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    cursor: pointer;
    position: relative;
}

#smart-converter .drop-zone:hover {
    border-color: var(--primary);
    transform: translateY(-2px);
    box-shadow: 0 10px 30px -10px rgba(99, 102, 241, 0.15);
}

#smart-converter .drop-zone.is-ready,
#smart-converter .drop-zone.is-dragover {
    border-color: var(--primary);
    background-image:
        radial-gradient(circle at center, rgba(48, 103, 255, 0.15) 0%, transparent 70%);
    box-shadow: 0 18px 40px -20px rgba(48, 103, 255, 0.5);
}

#smart-converter .icon-circle {
    width: 60px;
    height: 60px;
    background: #1e293b;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 20px;
    color: var(--primary);
    box-shadow: 0 0 20px rgba(99, 102, 241, 0.2);
}

#smart-converter .drop-title {
    font-size: 1.5rem;
    font-weight: 700;
    margin-bottom: 8px;
    background: linear-gradient(to bottom, #fff, #cbd5e1);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

#smart-converter .drop-desc {
    color: var(--text-grey);
    font-size: 0.95rem;
    margin-bottom: 30px;
}

#smart-converter .drop-preview {
    width: min(100%, 920px);
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(260px, 370px));
    justify-content: center;
    gap: 12px;
    margin: 0 auto 26px;
}

#smart-converter .drop-preview[hidden] { display: none; }

#smart-converter .preview-tile {
    min-width: 0;
    width: 100%;
    overflow: hidden;
    border: 1px solid rgba(48, 103, 255, 0.28);
    border-radius: 14px;
    background: rgba(15, 23, 42, 0.76);
    box-shadow: 0 14px 32px -22px rgba(48, 103, 255, 0.65);
}

#smart-converter .preview-tile img {
    width: 100%;
    aspect-ratio: 16 / 10;
    object-fit: cover;
    display: block;
    background: #02040a;
}

#smart-converter .preview-caption {
    padding: 10px 12px;
    text-align: left;
}

#smart-converter .preview-caption strong,
#smart-converter .drop-file-chip strong {
    display: block;
    color: #fff;
    font-size: 0.84rem;
    line-height: 1.35;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

#smart-converter .preview-caption span,
#smart-converter .drop-file-chip span:not(.fmt-badge) {
    color: var(--text-grey);
    font-size: 0.78rem;
}

#smart-converter .preview-more {
    min-height: 112px;
    display: flex;
    align-items: center;
    justify-content: center;
    border: 1px dashed rgba(148, 163, 184, 0.35);
    border-radius: 14px;
    color: #dbeafe;
    font-weight: 800;
    background: rgba(48, 103, 255, 0.09);
}

#smart-converter .drop-file-chip {
    display: inline-flex;
    align-items: center;
    gap: 12px;
    max-width: min(100%, 520px);
    padding: 14px 16px;
    border-radius: 14px;
    border: 1px solid rgba(48, 103, 255, 0.28);
    background: rgba(15, 23, 42, 0.76);
    text-align: left;
}

/* Button with Gradient */
#smart-converter .btn-upload {
    background: linear-gradient(135deg, #6366f1 0%, #3067ff 100%);
    color: white;
    padding: 14px 40px;
    border-radius: 50px;
    font-weight: 600;
    font-size: 1rem;
    box-shadow: 0 4px 15px rgba(99, 102, 241, 0.3);
    border: 1px solid rgba(255,255,255,0.1);
    transition: 0.2s;
    display: inline-block;
}

#smart-converter .drop-zone:hover .btn-upload {
    box-shadow: 0 8px 25px rgba(99, 102, 241, 0.5);
    transform: scale(1.02);
}

/* --- THE FIX: VISUALLY HIDDEN INPUT --- */
/* This removes the input from layout entirely so no dashed lines appear */
#smart-converter .visually-hidden {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

#smart-converter .converter-alert {
    margin: 20px 40px 0;
    padding: 15px;
    background: rgba(239, 68, 68, 0.1);
    border: 1px solid #ef4444;
    border-radius: 8px;
    color: #fca5a5;
}

#smart-converter .file-queue {
    margin-top: 24px;
    background: rgba(2, 6, 23, 0.55);
    border: 1px solid var(--border);
    border-radius: 16px;
    overflow: hidden;
}

#smart-converter .queue-head,
#smart-converter .upload-actions {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 16px;
    padding: 18px 22px;
    background: rgba(15, 23, 42, 0.75);
}

#smart-converter .queue-head strong {
    display: block;
    color: #fff;
    font-size: 1rem;
}

#smart-converter .queue-head span,
#smart-converter .upload-actions span {
    color: var(--text-grey);
    font-size: 0.86rem;
}

#smart-converter .queue-clear {
    background: rgba(148, 163, 184, 0.08);
    border: 1px solid var(--border);
    color: #cbd5e1;
    border-radius: 8px;
    padding: 8px 14px;
    font-weight: 600;
    cursor: pointer;
    transition: 0.2s;
}

#smart-converter .queue-clear:hover {
    color: #fff;
    border-color: var(--primary);
}

#smart-converter .queue-list {
    max-height: 360px;
    overflow-y: auto;
    padding: 12px;
}

#smart-converter .queue-row {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 12px;
    border: 1px solid rgba(30, 41, 59, 0.85);
    border-radius: 12px;
    background: rgba(15, 17, 23, 0.75);
    margin-bottom: 10px;
}

#smart-converter .queue-row:last-child { margin-bottom: 0; }

#smart-converter .queue-row.is-warning {
    border-color: rgba(245, 158, 11, 0.65);
    background: rgba(245, 158, 11, 0.08);
}

#smart-converter .queue-file-main {
    min-width: 0;
    display: flex;
    flex-direction: column;
    gap: 2px;
}

#smart-converter .queue-file-main strong {
    color: #fff;
    font-size: 0.95rem;
    overflow-wrap: anywhere;
}

#smart-converter .queue-file-meta,
#smart-converter .result-meta {
    color: var(--text-grey);
    font-size: 0.82rem;
}

#smart-converter .btn-convert {
    background: linear-gradient(135deg, #3067ff 0%, #6d7cff 100%);
    color: #fff;
    border: 0;
    border-radius: 10px;
    padding: 12px 24px;
    font-weight: 700;
    cursor: pointer;
    box-shadow: 0 8px 24px rgba(48, 103, 255, 0.25);
    transition: 0.2s;
    white-space: nowrap;
}

#smart-converter .btn-convert:hover:not(:disabled) {
    transform: translateY(-1px);
    box-shadow: 0 12px 30px rgba(48, 103, 255, 0.38);
}

#smart-converter .btn-convert:disabled {
    cursor: not-allowed;
    opacity: 0.5;
    box-shadow: none;
}

/* --- RESULTS AREA --- */
#smart-converter .results-area { padding: 40px; }

#smart-converter .success-msg {
    text-align: center;
    margin-bottom: 30px;
}
#smart-converter .success-msg h2 { color: #10b981; margin: 0 0 5px 0; }
#smart-converter .success-msg p { color: var(--text-grey); margin: 0; }

#smart-converter .file-row {
    background: #0f1117;
    border: 1px solid var(--border);
    padding: 12px 20px;
    border-radius: 12px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 10px;
    transition: 0.2s;
}

#smart-converter .file-row:hover { border-color: var(--primary); }

#smart-converter .file-left { display: flex; align-items: center; gap: 15px; }
#smart-converter .fmt-badge {
    background: #1e293b;
    color: #94a3b8;
    font-size: 0.7rem;
    font-weight: 800;
    padding: 4px 8px;
    border-radius: 4px;
}
#smart-converter .fname {
    display: block;
    font-weight: 500;
    font-size: 0.95rem;
    overflow-wrap: anywhere;
}

#smart-converter .btn-dl {
    color: var(--primary);
    background: rgba(99, 102, 241, 0.1);
    padding: 8px 16px;
    border-radius: 8px;
    font-weight: 600;
    text-decoration: none;
    font-size: 0.9rem;
    transition: 0.2s;
}
#smart-converter .btn-dl:hover { background: var(--primary); color: white; }

#smart-converter .footer-actions {
    margin-top: 30px;
    padding-top: 20px;
    border-top: 1px solid var(--border);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

#smart-converter .link-reset { color: var(--text-grey); text-decoration: none; font-size: 0.9rem; }
#smart-converter .link-reset:hover { color: white; }

#smart-converter .btn-zip {
    background: #10b981;
    color: white;
    padding: 10px 24px;
    border-radius: 8px;
    text-decoration: none;
    font-weight: 600;
    box-shadow: 0 4px 15px rgba(16, 185, 129, 0.25);
}

/* Mobile */
@media (max-width: 600px) {
    #smart-converter {
        padding: 40px 12px 0;
    }

    #smart-converter .converter-seo-hero {
        padding: 22px 18px;
    }

    #smart-converter .converter-seo-points span {
        width: 100%;
    }

    #smart-converter .header-section { flex-direction: column; align-items: flex-start; }
    #smart-converter .conversion-bar { width: 100%; justify-content: space-between; flex-wrap: wrap; }
    #smart-converter .file-row { flex-direction: column; align-items: flex-start; gap: 10px; }
    #smart-converter .btn-dl { width: 100%; text-align: center; }
    #smart-converter .upload-container,
    #smart-converter .results-area { padding: 22px; }
    #smart-converter .drop-zone { padding: 42px 16px; }
    #smart-converter .drop-preview { grid-template-columns: minmax(0, 100%); }
    #smart-converter .queue-head,
    #smart-converter .upload-actions { flex-direction: column; align-items: stretch; }
    #smart-converter .btn-convert { width: 100%; }
}
