/* British Academy - Mobile‑First RTL CSS */
:root {
    --primary: #0a1432;
    --secondary: #c8a951;
    --accent: #b91c1c;
    --dark: #0f172a;
    --light: #f8fafc;
    --text: #1e293b;
    --border: #e2e8f0;
    --success: #059669;
    --warning: #d97706;
    --info: #2563eb;
    --shadow: 0 20px 60px rgba(26,39,68,0.15);
    --shadow-sm: 0 5px 15px rgba(0,0,0,0.05);
    --gradient: linear-gradient(135deg, #1a2744 0%, #2d4a8a 50%, #1a2744 100%);
    --gold-gradient: linear-gradient(135deg, #c8a951, #f0d080, #c8a951);
    --overlay: linear-gradient(rgba(10,20,50,0.8), rgba(10,20,50,0.8));
    --gold: #c9a84c;
    --radius: 15px;
    --radius-lg: 25px;
    --font-cairo: 'Cairo', sans-serif;
    --font-playfair: 'Playfair Display', serif;
}

/* ===== BASE & RESET ===== */
*,
*::before,
*::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

html {
    font-size: 16px;
    scroll-behavior: smooth;
}

body {
    font-family: var(--font-cairo);
    color: var(--text);
    background-color: var(--light);
    overflow-x: hidden;
    line-height: 1.6;
    padding-top: 80px; /* space for fixed navbar */
}

[dir="rtl"] {
    text-align: right;
    direction: rtl;
}
[dir="ltr"] {
    text-align: left;
    direction: ltr;
}

/* Typography */
h1, h2, h3, h4, h5, h6,
.display-font {
    font-family: var(--font-playfair);
    font-weight: 700;
    line-height: 1.3;
    margin-bottom: 1rem;
}

h1 { font-size: 2.5rem; }
h2 { font-size: 2rem; }
h3 { font-size: 1.75rem; }
h4 { font-size: 1.5rem; }
h5 { font-size: 1.25rem; }

p {
    margin-bottom: 1rem;
}

a {
    color: var(--primary);
    text-decoration: none;
    transition: color 0.3s;
}
a:hover {
    color: var(--secondary);
}

/* ===== UTILITIES ===== */
.container {
    width: 100%;
    max-width: 1200px;
    margin: 0 auto;
    padding-left: 1rem;
    padding-right: 1rem;
}

.text-center { text-align: center; }
.text-right { text-align: right; }
.text-left { text-align: left; }
.bg-primary { background-color: var(--primary); }
.bg-light { background-color: var(--light); }
.text-white { color: #fff; }
.text-gold {
    background: var(--gold-gradient);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}
.rounded { border-radius: var(--radius); }
.rounded-lg { border-radius: var(--radius-lg); }
.shadow { box-shadow: var(--shadow); }
.shadow-sm { box-shadow: var(--shadow-sm); }
.mt-0 { margin-top: 0; }
.mb-0 { margin-bottom: 0; }
.py-5 { padding-top: 3rem; padding-bottom: 3rem; }
.px-3 { padding-left: 1rem; padding-right: 1rem; }
.d-block { display: block; }
.d-flex { display: flex; }
.flex-wrap { flex-wrap: wrap; }
.justify-content-center { justify-content: center; }
.align-items-center { align-items: center; }
.flex-column { flex-direction: column; }
.gap-3 { gap: 1rem; }

/* ===== NAVBAR ===== */
.navbar {
    position: fixed;
    top: 0;
    width: 100%;
    background-color: rgba(26, 39, 68, 0.98);
    backdrop-filter: blur(10px);
    z-index: 1000;
    padding: 0.75rem 1rem;
    transition: all 0.3s ease;
    border-bottom: 2px solid var(--secondary);
}
.navbar.scrolled {
    background: rgba(26, 39, 68, 0.95);
}
.navbar-brand {
    font-size: 1.8rem;
    font-weight: 700;
    color: #fff !important;
    display: flex;
    align-items: center;
}
.navbar-brand img {
    height: 40px;
    margin-inline-end: 0.75rem;
}
.navbar-toggler {
    border: 1px solid var(--secondary);
    background: transparent;
    color: #fff;
    width: 44px;
    height: 44px;
    border-radius: 8px;
    font-size: 1.5rem;
    padding: 0;
    display: flex;
    align-items: center;
    justify-content: center;
}
.navbar-collapse {
    flex-grow: 0;
}
.navbar-nav {
    list-style: none;
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    padding: 1rem 0;
}
.nav-item {
    display: block;
}
.nav-link {
    color: #fff;
    font-weight: 600;
    padding: 0.5rem 1rem;
    border-radius: 8px;
    transition: all 0.3s;
    min-height: 44px;
    display: flex;
    align-items: center;
}
.nav-link:hover,
.nav-link.active {
    background-color: var(--secondary);
    color: var(--dark);
}
.navbar .btn-gold {
    margin-top: 1rem;
    min-height: 44px;
    font-size: 1rem;
}

/* Mobile menu */
@media (max-width: 991.98px) {
    .navbar-collapse {
        background-color: var(--primary);
        border-radius: var(--radius);
        padding: 1rem;
        margin-top: 1rem;
        box-shadow: var(--shadow);
    }
    .navbar-toggler {
        display: flex;
    }
}
@media (min-width: 992px) {
    .navbar-nav {
        flex-direction: row;
        align-items: center;
        gap: 0.75rem;
    }
    .navbar-toggler {
        display: none;
    }
}

/* ===== HERO SECTION ===== */
.hero-section {
    min-height: 100vh;
    height: 100vh;
    width: 100%;
    background: var(--overlay), url('https://images.unsplash.com/photo-1513635269975-59663e0ac1ad?w=1920&q=80') no-repeat center center;
    background-size: cover;
    background-position: center;
    display: flex;
    align-items: center;
    justify-content: center;
    text-align: center;
    color: #fff;
    padding: 2rem 1rem;
    position: relative;
}
.hero-content {
    max-width: 900px;
    margin: 0 auto;
    position: relative;
    z-index: 2;
}
.hero-title {
    font-size: 3rem;
    background: var(--gold-gradient);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    margin-bottom: 1.5rem;
}
.hero-subtitle {
    font-size: 1.25rem;
    margin-bottom: 2rem;
    opacity: 0.9;
}
.hero-buttons {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 1rem;
    margin-top: 2rem;
}
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 44px;
    padding: 0.75rem 2rem;
    border-radius: 50px;
    font-weight: 600;
    font-size: 1rem;
    border: none;
    cursor: pointer;
    transition: all 0.3s;
    text-decoration: none;
}
.btn-primary {
    background: var(--gradient);
    color: #fff;
}
.btn-primary:hover {
    transform: translateY(-3px);
    box-shadow: var(--shadow);
}
.btn-gold {
    background: var(--gold-gradient);
    color: var(--dark);
    font-weight: bold;
}
.btn-gold:hover {
    transform: translateY(-3px);
    box-shadow: var(--shadow);
}
.btn-outline-light {
    background: transparent;
    color: #fff;
    border: 2px solid #fff;
}
.btn-outline-light:hover {
    background: #fff;
    color: var(--dark);
}

/* ===== STATS BAR ===== */
.stats-bar {
    background-color: var(--primary);
    color: #fff;
    padding: 2.5rem 1rem;
}
.stat-item {
    text-align: center;
    padding: 1rem;
}
.stat-number {
    font-size: 2.5rem;
    font-weight: 700;
    margin-bottom: 0.5rem;
    background: var(--gold-gradient);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}
.stat-label {
    font-size: 1rem;
    opacity: 0.9;
}

/* ===== COURSE CARDS ===== */
.section-title {
    text-align: center;
    margin-bottom: 3rem;
}
.course-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 2rem;
}
.course-card {
    background: #fff;
    border-radius: var(--radius-lg);
    overflow: hidden;
    box-shadow: var(--shadow-sm);
    transition: transform 0.3s, box-shadow 0.3s;
    height: 100%;
}
.course-card:hover {
    transform: translateY(-10px);
    box-shadow: var(--shadow);
}
.course-img {
    width: 100%;
    height: 200px;
    object-fit: cover;
}
.course-body {
    padding: 1.5rem;
}
.course-title {
    font-size: 1.5rem;
    margin-bottom: 0.75rem;
}
.course-description {
    color: #666;
    margin-bottom: 1rem;
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
}
.course-meta {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: 1rem;
}
.price {
    font-weight: 700;
    color: var(--secondary);
    font-size: 1.5rem;
}
.badge {
    display: inline-block;
    padding: 0.35rem 1rem;
    border-radius: 50px;
    font-size: 0.85rem;
    font-weight: 600;
}
.badge-primary {
    background-color: var(--primary);
    color: #fff;
}
.badge-success {
    background-color: var(--success);
    color: #fff;
}

/* ===== HOW IT WORKS ===== */
.steps-container {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 2rem;
    counter-reset: step-counter;
}
.step {
    flex: 1 1 250px;
    text-align: center;
    position: relative;
    padding-top: 3rem;
}
.step::before {
    counter-increment: step-counter;
    content: counter(step-counter);
    position: absolute;
    top: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 60px;
    height: 60px;
    background: var(--gold-gradient);
    color: var(--primary);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.75rem;
    font-weight: bold;
    z-index: 2;
}
.step-icon {
    font-size: 3rem;
    margin-bottom: 1rem;
    color: var(--secondary);
}
.step-title {
    font-size: 1.5rem;
    margin-bottom: 0.75rem;
}

/* ===== TESTIMONIALS ===== */
.testimonial-slider {
    overflow: hidden;
    padding: 2rem 0;
}
.testimonial-card {
    background: #fff;
    border-radius: var(--radius);
    padding: 2rem;
    margin: 1rem;
    box-shadow: var(--shadow-sm);
    border-right: 5px solid var(--secondary);
}
.testimonial-text {
    font-style: italic;
    margin-bottom: 1rem;
}
.testimonial-author {
    display: flex;
    align-items: center;
    gap: 1rem;
}
.author-avatar {
    width: 50px;
    height: 50px;
    border-radius: 50%;
    object-fit: cover;
}
.author-info h5 {
    margin-bottom: 0.25rem;
}
.stars {
    color: #ffc107;
    font-size: 1.25rem;
}

/* ===== FOOTER ===== */
.footer {
    background-color: var(--dark);
    color: #fff;
    padding: 3rem 1rem;
    margin-top: 4rem;
}
.footer-links {
    list-style: none;
    padding: 0;
}
.footer-links li {
    margin-bottom: 0.75rem;
}
.footer-links a {
    color: #ccc;
}
.footer-links a:hover {
    color: var(--secondary);
    padding-right: 0.5rem;
}
.social-icons {
    display: flex;
    gap: 1rem;
    margin-top: 1.5rem;
}
.social-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 44px;
    height: 44px;
    border-radius: 50%;
    background-color: rgba(255,255,255,0.1);
    color: #fff;
    font-size: 1.25rem;
    transition: all 0.3s;
}
.social-icon:hover {
    background-color: var(--secondary);
    color: var(--dark);
    transform: translateY(-3px);
}
.copyright {
    text-align: center;
    margin-top: 3rem;
    padding-top: 1.5rem;
    border-top: 1px solid rgba(255,255,255,0.1);
    color: #aaa;
    font-size: 0.9rem;
}

