:root {
    --primary-color: #5B4F96;
    --secondary-color: #7A6DB7;
    --accent-color: #FF9F43;
    --light-color: #f8f9fa;
    --dark-color: #333;
    --gray-color: #6c757d;
    --border-radius: 10px;
    --box-shadow: 0 5px 15px rgba(0, 0, 0, 0.1);
    --transition: all 0.3s ease;
    
    /* Light mode (default) */
    --bg-color: #ffffff;
    --text-color: #333333;
    --card-bg: #ffffff;
    --footer-bg: #3a3361;
    --hero-bg: linear-gradient(135deg, #f9f7ff 0%, #f0edff 100%);
    --light-purple-bg: #f9f7ff;
    --light-purple-border: #eae6ff;
    
    /* Single gradient for all specialty cards */
    --specialty-gradient: linear-gradient(135deg, var(--primary-color) 0%, var(--secondary-color) 100%);
}

/* Dark mode variables */
[data-theme="dark"] {
    --bg-color: #1a1a2e;
    --text-color: #e6e6e6;
    --card-bg: #16213e;
    --footer-bg: #0f1123;
    --hero-bg: linear-gradient(135deg, #2d2b42 0%, #252339 100%);
    --light-purple-bg: #252339;
    --light-purple-border: #3a3361;
    --light-color: #2d2b42;
    --dark-color: #e6e6e6;
    --gray-color: #b0b0b0;
    --box-shadow: 0 5px 15px rgba(0, 0, 0, 0.3);

    /* Lighter purple for text readability on dark backgrounds */
    --primary-color: #9B8FD6;
    --secondary-color: #B0A5E0;
    /* Keep gradient backgrounds dark enough for white text */
    --specialty-gradient: linear-gradient(135deg, #5B4F96 0%, #7A6DB7 100%);
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Cairo', sans-serif;
    background-color: var(--bg-color);
    color: var(--text-color);
    line-height: 1.6;
    direction: rtl;
    text-align: right;
    transition: background-color 0.3s ease, color 0.3s ease;
}

body.modal-open {
    overflow: hidden;
}

.container {
    width: 100%;
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
}

/* Theme Toggle */
.theme-toggle {
    background: none;
    border: none;
    color: var(--primary-color);
    font-size: 1.3rem;
    cursor: pointer;
    margin-left: 15px;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    transition: var(--transition);
}

.theme-toggle:hover {
    background-color: rgba(91, 79, 150, 0.1);
}

.theme-toggle .fa-sun {
    display: none;
}

[data-theme="dark"] .theme-toggle .fa-moon {
    display: none;
}

[data-theme="dark"] .theme-toggle .fa-sun {
    display: block;
}

/* Navbar Styles */
.navbar {
    background-color: var(--card-bg);
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
    position: fixed;
    top: 0;
    width: 100%;
    z-index: 1000;
    padding: 15px 0;
    transition: var(--transition);
}

.navbar-container {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.logo {
    display: flex;
    align-items: center;
    gap: 10px;
    text-decoration: none;
}

.logo-icon {
    display: flex;
    align-items: center;
    justify-content: center;
}

.logo-svg {
    width: 30px;
    height: 30px;
    transition: var(--transition);
    filter: brightness(1);
}

.logo-text {
    font-size: 1.8rem;
    font-weight: 800;
    color: var(--primary-color);
    transition: color 0.3s ease;
}

[data-theme="dark"] .logo-text {
    color: white; /* White for dark mode */
}

.logo-text span {
    color: var(--accent-color);
    transition: color 0.3s ease;
}

.nav-links {
    display: flex;
    list-style: none;
    gap: 25px;
    align-items: center;
}

.nav-links a {
    text-decoration: none;
    color: var(--text-color);
    font-weight: 600;
    transition: var(--transition);
    position: relative;
    font-size: 1.05rem;
}

.nav-links a:hover {
    color: var(--primary-color);
}

.nav-links a::after {
    content: '';
    position: absolute;
    bottom: -5px;
    right: 0;
    width: 0;
    height: 2px;
    background-color: var(--primary-color);
    transition: var(--transition);
}

.nav-links a:hover::after {
    width: 100%;
}

.nav-cta-button {
    background-color: var(--primary-color);
    color: white !important;
    padding: 10px 25px;
    border-radius: var(--border-radius);
    text-decoration: none;
    font-weight: 700;
    transition: var(--transition);
    border: none;
    cursor: pointer;
    font-family: 'Cairo', sans-serif;
    font-size: 1rem;
}

.nav-cta-button:hover {
    background-color: var(--secondary-color);
    transform: translateY(-3px);
    box-shadow: var(--box-shadow);
    color: white !important;
}

.nav-cta-button:hover::after {
    width: 0 !important;
}

.mobile-menu-btn {
    display: none;
    background: none;
    border: none;
    font-size: 1.5rem;
    color: var(--primary-color);
    cursor: pointer;
    font-family: 'Cairo', sans-serif;
}

/* Hero Section - UPDATED with phone image */
.hero {
    padding: 150px 0 100px;
    background: var(--hero-bg);
    overflow: hidden;
    transition: background 0.3s ease;
    position: relative;
}

.hero-container {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 40px;
    position: relative;
    z-index: 2;
}

.hero-content {
    flex: 1;
}

.hero-title {
    font-size: 3rem;
    color: var(--primary-color);
    margin-bottom: 20px;
    line-height: 1.2;
    font-weight: 800;
}

.hero-subtitle {
    font-size: 1.25rem;
    color: var(--gray-color);
    margin-bottom: 30px;
    max-width: 500px;
    font-weight: 400;
}

.hero-buttons {
    display: flex;
    gap: 15px;
    margin-top: 30px;
}

.cta-button {
    background-color: var(--primary-color);
    color: white;
    padding: 12px 25px;
    border-radius: var(--border-radius);
    text-decoration: none;
    font-weight: 700;
    transition: var(--transition);
    border: none;
    cursor: pointer;
    font-family: 'Cairo', sans-serif;
    font-size: 1rem;
}

.cta-button:hover {
    background-color: var(--secondary-color);
    transform: translateY(-3px);
    box-shadow: var(--box-shadow);
}

.secondary-button {
    background-color: var(--card-bg);
    color: var(--primary-color);
    padding: 12px 25px;
    border-radius: var(--border-radius);
    text-decoration: none;
    font-weight: 700;
    transition: var(--transition);
    border: 2px solid var(--primary-color);
    font-family: 'Cairo', sans-serif;
    font-size: 1rem;
}

.secondary-button:hover {
    background-color: var(--primary-color);
    color: white;
}

.hero-image {
    flex: 1;
    display: flex;
    justify-content: center;
    align-items: flex-end;
    position: relative;
}

.hero-image img {
    max-width: 100%;
    height: auto;
    display: block;
    position: relative;
}

/* Tablet Responsive */
@media (max-width: 992px) {
    .hero-container {
        flex-direction: column;
        gap: 30px;
    }
    
    .hero-title {
        font-size: 2.5rem;
    }
    
    /* Tablet-specific hero image cropping */
    .hero {
        padding: 150px 0 0;
    }
    
    .hero-image {
        width: 100%;
        height: auto;
        overflow: hidden;
        align-items: flex-start;
        margin-bottom: 0;
    }
    
    .hero-image img {
        width: 100%;
        height: auto;
        object-fit: cover;
        object-position: top;
        /* Show only top 2/3 of the image on tablets */
        max-height: 66vh;
        min-height: 400px;
    }
}

/* Mobile Responsive */
@media (max-width: 768px) {
    .hero {
        padding: 130px 0 0;
        overflow: hidden;
    }
    
    .hero-container {
        flex-direction: column;
        gap: 30px;
    }
    
    .hero-image {
        width: 100%;
        height: auto;
        overflow: hidden;
        margin-bottom: 0;
        align-items: flex-start;
    }
    
    .hero-image img {
        width: 100%;
        height: auto;
        object-fit: cover;
        object-position: top;
        /* Show only top 2/3 of the image on mobile */
        max-height: 60vh;
        min-height: 300px;
    }
    
    .hero-title {
        font-size: 2rem;
    }
    
    .hero-buttons {
        flex-direction: column;
        align-items: flex-start;
    }
}

/* Small Mobile */
@media (max-width: 576px) {
    .hero {
        padding: 120px 0 0;
    }
    
    .hero-image img {
        /* Adjust for smaller screens */
        max-height: 55vh;
        min-height: 250px;
    }
}

/* Very Small Mobile */
@media (max-width: 400px) {
    .hero-image img {
        max-height: 50vh;
        min-height: 220px;
    }
}

/* Sections Common Styles */
.section {
    padding: 80px 0;
}

.section-title {
    text-align: center;
    font-size: 2.5rem;
    color: var(--primary-color);
    margin-bottom: 50px;
    position: relative;
    font-weight: 800;
}

.section-title::after {
    content: '';
    position: absolute;
    bottom: -15px;
    right: 50%;
    transform: translateX(50%);
    width: 80px;
    height: 4px;
    background-color: var(--accent-color);
    border-radius: 2px;
}

/* Alternating section backgrounds */
.section-light {
    background-color: var(--bg-color);
}

.section-alt {
    background-color: var(--light-purple-bg);
}

/* Features Section */
.features-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 30px;
}

.feature-card {
    background-color: var(--card-bg);
    border-radius: var(--border-radius);
    padding: 30px;
    box-shadow: var(--box-shadow);
    transition: var(--transition);
    text-align: center;
}

.feature-card:hover {
    transform: translateY(-10px);
}

.feature-icon {
    font-size: 2.5rem;
    color: var(--primary-color);
    margin-bottom: 20px;
}

.feature-title {
    font-size: 1.5rem;
    margin-bottom: 15px;
    color: var(--text-color);
    font-weight: 700;
}

.feature-card p {
    font-weight: 400;
    color: var(--gray-color);
}

/* Specialties Section - UPDATED with images, gradient and buttons */
.specialties-container {
    padding: 40px;
    transition: background-color 0.3s ease, border-color 0.3s ease;
}

.specialties-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 30px;
}

.specialty-item {
    background-color: var(--card-bg);
    border-radius: var(--border-radius);
    box-shadow: 0 3px 10px rgba(0, 0, 0, 0.08);
    overflow: hidden;
    display: flex;
    flex-direction: column;
    transition: var(--transition);
    border: 1px solid var(--light-purple-border);
}

.specialty-item:hover {
    transform: translateY(-10px);
    box-shadow: 0 15px 30px rgba(0, 0, 0, 0.1);
}

.specialty-header {
    width: 100%;
    height: 180px;
    position: relative;
    overflow: hidden;
}

.specialty-header-image {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: var(--transition);
}

.specialty-item:hover .specialty-header-image {
    transform: scale(1.05);
}

.specialty-gradient-fallback {
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-weight: 700;
    font-size: 1.2rem;
    text-shadow: 1px 1px 3px rgba(0, 0, 0, 0.3);
    background: var(--specialty-gradient);
}

.specialty-content {
    padding: 25px;
    display: flex;
    flex-direction: column;
    flex-grow: 1;
}

.specialty-name {
    font-weight: 700;
    color: var(--primary-color);
    font-size: 1.5rem;
    margin-bottom: 20px;
    text-align: center;
}

.specialty-pricing {
    background: var(--light-purple-bg);
    border: 1px solid var(--light-purple-border);
    border-radius: 12px;
    padding: 14px;
    margin-bottom: 18px;
    text-align: center;
}

.discount-badge {
    display: inline-block;
    background: var(--accent-color);
    color: #4a2600;
    font-size: 0.9rem;
    font-weight: 700;
    border-radius: 999px;
    padding: 4px 12px;
    margin-bottom: 10px;
}

.price-row {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    flex-wrap: wrap;
}

.price-row.no-discount {
    justify-content: center;
}

.current-price {
    color: var(--primary-color);
    font-size: 1.4rem;
    font-weight: 800;
    line-height: 1;
}

.old-price {
    color: var(--gray-color);
    font-size: 1rem;
    text-decoration: line-through;
    font-weight: 600;
}

.specialty-stats {
    display: flex;
    flex-direction: column;
    gap: 12px;
    margin-bottom: 25px;
}

.stat-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 8px 0;
    border-bottom: 1px solid rgba(91, 79, 150, 0.1);
}

.stat-item:last-child {
    border-bottom: none;
}

.stat-label {
    display: flex;
    align-items: center;
    gap: 8px;
    color: var(--gray-color);
    font-weight: 500;
}

.stat-icon {
    color: var(--primary-color);
    font-size: 1rem;
}

.stat-value {
    font-weight: 700;
    color: var(--primary-color);
    font-size: 1.1rem;
}

.specialty-button {
    background-color: var(--primary-color);
    color: white;
    padding: 12px 20px;
    border-radius: var(--border-radius);
    text-decoration: none;
    font-weight: 700;
    transition: var(--transition);
    border: none;
    cursor: pointer;
    font-family: 'Cairo', sans-serif;
    font-size: 1rem;
    text-align: center;
    display: block;
    margin-top: auto;
}

.specialty-actions {
    display: flex;
    flex-direction: column;
    gap: 10px;
    margin-top: auto;
}

.specialty-books-button {
    background-color: transparent;
    color: var(--primary-color);
    padding: 12px 20px;
    border-radius: var(--border-radius);
    text-decoration: none;
    font-weight: 700;
    transition: var(--transition);
    border: 2px solid var(--primary-color);
    cursor: pointer;
    font-family: 'Cairo', sans-serif;
    font-size: 1rem;
    text-align: center;
}

.specialty-books-button:hover {
    background-color: var(--primary-color);
    color: white;
    transform: translateY(-3px);
}

/* Books modal */
.books-modal {
    position: fixed;
    inset: 0;
    z-index: 1100;
    display: none;
    align-items: center;
    justify-content: center;
    padding: 12px;
}

.books-modal.open {
    display: flex;
}

.books-modal-backdrop {
    position: fixed;
    inset: 0;
    background: rgba(8, 9, 23, 0.62);
    backdrop-filter: blur(3px);
}

.books-modal-dialog {
    position: relative;
    width: min(1080px, 100%);
    max-height: calc(100vh - 24px);
    background: var(--card-bg);
    border-radius: 18px;
    box-shadow: var(--box-shadow);
    padding: 22px;
    border: 1px solid var(--light-purple-border);
    display: flex;
    flex-direction: column;
    overflow: hidden;
    z-index: 1;
}

.books-modal-close {
    position: absolute;
    top: 15px;
    left: 15px;
    width: 38px;
    height: 38px;
    border: none;
    border-radius: 50%;
    background: var(--light-purple-bg);
    color: var(--primary-color);
    cursor: pointer;
    transition: var(--transition);
}

.books-modal-close:hover {
    background: var(--primary-color);
    color: white;
}

.books-modal-title {
    color: var(--primary-color);
    font-size: 1.9rem;
    font-weight: 800;
    margin-bottom: 16px;
    padding-left: 40px;
    flex-shrink: 0;
}

.books-modal-list {
    overflow-y: auto;
    overflow-x: hidden;
    overscroll-behavior: contain;
    -webkit-overflow-scrolling: touch;
    padding: 8px 2px 4px;
    min-height: min(400px, 60vh);
    direction: ltr;

    /* Webkit (Chrome, Safari, Edge) scrollbar */
    scrollbar-width: thin;
    scrollbar-color: var(--secondary-color) var(--light-purple-bg);
}

.books-modal-list::-webkit-scrollbar {
    width: 8px;
}

.books-modal-list::-webkit-scrollbar-track {
    background: var(--light-purple-bg);
    border-radius: 8px;
}

.books-modal-list::-webkit-scrollbar-thumb {
    background: var(--secondary-color);
    border-radius: 8px;
}

.books-modal-list::-webkit-scrollbar-thumb:hover {
    background: var(--primary-color);
}

.book-modal-card {
    direction: ltr;
    display: grid;
    grid-template-columns: clamp(84px, 16vw, 124px) minmax(0, 1fr);
    background: var(--light-purple-bg);
    border: 1px solid var(--light-purple-border);
    border-radius: 14px;
    overflow: hidden;
    min-height: 130px;
}

.book-modal-card + .book-modal-card {
    margin-top: 12px;
}

.book-modal-cover {
    width: 100%;
    aspect-ratio: 3 / 4;
    display: block;
    border-radius: 0;
    object-fit: cover;
    background: var(--card-bg);
}

.book-modal-details {
    direction: ltr;
    text-align: left;
    min-width: 0;
    padding: 12px 14px;
    display: flex;
    flex-direction: column;
    justify-content: center;
    gap: 7px;
}

.book-meta-line {
    color: var(--primary-color);
    font-size: 1.1rem;
    font-weight: 700;
    margin: 0;
    line-height: 1.4;
    overflow-wrap: anywhere;
}

.book-authors {
    color: var(--gray-color);
    font-size: 0.96rem;
    line-height: 1.4;
    margin: 0;
    overflow-wrap: anywhere;
}

.book-questions {
    margin: 0;
    color: var(--text-color);
    font-size: 0.95rem;
    font-weight: 600;
}

.book-questions strong {
    color: var(--primary-color);
    font-weight: 700;
}

.books-empty {
    grid-column: 1 / -1;
    text-align: center;
    background: var(--light-purple-bg);
    border: 1px solid var(--light-purple-border);
    border-radius: 12px;
    padding: 20px;
    color: var(--gray-color);
    font-weight: 600;
}

.specialty-button:hover {
    background-color: var(--secondary-color);
    transform: translateY(-3px);
    box-shadow: var(--box-shadow);
}

/* Stats Section */
.stats-section {
    padding: 80px 0;
    background-color: var(--bg-color);
}

.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 30px;
    text-align: center;
}

