/* CSS Variables for Easy Theme Management */
:root {
    --primary-color: #ff5555;
    --dark-bg: linear-gradient(135deg, #2b2b2b 0%, #3c3c3c 100%);
    --light-bg: linear-gradient(135deg, #f5f5f5 0%, #e0e0e0 100%);
    --dark-container-bg: #444;
    --light-container-bg: #fff;
    --dark-shadow: 0 8px 24px rgba(0, 0, 0, 0.6);
    --light-shadow: 0 8px 24px rgba(0, 0, 0, 0.2);
    --glass-bg: rgba(255, 255, 255, 0.15);
    --glass-bg-light: rgba(0, 0, 0, 0.15);
    --glass-hover: rgba(255, 85, 85, 0.3);
}

/* Reset and Base Styles */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Inter', 'Vazirmatn', Arial, sans-serif;
    line-height: 1.8;
    padding: 20px;
    transition: background 0.3s ease, color 0.3s ease;
}

body.dark-mode {
    background: var(--dark-bg);
    color: #ddd;
}

body.light-mode {
    background: var(--light-bg);
    color: #333;
}

/* Container */
.container {
    max-width: 960px;
    margin: 0 auto;
    padding: 40px;
    border-radius: 12px;
    transition: background 0.3s ease, box-shadow 0.3s ease;
}

body.dark-mode .container {
    background: var(--dark-container-bg);
    box-shadow: var(--dark-shadow);
}

body.light-mode .container {
    background: var(--light-container-bg);
    box-shadow: var(--light-shadow);
}

.container:hover {
    transform: translateY(-5px);
}

/* Navigation Bar */
.header-controls {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 24px;
}

.navbar {
    display: flex;
    align-items: center;
    gap: 1rem;
    z-index: 1000;
}

.nav-logo {
    font-size: 1.5rem;
    color: inherit;
    text-decoration: none;
}

.hamburger {
    display: none;
    background: var(--glass-bg);
    backdrop-filter: blur(12px);
    border: none;
    padding: 12px;
    border-radius: 8px;
    cursor: pointer;
    color: inherit;
}

body.light-mode .hamburger {
    background: var(--glass-bg-light);
}

.nav-menu {
    display: flex;
    list-style: none;
    gap: 1rem;
}

.nav-menu li {
    position: relative;
}

.dropdown-toggle {
    background: none;
    border: none;
    cursor: pointer;
}

.dropdown-menu {
    display: none;
    position: absolute;
    background: var(--glass-bg);
    backdrop-filter: blur(12px);
    padding: 0.5rem;
    border-radius: 8px;
    top: 100%;
    left: 0;
    width: 200px;
    max-height: 300px;
    overflow-y: auto;
    z-index: 1001;
}

body.light-mode .dropdown-menu {
    background: var(--glass-bg-light);
}

.dropdown:hover .dropdown-menu {
    display: block;
}

.dropdown-menu li {
    margin: 0.5rem 0;
}

.dropdown-menu a {
    color: inherit;
    text-decoration: none;
    display: block;
    padding: 0.5rem;
}

.dropdown-menu a:hover {
    background: var(--glass-hover);
    border-radius: 4px;
}

/* Controls */
.controls {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.language-switcher select {
    padding: 12px 16px;
    font-size: 1rem;
    border-radius: 8px;
    border: none;
    background: var(--glass-bg);
    backdrop-filter: blur(12px);
    color: inherit;
    cursor: pointer;
    transition: background 0.3s ease;
}

body.light-mode .language-switcher select {
    background: var(--glass-bg-light);
}

.language-switcher select:hover {
    background: var(--glass-hover);
}

.glass-button {
    padding: 12px 20px;
    background: var(--glass-bg);
    backdrop-filter: blur(12px);
    border: none;
    border-radius: 8px;
    color: inherit;
    cursor: pointer;
    font-size: 1rem;
    font-weight: 600;
    transition: background 0.3s ease, transform 0.3s ease;
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
}

body.light-mode .glass-button {
    background: var(--glass-bg-light);
    color: #333;
}

.glass-button:hover {
    background: var(--glass-hover);
    transform: scale(1.05);
}

/* Header */
.header {
    text-align: center;
    margin-bottom: 40px;
}

.header h1 {
    font-size: 2.8rem;
    font-weight: 700;
    margin-bottom: 12px;
    text-transform: uppercase;
    letter-spacing: 1px;
}

body.dark-mode .header h1 {
    color: #fff;
}

body.light-mode .header h1 {
    color: #333;
}

.header .slogan {
    color: var(--primary-color);
    font-size: 1.4rem;
    font-weight: 600;
    animation: fadeIn 1s ease-in-out;
}

/* Slider */
.slider {
    position: relative;
    width: 100%;
    overflow: hidden;
    margin-bottom: 40px;
    z-index: 1;
}

.slides {
    display: flex;
}

.slide {
    width: 100%;
}

.slide img {
    width: 100%;
    max-height: 400px;
    object-fit: cover;
    border-radius: 12px;
}

/* Sections */
.section {
    padding: 24px;
    border-radius: 12px;
    margin-bottom: 40px;
    animation: slideUp 1s ease-in-out;
}

body.dark-mode .section {
    background: var(--dark-container-bg);
}

body.light-mode .section {
    background: var(--light-container-bg);
}

.section h2 {
    font-size: 1.8rem;
    font-weight: 700;
    margin-bottom: 16px;
    border-bottom: 2px solid var(--primary-color);
    padding-bottom: 8px;
    text-transform: uppercase;
}

body.dark-mode .section h2 {
    color: #fff;
}

body.light-mode .section h2 {
    color: #333;
}

/* Martyr Grid */
.martyr-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
    gap: 24px;
    padding: 16px 0;
}

.martyr-card {
    text-align: center;
    text-decoration: none;
    border-radius: 12px;
    overflow: hidden;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

body.dark-mode .martyr-card {
    background: var(--dark-container-bg);
    box-shadow: var(--dark-shadow);
}

body.light-mode .martyr-card {
    background: var(--light-container-bg);
    box-shadow: var(--light-shadow);
}

.martyr-card:hover {
    transform: translateY(-8px);
    box-shadow: 0 8px 16px rgba(0, 0, 0, 0.5);
}

.martyr-card img {
    width: 100%;
    height: 160px;
    object-fit: cover;
    border-bottom: 2px solid var(--primary-color);
}

.martyr-card h3 {
    font-size: 1rem;
    font-weight: 600;
    padding: 12px;
}

/* Biography Section */
.biography {
    text-align: center;
}

.bio-image {
    width: 100%;
    max-width: 300px;
    height: auto;
    object-fit: cover;
    border-radius: 12px;
    margin: 1rem auto;
    border: 2px solid var(--primary-color);
}

/* Text Controls */
.text-controls {
    display: flex;
    gap: 12px;
    justify-content: center;
    margin-top: 12px;
}

/* Text-to-Speech Highlight */
.highlight {
    background: var(--primary-color);
    color: #fff;
    padding: 2px 4px;
    border-radius: 4px;
    transition: background 0.3s ease;
}

/* Footer */
footer {
    text-align: center;
    padding: 24px;
}

.author {
    font-size: 1rem;
    margin-bottom: 16px;
}

body.dark-mode .author {
    color: #aaa;
}

body.light-mode .author {
    color: #666;
}

.author span {
    font-weight: 700;
    color: var(--primary-color);
}

.music-control {
    margin-top: 16px;
}

/* Animations */
@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

@keyframes slideUp {
    from { transform: translateY(20px); opacity: 0; }
    to { transform: translateY(0); opacity: 1; }
}

/* Responsive Design */
@media (max-width: 768px) {
    .container {
        padding: 24px;
    }

    .header h1 {
        font-size: 2.2rem;
    }

    .header .slogan {
        font-size: 1.2rem;
    }

    .section h2 {
        font-size: 1.6rem;
    }

    .martyr-grid {
        grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
    }

    .martyr-card img {
        height: 140px;
    }

    .nav-menu {
        display: none;
        flex-direction: column;
        position: absolute;
        top: 60px;
        left: 0;
        width: 100%;
        background: var(--glass-bg);
        backdrop-filter: blur(12px);
        padding: 1rem;
        z-index: 1001;
    }

    .nav-menu.active {
        display: flex;
    }

    .hamburger {
        display: block;
    }

    .dropdown-menu {
        position: static;
        width: 100%;
        max-height: 200px;
    }
}

@media (max-width: 480px) {
    .container {
        padding: 16px;
    }

    .header h1 {
        font-size: 1.8rem;
    }

    .header .slogan {
        font-size: 1rem;
    }

    .section h2 {
        font-size: 1.4rem;
    }

    .bio-image {
        max-width: 200px;
    }

    .slider img {
        max-height: 300px;
    }
}

/* Language-Specific Styles */
[lang="fa"] {
    direction: rtl;
    font-family: 'Vazirmatn', sans-serif;
}