/* ===== WHATSAPP BUTTON (MOBILE) ===== */
.whatsapp-float {
    position: fixed;
    bottom: 2rem;
    left: 1rem;
    width: 60px;
    height: 60px;
    background-color: #25D366;
    color: #fff;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 2rem;
    box-shadow: 0 4px 20px rgba(37, 211, 102, 0.5);
    z-index: 999;
    transition: all 0.3s;
}
.whatsapp-float:hover {
    transform: scale(1.1);
    color: #fff;
}
[dir="rtl"] .whatsapp-float {
    left: auto;
    right: 1rem;
}

/* ===== FORMS ===== */
.form-control {
    width: 100%;
    min-height: 44px;
    padding: 0.75rem 1rem;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    font-family: var(--font-cairo);
    font-size: 1rem;
    transition: border 0.3s;
    background-color: #fff;
}
.form-control:focus {
    border-color: var(--secondary);
    outline: none;
    box-shadow: 0 0 0 3px rgba(200, 169, 81, 0.2);
}
.form-label {
    display: block;
    margin-bottom: 0.5rem;
    font-weight: 600;
}
.form-group {
    margin-bottom: 1.5rem;
}
.form-check {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin-bottom: 1rem;
}
.form-check-input {
    width: 20px;
    height: 20px;
}
.form-check-label {
    font-size: 0.95rem;
}
.btn-submit {
    width: 100%;
    background: var(--gradient);
    color: #fff;
    font-size: 1.1rem;
    font-weight: bold;
    min-height: 50px;
    margin-top: 1rem;
}
.btn-submit:hover {
    background: var(--primary);
}