.stat-card {
    background-color: var(--card-bg);
    padding: 40px 20px;
    border-radius: var(--border-radius);
    box-shadow: var(--box-shadow);
    transition: var(--transition);
}

.stat-card:hover {
    transform: translateY(-10px);
}

.stat-icon-large {
    font-size: 2.5rem;
    color: var(--primary-color);
    margin-bottom: 20px;
}

.stat-number {
    font-size: 3rem;
    font-weight: 800;
    color: var(--primary-color);
    margin-bottom: 10px;
    display: block;
}

.stat-text {
    font-size: 1.2rem;
    color: var(--text-color);
    font-weight: 600;
}

/* Testimonials Section */
.testimonials-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 30px;
}

.testimonial-card {
    background-color: var(--card-bg);
    border-radius: var(--border-radius);
    padding: 30px;
    box-shadow: var(--box-shadow);
    position: relative;
    transition: var(--transition);
}

.testimonial-card:hover {
    transform: translateY(-5px);
}

.testimonial-card::before {
    content: "\f10d";
    font-family: "Font Awesome 6 Free";
    font-weight: 900;
    position: absolute;
    top: 20px;
    right: 20px;
    font-size: 5rem;
    color: var(--primary-color);
    opacity: 0.1;
}

.testimonial-content {
    font-style: italic;
    margin-bottom: 25px;
    line-height: 1.8;
    font-weight: 500;
    color: var(--text-color);
    font-size: 1.1rem;
}

