:root {
    --bg-color: #F8FAFC;
    --text-color: #0F172A;
    --text-muted: #64748B;
    --accent-color: #F59E0B;
    --accent-hover: #D97706;
    --accent-light: #FEF3C7;
    --card-bg: #FFFFFF;
    --border-color: #E2E8F0;
    --primary-btn: #0F172A;
    --primary-btn-hover: #1E293B;
    --radius-sm: 8px;
    --radius-md: 12px;
    --radius-lg: 16px;
    --shadow-soft: 0 4px 20px -2px rgba(15, 23, 42, 0.05);
    --shadow-glow: 0 0 25px rgba(245, 158, 11, 0.25);
}

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
    font-family: 'Plus Jakarta Sans', system-ui, -apple-system, sans-serif;
}

body.rtl * {
    font-family: 'Vazirmatn', 'Cairo', 'Plus Jakarta Sans', system-ui, sans-serif;
}

html[lang="fa"] *, body[lang="fa"] * {
    font-family: 'Vazirmatn', 'Cairo', system-ui, -apple-system, sans-serif;
}

body {
    background-color: var(--bg-color);
    color: var(--text-color);
    line-height: 1.6;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    -webkit-font-smoothing: antialiased;
}

.container {
    width: 100%;
    max-width: 960px;
    margin: 0 auto;
    padding: 0 16px;
}

/* NAVBAR */
.navbar {
    background: var(--card-bg);
    border-bottom: 1px solid var(--border-color);
    padding: 12px 0;
    position: sticky;
    top: 0;
    z-index: 100;
    backdrop-filter: blur(8px);
}

.nav-content {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 12px;
}

.nav-left {
    display: flex;
    align-items: center;
}

.logo {
    font-size: 22px;
    font-weight: 900;
    text-decoration: none;
    color: var(--text-color);
    letter-spacing: -0.5px;
    display: inline-flex;
    align-items: center;
    white-space: nowrap;
}