/* ===== EXAM INTERFACE ===== */
.exam-timer {
    position: sticky;
    top: 80px;
    background-color: var(--warning);
    color: #fff;
    padding: 0.75rem;
    text-align: center;
    font-weight: bold;
    font-size: 1.25rem;
    border-radius: var(--radius);
    margin-bottom: 2rem;
    z-index: 100;
}
.question-card {
    background: #fff;
    border-radius: var(--radius);
    padding: 1.5rem;
    margin-bottom: 1.5rem;
    box-shadow: var(--shadow-sm);
    border-right: 4px solid var(--info);
}
.option-label {
    display: block;
    padding: 1rem;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    margin-bottom: 0.75rem;
    cursor: pointer;
    transition: all 0.3s;
}
.option-label:hover {
    border-color: var(--info);
    background-color: rgba(37, 99, 235, 0.05);
}
.option-input:checked + .option-label {
    border-color: var(--info);
    background-color: rgba(37, 99, 235, 0.1);
    font-weight: bold;
}
.nav-buttons {
    display: flex;
    justify-content: space-between;
    margin-top: 3rem;
}
.nav-btn {
    min-width: 140px;
    min-height: 44px;
}

/* ===== DASHBOARD ===== */
.dashboard-card {
    background: #fff;
    border-radius: var(--radius);
    padding: 1.5rem;
    box-shadow: var(--shadow-sm);
    margin-bottom: 1.5rem;
    height: 100%;
}
.dashboard-card h3 {
    color: var(--primary);
    margin-bottom: 1rem;
    padding-bottom: 0.75rem;
    border-bottom: 2px solid var(--secondary);
}
.list-group {
    list-style: none;
    padding: 0;
}
.list-group-item {
    padding: 0.75rem 1rem;
    border-bottom: 1px solid var(--border);
}
.list-group-item:last-child {
    border-bottom: none;
}
.progress {
    height: 10px;
    background-color: #e2e8f0;
    border-radius: 5px;
    overflow: hidden;
    margin: 1rem 0;
}
.progress-bar {
    height: 100%;
    background: var(--gold-gradient);
    border-radius: 5px;
}

