:root {
    --bg-dark: #0a0e17;
    --bg-card: rgba(255, 255, 255, 0.05);
    --bg-card-hover: rgba(255, 255, 255, 0.08);
    --border-subtle: rgba(255, 255, 255, 0.1);
    --text-primary: #f0f4ff;
    --text-muted: #94a3b8;
    --accent: #6366f1;
    --accent-light: #818cf8;
    --gradient-hero: linear-gradient(135deg, #1e1b4b 0%, #312e81 50%, #0f172a 100%);
    --gradient-accent: linear-gradient(135deg, #6366f1, #a855f7);
    --shadow-card: 0 8px 32px rgba(0, 0, 0, 0.3);
    --radius: 16px;
}

* {
    box-sizing: border-box;
}

body {
    background: var(--bg-dark);
    color: var(--text-primary);
    min-height: 100vh;
    line-height: 1.7;
}

body.font-fa {
    font-family: "Vazirmatn", system-ui, sans-serif;
}

body.font-en {
    font-family: "Inter", system-ui, sans-serif;
}

a {
    color: var(--accent-light);
    text-decoration: none;
    transition: color 0.2s;
}

a:hover {
    color: #c4b5fd;
}

/* Navbar */
.site-nav {
    background: rgba(10, 14, 23, 0.85);
    backdrop-filter: blur(12px);
    border-bottom: 1px solid var(--border-subtle);
    padding: 0.75rem 0;
}

.navbar-brand {
    font-size: 1.25rem;
    letter-spacing: -0.02em;
}

.brand-icon {
    background: var(--gradient-accent);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.nav-link {
    color: var(--text-muted) !important;
    font-weight: 500;
    padding: 0.5rem 1rem !important;
    border-radius: 8px;
    transition: all 0.2s;
}

.nav-link:hover {
    color: var(--text-primary) !important;
    background: var(--bg-card);
}

.lang-switch .btn-outline-light {
    border-color: var(--border-subtle);
    color: var(--text-muted);
}

/* Hero */
.hero-section {
    background: var(--gradient-hero);
    padding: 5rem 0 4rem;
    position: relative;
    overflow: hidden;
}

.hero-section::before {
    content: "";
    position: absolute;
    top: -50%;
    right: -20%;
    width: 60%;
    height: 200%;
    background: radial-gradient(circle, rgba(99, 102, 241, 0.15) 0%, transparent 70%);
    pointer-events: none;
}

.hero-content {
    position: relative;
    z-index: 1;
}

.hero-badge {
    display: inline-block;
    background: var(--bg-card);
    border: 1px solid var(--border-subtle);
    padding: 0.35rem 1rem;
    border-radius: 999px;
    font-size: 0.85rem;
    color: var(--accent-light);
    margin-bottom: 1.25rem;
}

.hero-title {
    font-size: clamp(2rem, 5vw, 3.25rem);
    font-weight: 700;
    letter-spacing: -0.03em;
    margin-bottom: 1rem;
    background: linear-gradient(to right, #fff, #c4b5fd);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.hero-subtitle {
    font-size: 1.15rem;
    color: var(--text-muted);
    max-width: 600px;
    margin: 0 auto;
}

/* Sections */
.section-header h2 {
    font-weight: 700;
    font-size: 1.75rem;
    margin-bottom: 0.25rem;
}

.section-header p {
    margin-bottom: 1.5rem;
}

/* Category cards */
.category-card {
    display: block;
    background: var(--bg-card);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius);
    padding: 2rem;
    height: 100%;
    transition: all 0.3s;
    color: var(--text-primary);
}

.category-card:hover {
    background: var(--bg-card-hover);
    border-color: rgba(99, 102, 241, 0.4);
    transform: translateY(-4px);
    box-shadow: var(--shadow-card);
    color: var(--text-primary);
}

.category-icon {
    font-size: 2.5rem;
    display: block;
    margin-bottom: 1rem;
}

.category-icon-lg {
    font-size: 3rem;
    display: block;
    margin-bottom: 0.5rem;
}

.category-card h3 {
    font-size: 1.25rem;
    font-weight: 600;
    margin-bottom: 0.5rem;
}

.category-link {
    font-size: 0.9rem;
    color: var(--accent-light);
}

/* Article cards */
.article-card {
    background: var(--bg-card);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius);
    overflow: hidden;
    height: 100%;
    transition: all 0.3s;
}

.article-card:hover {
    border-color: rgba(99, 102, 241, 0.3);
    box-shadow: var(--shadow-card);
}

.article-card .card-body {
    padding: 1.5rem;
}

.article-card h3 {
    font-size: 1.1rem;
    font-weight: 600;
    margin: 0.75rem 0;
    line-height: 1.4;
}

.article-card h3 a {
    color: var(--text-primary);
}

.article-card h3 a:hover {
    color: var(--accent-light);
}

.article-card p {
    color: var(--text-muted);
    font-size: 0.95rem;
    margin-bottom: 0.75rem;
}

.card-image {
    height: 180px;
    background-size: cover;
    background-position: center;
}

.card-image-placeholder {
    background: var(--gradient-accent);
    opacity: 0.3;
}

.card-image-sm {
    width: 120px;
    min-height: 120px;
    background-size: cover;
    background-position: center;
    border-radius: var(--radius);
    flex-shrink: 0;
}

.horizontal-card {
    display: flex;
    gap: 1.25rem;
    padding: 1.25rem;
}

.horizontal-card .card-body {
    padding: 0;
}

.featured-card {
    border-color: rgba(168, 85, 247, 0.3);
}

.category-badge {
    background: rgba(99, 102, 241, 0.2);
    color: var(--accent-light);
    font-weight: 500;
    font-size: 0.75rem;
}

.featured-badge {
    background: rgba(168, 85, 247, 0.2);
    color: #c4b5fd;
}

/* Article detail */
.article-header h1 {
    font-size: clamp(1.75rem, 4vw, 2.5rem);
    font-weight: 700;
    line-height: 1.3;
    margin: 0.75rem 0;
}

.article-meta {
    display: flex;
    align-items: center;
    gap: 1rem;
    color: var(--text-muted);
    font-size: 0.95rem;
}

.article-cover {
    height: 400px;
    background-size: cover;
    background-position: center;
    border-radius: var(--radius);
    border: 1px solid var(--border-subtle);
}

.article-summary {
    color: var(--text-muted);
    font-size: 1.15rem;
    border-left: 3px solid var(--accent);
    padding-left: 1.25rem;
}

[dir="rtl"] .article-summary {
    border-left: none;
    border-right: 3px solid var(--accent);
    padding-left: 0;
    padding-right: 1.25rem;
}

.article-content {
    font-size: 1.05rem;
    line-height: 1.85;
    color: #cbd5e1;
}

.article-content p {
    margin-bottom: 1.25rem;
}

.related-articles h2 {
    font-size: 1.35rem;
    font-weight: 600;
}

.related-card {
    display: block;
    background: var(--bg-card);
    border: 1px solid var(--border-subtle);
    border-radius: 12px;
    padding: 1.25rem;
    color: var(--text-primary);
    transition: all 0.2s;
}

.related-card:hover {
    border-color: var(--accent);
    color: var(--text-primary);
}

.related-card h4 {
    font-size: 1rem;
    font-weight: 600;
    margin-bottom: 0.5rem;
}

/* Breadcrumb */
.breadcrumb {
    background: transparent;
    padding: 0;
}

.breadcrumb-item a {
    color: var(--text-muted);
}

.breadcrumb-item.active {
    color: var(--text-primary);
}

.breadcrumb-item + .breadcrumb-item::before {
    color: var(--text-muted);
}

/* Pagination */
.pagination .page-link {
    background: var(--bg-card);
    border-color: var(--border-subtle);
    color: var(--text-primary);
}

.pagination .page-item.active .page-link {
    background: var(--accent);
    border-color: var(--accent);
}

/* Footer */
.site-footer {
    border-top: 1px solid var(--border-subtle);
    background: rgba(0, 0, 0, 0.2);
}

/* 404 */
.error-page h1 {
    background: var(--gradient-accent);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.btn-primary {
    background: var(--gradient-accent);
    border: none;
    padding: 0.6rem 1.5rem;
    border-radius: 10px;
    font-weight: 500;
}

.btn-primary:hover {
    opacity: 0.9;
    background: var(--gradient-accent);
}

/* Videos */
.video-card {
    display: block;
    background: var(--bg-card);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius);
    overflow: hidden;
    height: 100%;
    color: var(--text-primary);
    transition: all 0.3s;
}

.video-card:hover {
    border-color: rgba(99, 102, 241, 0.4);
    box-shadow: var(--shadow-card);
    transform: translateY(-3px);
    color: var(--text-primary);
}

.video-thumb {
    position: relative;
    aspect-ratio: 16 / 9;
    background: #111827;
    overflow: hidden;
}

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

.video-thumb-placeholder {
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 2.5rem;
    color: var(--accent-light);
    background: linear-gradient(135deg, #1e1b4b, #312e81);
}

.play-badge {
    position: absolute;
    bottom: 0.75rem;
    right: 0.75rem;
    background: rgba(0, 0, 0, 0.7);
    color: #fff;
    padding: 0.25rem 0.75rem;
    border-radius: 999px;
    font-size: 0.8rem;
}

[dir="rtl"] .play-badge {
    right: auto;
    left: 0.75rem;
}

.video-card-body {
    padding: 1.25rem;
}

.video-card-body h3 {
    font-size: 1.05rem;
    font-weight: 600;
    margin: 0.5rem 0;
    line-height: 1.4;
}

.featured-video-card {
    border-color: rgba(168, 85, 247, 0.35);
}

.video-player-wrap {
    border-radius: var(--radius);
    overflow: hidden;
    border: 1px solid var(--border-subtle);
    background: #000;
}

.video-player {
    width: 100%;
    max-height: 70vh;
    display: block;
    background: #000;
}

@media (max-width: 768px) {
    .horizontal-card {
        flex-direction: column;
    }

    .card-image-sm {
        width: 100%;
        height: 160px;
    }

    .article-cover {
        height: 240px;
    }
}
