:root {
    /* --- Batman Gotham Theme Colors --- */
    --bat-black: #090D16;
    --bat-dark: #0F172A;
    --bat-slate: #1E293B;
    --bat-slate-light: #334155;
    --bat-border: #475569;
    
    --bat-yellow: #FFE600;
    --bat-yellow-glow: #FACC15;
    --bat-gold: #F59E0B;
    --bat-amber: #D97706;
    
    --bat-cyan: #38BDF8;
    --bat-blue: #2563EB;
    --bat-blue-dark: #1E3A8A;
    
    --card-bg: var(--bat-slate);
    --text-main: #F8FAFC;
    --text-muted: #CBD5E1;
    --text-dim: #94A3B8;
    
    --border-radius: 20px;
    --radius-xl: 28px;
    --radius-lg: 18px;
}

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
    -webkit-tap-highlight-color: transparent;
}

body {
    font-family: 'Tajawal', 'Changa', 'Marhey', sans-serif;
    background-color: var(--bat-black);
    background-image: 
        radial-gradient(circle at 15% 15%, rgba(255, 230, 0, 0.09), transparent 35%),
        radial-gradient(circle at 85% 25%, rgba(56, 189, 248, 0.08), transparent 35%),
        radial-gradient(circle at 50% 80%, rgba(245, 158, 11, 0.06), transparent 45%),
        linear-gradient(180deg, #090D16 0%, #0F172A 50%, #06090F 100%);
    background-attachment: fixed;
    color: var(--text-main);
    line-height: 1.6;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    overflow-x: hidden;
    direction: rtl;
    position: relative;
}

body.locked {
    overflow: hidden;
    height: 100vh;
}

/* Floating subtle forest background elements (Bat Theme) */
.floating-forest-bg {
    position: fixed;
    top: 0; left: 0; right: 0; bottom: 0;
    pointer-events: none;
    z-index: 0;
    overflow: hidden;
}

.forest-leaf {
    position: absolute;
    font-size: 2.2rem;
    opacity: 0.22;
    filter: drop-shadow(0 0 12px rgba(255, 230, 0, 0.3));
    animation: gentleFloat 12s infinite ease-in-out;
}

.leaf-1 { top: 12%; left: 6%; animation-delay: 0s; }
.leaf-2 { top: 35%; right: 4%; animation-delay: 2s; }
.leaf-3 { top: 65%; left: 8%; animation-delay: 4s; }
.leaf-4 { top: 82%; right: 7%; animation-delay: 1s; }
.leaf-5 { top: 48%; left: 50%; animation-delay: 3s; }

@keyframes gentleFloat {
    0%, 100% { transform: translateY(0) rotate(0deg) scale(1); }
    50% { transform: translateY(-20px) rotate(10deg) scale(1.1); }
}

/* --- Premium Header --- */
.bat-premium-header {
    background: rgba(15, 23, 42, 0.92);
    backdrop-filter: blur(12px);
    border-bottom: 2px solid var(--bat-yellow);
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.6);
    position: relative;
    overflow: hidden;
    margin-bottom: 2.5rem;
}

.bat-premium-header.simple-profile-header {
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 1.6rem 2rem;
}

.profile-header-content {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 1.2rem;
    position: relative;
    z-index: 2;
}

.header-avatar-wrap {
    width: 68px;
    height: 68px;
    border-radius: 50%;
    background: var(--bat-black);
    border: 3.5px solid var(--bat-yellow);
    box-shadow: 0 0 16px rgba(255, 230, 0, 0.5);
    flex-shrink: 0;
    overflow: hidden;
}

.header-avatar-img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.header-student-name {
    font-size: 2.3rem;
    font-weight: 800;
    color: #FFFFFF;
    font-family: 'Marhey', 'Changa', sans-serif;
    letter-spacing: 0.5px;
    text-shadow: 0 2px 0 var(--bat-gold), 0 0 20px rgba(255, 230, 0, 0.4);
    margin: 0;
    line-height: 1;
}

.bat-premium-header::before {
    content: '';
    position: absolute;
    top: 0; left: 0; right: 0; bottom: 0;
    background-image: radial-gradient(rgba(255, 230, 0, 0.05) 1px, transparent 1px);
    background-size: 20px 20px;
    pointer-events: none;
}

/* --- Portal Main Wrapper --- */
.portal-main-wrap {
    max-width: 1200px;
    margin: 0 auto;
    width: 100%;
    padding: 0 1.5rem 3rem;
    position: relative;
    z-index: 1;
}