.logo-accent {
    color: #EAB308;
    background: linear-gradient(135deg, #F59E0B, #EAB308);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    padding: 0 2px;
    position: relative;
    font-style: italic;
    font-weight: 900;
}

.nav-links {
    display: flex;
    align-items: center;
    gap: 14px;
}

.nav-link {
    display: inline-block;
    text-decoration: none;
    color: var(--text-muted);
    font-size: 14px;
    font-weight: 600;
    line-height: 1.5;
    padding: 6px 10px;
    margin: 0;
    border-radius: var(--radius-sm);
    box-sizing: border-box;
    white-space: nowrap;
    transition: color 0.2s ease, background-color 0.2s ease;
}

.nav-link:hover {
    color: var(--text-color);
    background: #F1F5F9;
}

.nav-right {
    display: flex;
    align-items: center;
}

.lang-selector {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    background: #F8FAFC;
    border: 1px solid var(--border-color);
    padding: 4px 10px;
    border-radius: 20px;
}

.globe-icon {
    color: var(--text-muted);
    flex-shrink: 0;
}

.lang-selector select {
    border: none;
    background: transparent;
    outline: none;
    font-size: 13px;
    font-weight: 700;
    color: var(--text-color);
    cursor: pointer;
    padding-right: 4px;
}

/* RESPONSIVE HEADER FOR MOBILE */
@media (max-width: 640px) {
    .navbar {
        padding: 10px 0;
    }
    
    .nav-content {
        flex-wrap: wrap;
        row-gap: 8px;
    }
    
    .logo {
        font-size: 20px;
    }
    
    .nav-links {
        order: 3;
        width: 100%;
        display: flex;
        justify-content: center;
        align-items: center;
        gap: 8px;
        padding-top: 8px;
        margin-top: 4px;
        border-top: 1px solid var(--border-color);
        box-sizing: border-box;
    }
    
    .nav-link {
        font-size: 13px;
        padding: 6px 10px;
        border-radius: var(--radius-sm);
    }
}

/* HERO SECTION */
.hero {
    text-align: center;
    padding: 48px 0 24px;
    min-height: 280px;
    contain: layout;
}

.hero h1 {
    font-size: 32px;
    font-weight: 900;
    margin-bottom: 12px;
    letter-spacing: -0.5px;
    color: var(--text-color);
    line-height: 1.25;
}

@media (min-width: 640px) {
    .hero { 
        padding: 64px 0 32px;
        min-height: 320px;
    }
    .hero h1 { font-size: 42px; }
}

.hero p {
    font-size: 16px;
    color: var(--text-muted);
    max-width: 600px;
    margin: 0 auto 32px;
}

/* INPUT BOX & 2026 BUTTON */
.input-group {
    display: flex;
    flex-direction: column;
    gap: 12px;
    max-width: 680px;
    margin: 0 auto;
}

@media (min-width: 640px) {
    .input-group {
        flex-direction: row;
        background: #fff;
        padding: 6px;
        border-radius: 16px;
        border: 2px solid var(--border-color);
        box-shadow: var(--shadow-soft);
        transition: border-color 0.2s, box-shadow 0.2s;
    }
    
    .input-group:focus-within {
        border-color: var(--accent-color);
        box-shadow: 0 0 0 4px rgba(245, 158, 11, 0.15);
    }
    
    .input-group input {
        border: none !important;
        border-radius: 0 !important;
        box-shadow: none !important;
    }
}

.input-group input {
    flex: 1;
    padding: 16px 20px;
    border: 2px solid var(--border-color);
    border-radius: var(--radius-md);
    font-size: 15px;
    outline: none;
    background: #fff;
    color: var(--text-color);
    transition: all 0.2s ease;
}

.input-group input:focus {
    border-color: var(--accent-color);
}

.btn-fetch-2026 {
    background: linear-gradient(135deg, #F59E0B, #EAB308);
    color: #0F172A;
    border: none;
    padding: 16px 28px;
    font-size: 15px;
    font-weight: 700;
    cursor: pointer;
    border-radius: var(--radius-md);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    position: relative;
    overflow: hidden;
    transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: 0 4px 14px rgba(245, 158, 11, 0.35);
}

.btn-fetch-2026:hover:not(:disabled) {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(245, 158, 11, 0.45);
    filter: brightness(1.05);
}

.btn-fetch-2026:active:not(:disabled) {
    transform: translateY(0);
}

.btn-fetch-2026:disabled {
    opacity: 0.85;
    cursor: wait;
}

/* 2026 LUXURY LOADING STATE */
.loading-box-2026 {
    background: linear-gradient(135deg, rgba(255,255,255,0.9), rgba(254,243,199,0.3));
    border: 1px solid #FDE68A;
    border-radius: var(--radius-lg);
    padding: 24px;
    max-width: 600px;
    margin: 24px auto 0;
    box-shadow: 0 10px 25px -5px rgba(245, 158, 11, 0.1);
    animation: pulseLoader 2s infinite ease-in-out;
}

@keyframes pulseLoader {
    0%, 100% { transform: scale(1); box-shadow: 0 10px 25px -5px rgba(245, 158, 11, 0.1); }
    50% { transform: scale(1.01); box-shadow: 0 15px 30px -5px rgba(245, 158, 11, 0.2); }
}

.loader-wave {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 6px;
    margin-bottom: 12px;
}

.loader-wave-bar {
    width: 6px;
    height: 24px;
    background: linear-gradient(to top, #F59E0B, #FBBF24);
    border-radius: 4px;
    animation: waveAnim 1.2s infinite ease-in-out;
}

.loader-wave-bar:nth-child(1) { animation-delay: -0.4s; }
.loader-wave-bar:nth-child(2) { animation-delay: -0.3s; }
.loader-wave-bar:nth-child(3) { animation-delay: -0.2s; }
.loader-wave-bar:nth-child(4) { animation-delay: -0.1s; }
.loader-wave-bar:nth-child(5) { animation-delay: 0s; }

@keyframes waveAnim {
    0%, 40%, 100% { transform: scaleY(0.4); opacity: 0.6; }
    20% { transform: scaleY(1.2); opacity: 1; }
}

.loading-text-dynamic {
    font-size: 15px;
    font-weight: 700;
    color: #92400E;
    text-align: center;
}

/* RESULTS SECTION */
#resultsSection,
.results {
    background: var(--card-bg);
    max-width: 720px;
    margin: 32px auto;
    padding: 24px;
    border-radius: var(--radius-lg);
    border: 1px solid var(--border-color);
    box-shadow: var(--shadow-soft);
    min-height: 280px;
}

.media-header {
    display: flex;
    flex-direction: column;
    gap: 16px;
    margin-bottom: 24px;
    background: #F8FAFC;
    padding: 16px;
    border-radius: var(--radius-md);
    border: 1px solid var(--border-color);
}

@media (min-width: 540px) {
    .media-header {
        flex-direction: row;
        align-items: center;
    }
}

.media-thumb-wrapper {
    position: relative;
    width: 100%;
    max-width: 180px;
    height: 110px;
    border-radius: var(--radius-sm);
    overflow: hidden;
    background: #0F172A;
    flex-shrink: 0;
    box-shadow: 0 4px 10px rgba(0,0,0,0.1);
}

.media-thumb-wrapper img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.media-info {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.media-info h3 {
    font-size: 16px;
    font-weight: 800;
    color: var(--text-color);
    line-height: 1.4;
}

.media-duration-badge {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    background: #E2E8F0;
    color: #334155;
    padding: 3px 8px;
    border-radius: 6px;
    font-size: 13px;
    font-weight: 700;
    width: fit-content;
}

/* FORMAT CARDS */
#formatsList,
.formats {
    display: flex;
    flex-direction: column;
    gap: 10px;
    min-height: 200px;
}

.format-card {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 14px 18px;
    background: #FFFFFF;
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    transition: all 0.2s ease;
    gap: 12px;
}

.format-card:hover {
    border-color: var(--accent-color);
    transform: translateX(-2px);
    box-shadow: 0 4px 12px rgba(15, 23, 42, 0.05);
}

body.ltr .format-card:hover {
    transform: translateX(2px);
}

.format-info-left {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.format-badge-row {
    display: flex;
    align-items: center;
    gap: 8px;
}

.format-quality-pill {
    background: #0F172A;
    color: #FFFFFF;
    font-size: 12px;
    font-weight: 800;
    padding: 2px 8px;
    border-radius: 4px;
}

.format-quality-pill.audio-pill {
    background: #D97706;
}

.format-size-pill {
    background: #F1F5F9;
    color: #334155;
    font-size: 11.5px;
    font-weight: 800;
    padding: 2px 8px;
    border-radius: 6px;
    border: 1px solid #CBD5E1;
    display: inline-flex;
    align-items: center;
    gap: 3px;
}

.format-recommended-pill {
    background: #FEF3C7;
    color: #92400E;
    font-size: 11px;
    font-weight: 800;
    padding: 2px 8px;
    border-radius: 6px;
    border: 1px solid #FCD34D;
    display: inline-flex;
    align-items: center;
    box-shadow: 0 1px 2px rgba(0,0,0,0.05);
}

.recommended-format-card {
    background: #FFFDF5 !important;
    border: 2px solid #F59E0B !important;
    box-shadow: 0 4px 14px rgba(245, 158, 11, 0.12) !important;
}

.btn-download-item-recommended {
    background: linear-gradient(135deg, #F59E0B 0%, #D97706 100%) !important;
    color: #0F172A !important;
    font-weight: 800 !important;
    box-shadow: 0 4px 10px rgba(245, 158, 11, 0.25) !important;
}

.btn-download-item-recommended:hover {
    background: linear-gradient(135deg, #D97706 0%, #B45309 100%) !important;
    color: #FFFFFF !important;
}

.format-label {
    font-size: 13px;
    color: var(--text-muted);
    font-weight: 500;
}

.btn-download-item {
    background: #0F172A;
    color: #FFFFFF;
    border: none;
    padding: 10px 20px;
    border-radius: var(--radius-sm);
    font-size: 14px;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.2s ease;
    white-space: nowrap;
    display: inline-flex;
    align-items: center;
    gap: 6px;
}

.btn-download-item:hover {
    background: #1E293B;
    transform: scale(1.03);
}

.hidden { display: none !important; }

/* SEO & FOOTER */
.seo-content {
    margin-top: 48px;
    padding-top: 32px;
    border-top: 1px solid var(--border-color);
}

.seo-rich-wrapper {
    margin-top: 40px;
    padding-top: 36px;
    border-top: 1px solid var(--border-color);
}

.seo-rich-wrapper h2 {
    font-size: 26px;
    font-weight: 900;
    color: var(--text-color);
    margin-top: 32px;
    margin-bottom: 16px;
    line-height: 1.4;
}

.seo-rich-wrapper h3 {
    font-size: 19px;
    font-weight: 800;
    color: #1E293B;
    margin-top: 24px;
    margin-bottom: 12px;
}

.seo-rich-wrapper p {
    color: #334155;
    font-size: 15px;
    line-height: 1.85;
    margin-bottom: 18px;
}

.seo-rich-wrapper ul, .seo-rich-wrapper ol {
    margin: 16px 0 24px 24px;
    color: #334155;
    font-size: 14.5px;
    line-height: 1.8;
}

body.rtl .seo-rich-wrapper ul, body.rtl .seo-rich-wrapper ol {
    margin: 16px 24px 24px 0;
}

.seo-rich-wrapper li {
    margin-bottom: 10px;
}

.seo-rich-wrapper mark {
    background: #FEF3C7;
    color: #92400E;
    padding: 2px 6px;
    border-radius: 4px;
    font-weight: 600;
}

.seo-rich-wrapper dfn {
    font-style: normal;
    font-weight: 800;
    color: #0F172A;
    text-decoration: underline dotted #3B82F6;
    cursor: help;
}

.seo-table-responsive {
    width: 100%;
    overflow-x: auto;
    margin: 24px 0;
    border: 1px solid #E2E8F0;
    border-radius: 12px;
    background: #FFFFFF;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.02);
}

.seo-table {
    width: 100%;
    border-collapse: collapse;
    text-align: left;
    font-size: 14px;
}

body.rtl .seo-table {
    text-align: right;
}

.seo-table th {
    background: #F8FAFC;
    color: #0F172A;
    font-weight: 800;
    padding: 14px 16px;
    border-bottom: 2px solid #E2E8F0;
    font-size: 13.5px;
    text-transform: uppercase;
    letter-spacing: 0.03em;
}

.seo-table td {
    padding: 14px 16px;
    border-bottom: 1px solid #F1F5F9;
    color: #334155;
    vertical-align: middle;
}

.seo-table tr:last-child td {
    border-bottom: none;
}

.seo-table tr:hover td {
    background: #F8FAFC;
}

.seo-dl {
    display: grid;
    grid-template-columns: 1fr;
    gap: 16px;
    margin: 24px 0;
}

@media (min-width: 768px) {
    .seo-dl {
        grid-template-columns: 1fr 1fr;
    }
}

.seo-dl-card {
    background: #FFFFFF;
    border: 1px solid #E2E8F0;
    border-radius: 12px;
    padding: 20px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.02);
}

.seo-dl dt {
    font-weight: 800;
    font-size: 16px;
    color: #0F172A;
    margin-bottom: 8px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.seo-dl dd {
    margin: 0;
    font-size: 14px;
    line-height: 1.7;
    color: #475569;
}

.seo-badge-tag {
    display: inline-block;
    padding: 4px 10px;
    background: #EFF6FF;
    color: #1D4ED8;
    border-radius: 6px;
    font-size: 12px;
    font-weight: 700;
    margin-right: 6px;
    margin-bottom: 6px;
    border: 1px solid #DBEAFE;
}

.seo-rich-wrapper ol.custom-steps {
    counter-reset: step-counter;
    list-style: none;
    padding: 0;
    margin: 20px 0;
}

.seo-rich-wrapper ol.custom-steps li {
    counter-increment: step-counter;
    position: relative;
    padding-left: 48px;
    margin-bottom: 18px;
    font-size: 15px;
    line-height: 1.7;
}

body.rtl .seo-rich-wrapper ol.custom-steps li {
    padding-left: 0;
    padding-right: 48px;
}

.seo-rich-wrapper ol.custom-steps li::before {
    content: counter(step-counter);
    position: absolute;
    left: 0;
    top: 0;
    width: 32px;
    height: 32px;
    background: #2563EB;
    color: #FFFFFF;
    font-weight: 800;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 14px;
}

body.rtl .seo-rich-wrapper ol.custom-steps li::before {
    left: auto;
    right: 0;
}

.seo-highlight-card {
    background: #FFFFFF;
    border: 1px solid #E2E8F0;
    border-radius: var(--radius-md);
    padding: 22px;
    margin: 20px 0;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.03);
}

.faq-accordion-group {
    display: flex;
    flex-direction: column;
    gap: 12px;
    margin-top: 20px;
}

/* SIMPLIFIED CROSS-BROWSER ACCORDION (0 CLS & FULL MOBILE COMPATIBILITY) */
details,
.faq-item {
    display: block;
    background-color: #FFFFFF;
    margin: 0 0 12px 0;
    padding: 14px 18px;
    border: 1px solid #E2E8F0;
    border-radius: 8px;
    cursor: pointer;
    box-sizing: border-box;
    transition: background-color 0.2s ease, border-color 0.2s ease;
    -webkit-tap-highlight-color: transparent;
}

details:hover,
.faq-item:hover {
    border-color: #CBD5E1;
    background-color: #F8FAFC;
}

details[open],
.faq-item[open] {
    border-color: #94A3B8;
    background-color: #FFFFFF;
}

summary {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-weight: 700;
    font-size: 15px;
    line-height: 1.4;
    color: var(--text-color);
    outline: none;
    cursor: pointer;
    list-style: none;
    list-style-type: none;
    user-select: none;
    -webkit-tap-highlight-color: transparent;
}

summary::-webkit-details-marker {
    display: none;
}

summary::marker {
    display: none;
}

details p,
details[open] p,
.faq-item p {
    margin: 12px 0 0 0;
    padding: 0;
    color: #475569;
    font-size: 14px;
    line-height: 1.65;
}

/* DIAGNOSTICS BUTTON (CLEAN STANDARD CSS) */
.btn-diag {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    background-color: #F1F5F9;
    color: #334155;
    border: 1px solid #CBD5E1;
    border-radius: 8px;
    padding: 8px 16px;
    margin: 0;
    font-size: 12.5px;
    font-weight: 700;
    cursor: pointer;
    text-decoration: none;
    box-sizing: border-box;
    transition: background-color 0.2s ease, border-color 0.2s ease, color 0.2s ease;
    -webkit-tap-highlight-color: transparent;
}

.btn-diag:hover {
    background-color: #E2E8F0;
    border-color: #94A3B8;
    color: #0F172A;
}

.btn-diag:active {
    background-color: #CBD5E1;
}

.footer {
    background: #0F172A;
    border-top: 1px solid #1E293B;
    padding: 36px 0;
    margin-top: auto;
}

.footer-content {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 16px;
    text-align: center;
}

.footer-links a {
    margin: 0 12px;
    text-decoration: none;
    color: #F8FAFC;
    font-size: 14.5px;
    font-weight: 700;
    transition: color 0.2s ease;
}

.footer-links a:hover {
    color: #F59E0B;
}

.footer p {
    color: #E2E8F0;
    font-size: 13.5px;
    font-weight: 500;
}