.testimonial-author {
    display: flex;
    align-items: center;
    gap: 15px;
}

.author-avatar {
    width: 60px;
    height: 60px;
    border-radius: 50%;
    object-fit: cover;
    background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-weight: bold;
    font-size: 1.5rem;
}

.author-info h4 {
    color: var(--primary-color);
    margin-bottom: 5px;
    font-weight: 700;
}

.author-info p {
    color: var(--gray-color);
    font-size: 0.9rem;
    font-weight: 400;
}

/* New CTA Section before footer */
.cta-section {
    padding: 100px 0 0;
    position: relative;
    overflow: hidden;
}

.cta-container {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    padding-bottom: 0;
}

.cta-text {
    font-size: 3rem;
    color: var(--primary-color);
    margin-bottom: 40px;
    line-height: 1.3;
    font-weight: 800;
    max-width: 800px;
}

.cta-button-large {
    background-color: var(--primary-color);
    color: white;
    padding: 18px 40px;
    border-radius: var(--border-radius);
    text-decoration: none;
    font-weight: 800;
    transition: var(--transition);
    border: none;
    cursor: pointer;
    font-family: 'Cairo', sans-serif;
    font-size: 1.3rem;
    margin-bottom: 60px;
    box-shadow: var(--box-shadow);
    display: inline-flex;
    align-items: center;
    gap: 10px;
}