.section-head-bat {
    text-align: center;
    margin-bottom: 2.2rem;
    background: rgba(30, 41, 59, 0.85);
    backdrop-filter: blur(12px);
    padding: 1.3rem 2rem;
    border-radius: 25px;
    border: 2px solid #334155;
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.4);
    max-width: 700px;
    margin-left: auto;
    margin-right: auto;
}

.section-head-bat h2 {
    font-family: 'Marhey', 'Changa', sans-serif;
    font-size: 2rem;
    color: var(--bat-yellow);
    margin-bottom: 6px;
    text-shadow: 0 0 15px rgba(255, 230, 0, 0.3);
}

.section-head-bat p {
    color: var(--text-muted);
    font-size: 1.05rem;
    font-weight: 600;
}

/* --- Batman Platform Cards --- */
.bat-cards-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 2rem;
}

.bat-platform-card {
    background: linear-gradient(135deg, #1E293B 0%, #0F172A 100%);
    border-radius: var(--border-radius);
    padding: 2rem 1.6rem 1.6rem;
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    position: relative;
    text-decoration: none;
    color: var(--text-main);
    box-shadow: 0 8px 22px rgba(0, 0, 0, 0.4);
    border: 2px solid #334155;
    transition: all 0.35s cubic-bezier(0.34, 1.56, 0.64, 1);
    overflow: hidden;
}

.bat-platform-card:hover {
    transform: translateY(-8px) scale(1.02);
    box-shadow: 0 16px 32px rgba(255, 230, 0, 0.15), 0 0 20px rgba(255, 230, 0, 0.1);
}

/* Specific Card Top Borders & Stages */
.card-reading-theme {
    border-top: 6px solid var(--bat-cyan);
}
.card-reading-theme:hover {
    border-color: #7DD3FC;
}
.card-reading-theme .card-stage-bubble {
    background: linear-gradient(135deg, rgba(56, 189, 248, 0.15), rgba(2, 132, 199, 0.2));
    border-color: var(--bat-cyan);
    color: var(--bat-cyan);
}
.card-reading-theme .card-bat-btn {
    background: linear-gradient(135deg, var(--bat-cyan), #0284C7);
    color: #090D16;
    box-shadow: 0 4px 14px rgba(56, 189, 248, 0.3);
}
.card-reading-theme .lesson-status-pill {
    background: rgba(56, 189, 248, 0.15);
    color: #E0F2FE;
    border-color: rgba(56, 189, 248, 0.3);
}

.card-science-theme {
    border-top: 6px solid #10B981;
}
.card-science-theme:hover {
    border-color: #34D399;
}
.card-science-theme .card-stage-bubble {
    background: linear-gradient(135deg, rgba(16, 185, 129, 0.15), rgba(4, 120, 87, 0.2));
    border-color: #10B981;
    color: #10B981;
}
.card-science-theme .card-bat-btn {
    background: linear-gradient(135deg, #10B981, #047857);
    color: #090D16;
    box-shadow: 0 4px 14px rgba(16, 185, 129, 0.3);
}
.card-science-theme .lesson-status-pill {
    background: rgba(16, 185, 129, 0.15);
    color: #D1FAE5;
    border-color: rgba(16, 185, 129, 0.3);
}

.card-math-theme {
    border-top: 6px solid var(--bat-yellow);
}
.card-math-theme:hover {
    border-color: var(--bat-yellow-glow);
}
.card-math-theme .card-stage-bubble {
    background: linear-gradient(135deg, rgba(255, 230, 0, 0.15), rgba(245, 158, 11, 0.2));
    border-color: var(--bat-yellow);
    color: var(--bat-yellow);
}
.card-math-theme .card-bat-btn {
    background: linear-gradient(135deg, var(--bat-yellow), var(--bat-gold));
    color: #090D16;
    box-shadow: 0 4px 14px rgba(255, 230, 0, 0.3);
}
.card-math-theme .lesson-status-pill {
    background: rgba(255, 230, 0, 0.15);
    color: #FEF08A;
    border-color: rgba(255, 230, 0, 0.3);
}

/* Card Badge Pill */
.card-header-pill {
    display: flex;
    justify-content: center;
    align-items: center;
    width: 100%;
    margin-bottom: 0.8rem;
}

.lesson-status-pill {
    font-size: 0.82rem;
    font-weight: 800;
    padding: 4px 14px;
    border-radius: 20px;
    font-family: 'Changa', sans-serif;
    border: 1px solid transparent;
}

/* Center Stage Bubble */
.card-stage-bubble {
    width: 90px;
    height: 90px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0.4rem 0 1rem 0;
    position: relative;
    border-width: 3px;
    border-style: solid;
    box-shadow: 0 6px 16px rgba(0, 0, 0, 0.3);
    transition: all 0.35s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.card-stage-bubble i {
    width: 44px;
    height: 44px;
    stroke-width: 2.2;
}

.bat-platform-card:hover .card-stage-bubble {
    transform: translateY(-5px) scale(1.1);
    box-shadow: 0 10px 22px rgba(0, 0, 0, 0.4);
}

.card-title {
    font-size: 1.45rem;
    font-weight: 800;
    color: #F8FAFC;
    margin-bottom: 0.4rem;
    font-family: 'Marhey', 'Changa', sans-serif;
    line-height: 1.3;
}

.card-desc {
    color: var(--text-muted);
    font-size: 0.98rem;
    line-height: 1.5;
    margin-bottom: 1.5rem;
    min-height: 46px;
    font-family: 'Tajawal', sans-serif;
}

/* Action Button Inside Card */
.card-bat-btn {
    width: 100%;
    padding: 0.75rem 1.2rem;
    border-radius: 50px;
    font-weight: 900;
    font-family: 'Changa', 'Tajawal', sans-serif;
    font-size: 1.15rem;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    transition: all 0.25s ease;
    border: 2px solid rgba(255, 255, 255, 0.8);
    margin-top: auto;
}

.card-bat-btn i {
    width: 20px;
    height: 20px;
    transition: transform 0.25s ease;
}

.bat-platform-card:hover .card-bat-btn {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.4);
    border-color: #FFFFFF;
}

.bat-platform-card:hover .card-bat-btn i {
    transform: translateX(-5px);
}

/* --- Login Overlay (Batman Theme) --- */
.login-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background: rgba(9, 13, 22, 0.9);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    z-index: 99999;
    display: flex;
    justify-content: center;
    align-items: center;
    transition: opacity 0.4s ease, visibility 0.4s;
    padding: 20px;
}

.login-overlay.hide {
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
}

.login-bat-card {
    background: linear-gradient(135deg, #1E293B 0%, #0F172A 100%);
    border-radius: 30px;
    border: 4px solid var(--bat-yellow);
    max-width: 470px;
    width: 100%;
    box-shadow: 
        0 25px 50px rgba(0, 0, 0, 0.7),
        0 0 30px rgba(255, 230, 0, 0.2);
    animation: batPop 0.45s cubic-bezier(0.34, 1.56, 0.64, 1);
    overflow: hidden;
    position: relative;
    text-align: center;
}

@keyframes batPop {
    from { opacity: 0; transform: scale(0.88) translateY(20px); }
    to { opacity: 1; transform: scale(1) translateY(0); }
}

.login-bat-header {
    background: rgba(15, 23, 42, 0.95);
    padding: 25px 20px 20px;
    position: relative;
    border-bottom: 4px solid var(--bat-yellow);
}

.login-bat-header::before {
    content: '';
    position: absolute;
    top: 0; left: 0; right: 0; bottom: 0;
    background-image: radial-gradient(rgba(255, 230, 0, 0.1) 1px, transparent 1px);
    background-size: 18px 18px;
    pointer-events: none;
}

.login-avatar-outer {
    width: 90px;
    height: 90px;
    border-radius: 50%;
    background: #090D16;
    border: 4px solid var(--bat-yellow);
    box-shadow: 0 0 20px rgba(255, 230, 0, 0.6);
    margin: 0 auto 12px;
    position: relative;
    z-index: 1;
    overflow: hidden;
}

.login-avatar-outer img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.login-bat-header h2 {
    font-family: 'Marhey', 'Changa', sans-serif;
    font-size: 1.85rem;
    color: #FFFFFF;
    text-shadow: 0 2px 0 var(--bat-gold), 0 0 15px rgba(255, 230, 0, 0.5);
    margin: 0 0 6px 0;
    position: relative;
    z-index: 1;
}

.login-bat-tag {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    background: linear-gradient(135deg, var(--bat-yellow), var(--bat-gold));
    color: #090D16;
    font-family: 'Changa', sans-serif;
    font-weight: 900;
    font-size: 0.9rem;
    padding: 2px 16px;
    border-radius: 20px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.3);
    position: relative;
    z-index: 1;
}

.login-bat-body {
    padding: 25px 25px 20px;
}

.login-bat-body p {
    color: var(--text-muted);
    font-size: 1.05rem;
    margin-bottom: 20px;
    font-weight: 600;
    font-family: 'Tajawal', sans-serif;
}

.input-wrap-bat {
    margin-bottom: 16px;
}

#access-code {
    width: 100%;
    background: rgba(9, 13, 22, 0.7);
    border: 3px solid var(--bat-border);
    padding: 14px 18px;
    border-radius: 50px;
    color: var(--bat-yellow);
    font-size: 1.7rem;
    text-align: center;
    letter-spacing: 6px;
    font-family: 'Changa', monospace;
    font-weight: 800;
    outline: none;
    transition: all 0.25s ease;
    box-shadow: inset 0 2px 6px rgba(0, 0, 0, 0.4);
}

#access-code:focus {
    background: #090D16;
    border-color: var(--bat-yellow);
    box-shadow: 0 0 16px rgba(255, 230, 0, 0.3), inset 0 2px 6px rgba(0,0,0,0.5);
}