/* ===== RESPONSIVE ADJUSTMENTS ===== */
@media (max-width: 767.98px) {
    html { font-size: 14px; }
    body { padding-top: 70px; }
    .hero-title { font-size: 2.2rem; }
    .hero-subtitle { font-size: 1.1rem; }
    .stats-bar .row { gap: 1.5rem; }
    .stat-number { font-size: 2rem; }
    .course-grid {
        grid-template-columns: 1fr;
        gap: 1.5rem;
    }
    .steps-container { flex-direction: column; }
    .step::before {
        position: static;
        transform: none;
        margin: 0 auto 1rem;
    }
    .navbar-nav {
        padding: 0;
    }
    .nav-link {
        justify-content: flex-start;
    }
    .btn {
        width: 100%;
        justify-content: center;
    }
    .hero-buttons {
        flex-direction: column;
        align-items: stretch;
        max-width: 300px;
        margin-left: auto;
        margin-right: auto;
    }
    .whatsapp-float {
        width: 50px;
        height: 50px;
        font-size: 1.5rem;
        bottom: 1rem;
        left: 1rem;
    }
}
@media (min-width: 768px) and (max-width: 1199.98px) {
    .hero-title { font-size: 2.8rem; }
    .course-grid {
        grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    }
}

/* ===== CRITICAL FIXES ===== */

/* Hero Full Width */
.hero-section {
    width: 100vw !important;
    max-width: 100vw !important;
    min-height: 100vh !important;
    height: 100vh !important;
    margin: 0 !important;
    position: relative !important;
    left: 50% !important;
    right: 50% !important;
    margin-left: -50vw !important;
    margin-right: -50vw !important;
}

/* Social Icons Fix */
.social-links, .social-icons, footer .d-flex {
    display: flex !important;
    flex-wrap: wrap !important;
    gap: 10px !important;
    align-items: center !important;
}

footer a.social-link,
footer .btn-social,
footer a[href*="facebook"],
footer a[href*="twitter"],
footer a[href*="instagram"],
footer a[href*="youtube"],
footer a[href*="whatsapp"] {
    display: inline-flex !important;
    width: 38px !important;
    height: 38px !important;
    min-width: 38px !important;
    align-items: center !important;
    justify-content: center !important;
    border-radius: 50% !important;
    border: 1px solid rgba(255,255,255,0.3) !important;
    font-size: 14px !important;
    flex-shrink: 0 !important;
}

/* Mobile Fixes */
@media (max-width: 768px) {
    .hero-section {
        height: 100svh !important;
        min-height: 100svh !important;
    }
    
    .navbar-brand { font-size: 14px !important; }
    
    footer .row > div { margin-bottom: 20px !important; }
    
    .hero-section h1 { font-size: 1.6rem !important; }
    .hero-section p { font-size: 1rem !important; }
    
    footer { text-align: center !important; }
    footer .text-md-start, footer .text-md-end { text-align: center !important; }
}

/* Font Fix */
body { font-family: 'Cairo', 'Tajawal', sans-serif !important; }