.cta-button-large:hover {
    background-color: var(--secondary-color);
    transform: translateY(-5px);
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.15);
}

.laptop-image-container {
    width: 100%;
    margin-bottom: 0;
    display: flex;
    justify-content: center;
    align-items: flex-end;
}

.laptop-image {
    max-width: 100%;
    height: auto;
    display: block;
    margin-bottom: 0;
}

/* Footer */
.footer {
    background-color: var(--footer-bg);
    color: white;
    padding: 70px 0 20px;
    transition: background-color 0.3s ease;
}

.footer-content {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 40px;
    margin-bottom: 40px;
}

.footer-column h3 {
    font-size: 1.5rem;
    margin-bottom: 25px;
    position: relative;
    color: white;
    font-weight: 700;
}

.footer-column h3::after {
    content: '';
    position: absolute;
    bottom: -10px;
    right: 0;
    width: 50px;
    height: 3px;
    background-color: var(--accent-color);
}

.footer-column p {
    font-weight: 400;
    color: rgba(255, 255, 255, 0.8);
}

.footer-links {
    list-style: none;
}

.footer-links li {
    margin-bottom: 12px;
}

.footer-links a {
    color: rgba(255, 255, 255, 0.7);
    text-decoration: none;
    transition: var(--transition);
    font-weight: 400;
}