#access-code::placeholder {
    color: #64748B;
    font-size: 1.05rem;
    letter-spacing: normal;
    font-family: 'Tajawal', sans-serif;
    font-weight: 600;
}

#login-btn {
    width: 100%;
    background: linear-gradient(135deg, var(--bat-yellow) 0%, var(--bat-gold) 100%);
    color: #090D16;
    border: 2px solid #FFFFFF;
    padding: 14px 22px;
    border-radius: 50px;
    font-size: 1.25rem;
    font-weight: 900;
    font-family: 'Changa', 'Tajawal', sans-serif;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    transition: all 0.25s cubic-bezier(0.34, 1.56, 0.64, 1);
    box-shadow: 0 8px 20px rgba(255, 230, 0, 0.25);
}

#login-btn:hover {
    transform: translateY(-3px) scale(1.02);
    background: linear-gradient(135deg, var(--bat-yellow-glow) 0%, var(--bat-yellow) 100%);
    box-shadow: 0 12px 25px rgba(255, 230, 0, 0.4), 0 0 15px rgba(255, 230, 0, 0.35);
    border-color: #FFFFFF;
}

#login-btn:active {
    transform: translateY(0);
}

.error-msg {
    color: #EF4444 !important;
    margin-top: 10px;
    min-height: 22px;
    font-weight: 700;
    font-size: 0.95rem;
}