.footer-links a:hover {
    color: white;
    padding-right: 10px;
}

.social-links {
    display: flex;
    gap: 15px;
    margin-top: 20px;
}

.social-links a {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    background-color: rgba(255, 255, 255, 0.1);
    border-radius: 50%;
    color: white;
    text-decoration: none;
    transition: var(--transition);
}

.social-links a:hover {
    background-color: var(--accent-color);
    transform: translateY(-5px);
}

.copyright {
    text-align: center;
    padding-top: 30px;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    color: rgba(255, 255, 255, 0.6);
    font-size: 0.9rem;
    font-weight: 400;
}

/* Download Buttons */
.download-buttons {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.download-button {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    padding: 12px 20px;
    background-color: rgba(255, 255, 255, 0.1);
    color: white;
    border-radius: var(--border-radius);
    text-decoration: none;
    font-weight: 700;
    transition: var(--transition);
    border: 2px solid rgba(255, 255, 255, 0.2);
}

.download-button:hover {
    background-color: var(--primary-color);
    color: white;
    transform: translateY(-3px);
}

/* Responsive Styles */
@media (max-width: 1200px) {
    .hero-image img {
        max-width: 100%;
        transform: translateY(0);
    }
}

@media (max-width: 992px) {
    .hero-container {
        flex-direction: column;
    }
    
    .hero-title {
        font-size: 2.5rem;
    }
    
    .testimonial-card {
        padding: 25px;
    }
    
    .stat-number {
        font-size: 2.5rem;
    }
    
    .cta-text {
        font-size: 2.5rem;
    }
}

@media (max-width: 768px) {
    .nav-links {
        position: fixed;
        top: 70px;
        right: -100%;
        flex-direction: column;
        background-color: var(--card-bg);
        width: 100%;
        text-align: center;
        padding: 20px 0;
        box-shadow: 0 10px 15px rgba(0, 0, 0, 0.1);
        transition: var(--transition);
        z-index: 999;
        gap: 0;
    }
    
    .nav-links.active {
        right: 0;
    }
    
    .nav-links li {
        margin: 15px 0;
        width: 100%;
    }
    
    .nav-links a {
        display: block;
        padding: 10px 0;
    }
    
    .mobile-menu-btn {
        display: block;
    }
    
    .hero {
        padding-bottom: 0;
        overflow: hidden;
    }
    
    .hero-container {
        flex-direction: column;
        gap: 30px;
    }
    
    .hero-image {
        width: 100%;
        margin-bottom: 0;
        align-items: flex-start;
        height: 300px;
        overflow: hidden;
    }
    
    .hero-image img {
        width: 100%;
        height: 200%;
        object-fit: cover;
        object-position: top;
        margin-bottom: 0;
    }
    
    .hero-title {
        font-size: 2rem;
    }
    
    .section-title {
        font-size: 2rem;
    }
    
    .hero-buttons {
        flex-direction: column;
        align-items: flex-start;
    }
    
    .specialties-container {
        padding: 30px 20px;
    }
    
    .specialties-grid {
        grid-template-columns: repeat(2, 1fr);
    }
    
    .download-buttons {
        flex-direction: column;
    }
    
    .testimonial-card {
        padding: 25px;
    }
    
    .stats-grid {
        grid-template-columns: repeat(2, 1fr);
    }
    
    .cta-text {
        font-size: 2rem;
        padding: 0 20px;
    }
    
    .cta-button-large {
        padding: 15px 30px;
        font-size: 1.2rem;
    }

    .books-modal-dialog {
        width: 100%;
        max-height: calc(100vh - 24px);
        padding: 18px;
    }

    .books-modal-title {
        font-size: 1.5rem;
        padding-left: 32px;
    }

    .books-modal-list .book-modal-card + .book-modal-card {
        margin-top: 10px;
    }
}

@media (max-width: 576px) {
    .hero {
        padding: 130px 0 0;
    }
    
    .hero-image {
        height: 250px;
    }
    
    .section {
        padding: 60px 0;
    }
    
    .feature-card, .testimonial-card {
        padding: 20px;
    }
    
    .footer-content {
        grid-template-columns: 1fr;
    }
    
    .testimonial-card {
        padding: 25px 20px;
    }
    
    .testimonial-content {
        font-size: 1rem;
    }
    
    .stats-grid {
        grid-template-columns: 1fr;
        gap: 20px;
    }
    
    .stat-number {
        font-size: 2.2rem;
    }
    
    .stat-card {
        padding: 30px 20px;
    }
    
    .specialties-grid {
        grid-template-columns: 1fr;
    }
    
    .specialty-content {
        padding: 20px;
    }
    
    .cta-section {
        padding: 80px 0 0;
    }
    
    .cta-text {
        font-size: 1.8rem;
        padding: 0 15px;
        margin-bottom: 30px;
    }
    
    .cta-button-large {
        padding: 14px 28px;
        font-size: 1.1rem;
        margin-bottom: 40px;
    }

    .books-modal {
        padding: 12px;
    }

    .book-modal-card {
        grid-template-columns: 92px minmax(0, 1fr);
    }
}

@media (max-width: 400px) {
    .testimonial-card {
        padding: 20px 15px;
    }
    
    .author-avatar {
        width: 50px;
        height: 50px;
        font-size: 1.3rem;
    }
    
    .cta-text {
        font-size: 1.6rem;
    }
    
    .hero-image {
        height: 220px;
    }
}

/* =============================================
   Dark mode: keep button/avatar backgrounds
   dark enough for white text contrast
   ============================================= */
[data-theme="dark"] .cta-button,
[data-theme="dark"] .nav-cta-button,
[data-theme="dark"] .specialty-button,
[data-theme="dark"] .cta-button-large {
    background-color: #5B4F96;
}

[data-theme="dark"] .cta-button:hover,
[data-theme="dark"] .nav-cta-button:hover,
[data-theme="dark"] .specialty-button:hover,
[data-theme="dark"] .cta-button-large:hover {
    background-color: #7A6DB7;
}

[data-theme="dark"] .secondary-button:hover,
[data-theme="dark"] .specialty-books-button:hover,
[data-theme="dark"] .books-modal-close:hover {
    background-color: #5B4F96;
}

[data-theme="dark"] .author-avatar {
    background: linear-gradient(135deg, #5B4F96, #7A6DB7);
}