.login-bat-footer {
    margin-top: 16px;
    padding-top: 12px;
    border-top: 2px dashed var(--bat-border);
    font-size: 0.88rem;
    color: #94A3B8;
    font-weight: 600;
}

/* Expired Alert Box */
.expired-alert-box {
    background: rgba(239, 68, 68, 0.1);
    border: 2px solid #EF4444;
    border-radius: 20px;
    padding: 18px;
    margin-top: 10px;
    text-align: center;
}

.expired-icon {
    font-size: 1.8rem;
    margin-bottom: 4px;
}

.expired-alert-box h3 {
    color: #F87171;
    font-size: 1.25rem;
    font-weight: 800;
    margin-bottom: 6px;
    font-family: 'Changa', sans-serif;
}

.expired-alert-box p {
    color: #FCA5A5 !important;
    font-size: 0.95rem !important;
    margin-bottom: 15px !important;
    line-height: 1.5;
}

.contact-us-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    background: linear-gradient(135deg, #3B82F6, #2563EB);
    color: #FFFFFF !important;
    text-decoration: none;
    padding: 10px 22px;
    border-radius: 50px;
    font-weight: 800;
    font-size: 1rem;
    box-shadow: 0 4px 15px rgba(37, 99, 235, 0.35);
    transition: all 0.25s ease;
}

.contact-us-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(37, 99, 235, 0.5);
    background: linear-gradient(135deg, #60A5FA, #3B82F6);
}

/* --- Footer --- */
.bat-footer {
    text-align: center;
    padding: 1.5rem 0;
    margin-top: 2rem;
    position: relative;
    z-index: 10;
}

.bat-footer-line {
    height: 2px;
    background: linear-gradient(90deg, transparent, var(--bat-border), transparent);
    margin-bottom: 1rem;
}

.bat-footer p {
    color: var(--text-dim);
    font-size: 0.95rem;
    font-weight: 600;
    font-family: 'Changa', sans-serif;
}
