/* ==========================================================================
   🎮 spidey GAMING THEME - DIRASATI PLATFORM PORTAL - MUSTAFA WALEED (GRADE 3)
   ========================================================================== */

:root {
    /* spidey Signature Colors */
    --spidey-red: #E2231A;
    --spidey-red-dark: #A5140D;
    --spidey-red-glow: rgba(226, 35, 26, 0.45);
    --spidey-blue: #00A2FF;
    --spidey-blue-glow: rgba(0, 162, 255, 0.45);
    --spidey-green: #00B06F;
    --spidey-green-glow: rgba(0, 176, 111, 0.4);
    --spidey-gold: #FFD700;
    --spidey-gold-glow: rgba(255, 215, 0, 0.45);
    
    /* Dark Gaming Theme Palette */
    --spidey-bg: #121316;
    --spidey-panel: #1A1C20;
    --spidey-card: #24272D;
    --spidey-card-hover: #2F333B;
    --spidey-border: #383D47;
    --spidey-border-glow: rgba(0, 162, 255, 0.3);

    --text-main: #FFFFFF;
    --text-muted: #9DA3AE;
    --text-dim: #6B7280;
    
    --border-radius: 16px;
    --radius-xl: 24px;
    --radius-lg: 18px;
    --transition-speed: 0.25s;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    -webkit-tap-highlight-color: transparent;
    letter-spacing: normal !important;
}

body.spidey-theme {
    font-family: 'Cairo', 'Tajawal', sans-serif;
    background-color: var(--spidey-bg);
    background-image: 
        linear-gradient(to right, rgba(255, 255, 255, 0.04) 1px, transparent 1px),
        linear-gradient(to bottom, rgba(255, 255, 255, 0.04) 1px, transparent 1px),
        radial-gradient(circle at 10% 20%, rgba(226, 35, 26, 0.12), transparent 30%),
        radial-gradient(circle at 90% 80%, rgba(0, 162, 255, 0.12), transparent 35%);
    background-size: 36px 36px, 36px 36px, 100% 100%, 100% 100%;
    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 Spider-Man Background Elements
   ========================================= */
.spidey-floating-bg {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 0;
    overflow: hidden;
}

.s-elem {
    position: absolute;
    font-size: 2.2rem;
    opacity: 0.25;
    filter: drop-shadow(0 0 10px rgba(226, 54, 54, 0.4));
    animation: floatSpideyElem 8s ease-in-out infinite alternate;
}

.elem-1 { top: 12%; right: 8%; animation-delay: 0s; }
.elem-2 { top: 35%; left: 6%; animation-delay: 1.5s; font-size: 2.6rem; }
.elem-3 { top: 75%; right: 12%; animation-delay: 3s; }
.elem-4 { top: 55%; right: 4%; animation-delay: 2s; }
.elem-5 { top: 22%; left: 18%; animation-delay: 4s; font-size: 1.8rem; }
.elem-6 { top: 82%; left: 10%; animation-delay: 2.5s; font-size: 2.4rem; }
.elem-7 { top: 68%; left: 45%; animation-delay: 5s; }
.elem-8 { top: 8%; left: 40%; animation-delay: 3.5s; }

@keyframes floatSpideyElem {
    0% { transform: translateY(0) rotate(0deg); }
    50% { transform: translateY(-25px) rotate(15deg); }
    100% { transform: translateY(10px) rotate(-10deg); }
}

/* =========================================
   Login Overlay (spidey Gaming Console Style)
/* ==========================================================================
   🕷️ SPIDER-MAN MARVEL THEME - PROFESSIONAL LOGIN OVERLAY
   ========================================================================== */
.login-overlay, .spidey-login-overlay {
    position: fixed;
    top: 0; left: 0; width: 100vw; height: 100vh;
    background: radial-gradient(ellipse at 50% 25%, rgba(226, 54, 54, 0.3) 0%, rgba(13, 71, 161, 0.25) 50%, #080B14 90%);
    backdrop-filter: blur(14px);
    z-index: 99999;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 1.2rem;
    overflow: hidden;
    transition: opacity 0.45s ease, visibility 0.45s ease;
}

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

/* Background Web & Atmospheric Decor */
.spidey-bg-decorations {
    position: absolute;
    inset: 0;
    pointer-events: none;
    overflow: hidden;
    z-index: 0;
}

.spidey-web-svg {
    position: absolute;
    width: 320px;
    height: 320px;
    opacity: 0.25;
    filter: drop-shadow(0 0 15px rgba(226, 54, 54, 0.5));
}

.spidey-web-svg.web-tl {
    top: -40px;
    left: -40px;
}

.spidey-web-svg.web-tr {
    top: -40px;
    right: -40px;
    transform: scaleX(-1);
}

/* Swinging Web Threads */
.spidey-swinging-thread {
    position: absolute;
    top: -40px;
    transform-origin: top center;
    z-index: 1;
}

.spidey-swinging-thread.thread-left {
    left: 10%;
    animation: spideySwingLeft 5s infinite ease-in-out alternate;
}

.spidey-swinging-thread.thread-right {
    right: 10%;
    animation: spideySwingRight 6s infinite ease-in-out alternate-reverse;
}

.spidey-thread-line {
    width: 2px;
    height: 140px;
    background: linear-gradient(180deg, rgba(255, 255, 255, 0.8), rgba(0, 210, 255, 0.5));
    margin: 0 auto;
    box-shadow: 0 0 8px rgba(0, 210, 255, 0.8);
}

.spidey-hanging-spider {
    width: 65px;
    height: 65px;
    object-fit: contain;
    display: block;
    margin: -10px auto 0;
    filter: drop-shadow(0 10px 20px rgba(0, 0, 0, 0.8)) drop-shadow(0 0 15px rgba(226, 54, 54, 0.6));
    animation: spiderPulse 3s infinite alternate ease-in-out;
}

.spidey-hanging-mask {
    width: 58px;
    height: 58px;
    object-fit: contain;
    display: block;
    margin: -8px auto 0;
    filter: drop-shadow(0 10px 20px rgba(0, 0, 0, 0.8)) drop-shadow(0 0 15px rgba(13, 71, 161, 0.7));
}

@keyframes spideySwingLeft {
    0% { transform: rotate(14deg); }
    100% { transform: rotate(-12deg); }
}

@keyframes spideySwingRight {
    0% { transform: rotate(-15deg); }
    100% { transform: rotate(10deg); }
}

@keyframes spiderPulse {
    0% { transform: scale(1); }
    100% { transform: scale(1.08); }
}

/* Floating Particles */
.spidey-particle {
    position: absolute;
    font-size: 1.8rem;
    opacity: 0.3;
    filter: drop-shadow(0 0 8px rgba(226, 54, 54, 0.5));
    animation: floatSpideyParticle 9s ease-in-out infinite alternate;
}

.p1 { top: 18%; left: 8%; animation-delay: 0s; }
.p2 { top: 72%; left: 14%; animation-delay: 2s; font-size: 2.2rem; }
.p3 { top: 25%; right: 10%; animation-delay: 1.5s; }
.p4 { top: 80%; right: 15%; animation-delay: 3.5s; font-size: 2.4rem; }
.p5 { top: 50%; right: 6%; animation-delay: 4s; }

@keyframes floatSpideyParticle {
    0% { transform: translateY(0) rotate(0deg); }
    50% { transform: translateY(-25px) rotate(15deg); }
    100% { transform: translateY(15px) rotate(-10deg); }
}

/* The Spider-Man Card */
.spidey-login-card, .spidey-login-card {
    background: rgba(13, 17, 28, 0.94);
    border-radius: 28px;
    border: 2px solid rgba(226, 54, 54, 0.6);
    border-top: 5px solid #E23636;
    max-width: 480px;
    width: 100%;
    box-shadow: 
        0 25px 65px rgba(0, 0, 0, 0.9),
        0 0 35px rgba(226, 54, 54, 0.45),
        0 0 70px rgba(13, 71, 161, 0.35);
    animation: spideyCardEntry 0.45s cubic-bezier(0.34, 1.56, 0.64, 1);
    overflow: hidden;
    position: relative;
    text-align: center;
    z-index: 10;
    backdrop-filter: blur(16px);
}

@keyframes spideyCardEntry {
    from { opacity: 0; transform: scale(0.85) translateY(30px); }
    to { opacity: 1; transform: scale(1) translateY(0); }
}

/* Card Header */
.spidey-card-header, .spidey-card-header {
    background: linear-gradient(180deg, rgba(226, 54, 54, 0.18) 0%, rgba(13, 17, 28, 0.95) 100%);
    padding: 28px 22px 18px;
    position: relative;
    border-bottom: 2px solid rgba(226, 54, 54, 0.25);
}

.spidey-avatar-outer, .spidey-avatar-outer {
    width: 106px;
    height: 106px;
    border-radius: 24px;
    background: #080B14;
    border: 3px solid #E23636;
    box-shadow: 
        0 0 25px rgba(226, 54, 54, 0.6),
        0 0 50px rgba(13, 71, 161, 0.4),
        inset 0 0 15px rgba(0, 0, 0, 0.9);
    margin: 0 auto 14px;
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
}

.spidey-student-img, .spidey-avatar-outer img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    border-radius: 20px;
    display: block;
}

.spidey-mask-badge {
    position: absolute;
    top: -12px;
    right: -12px;
    width: 38px;
    height: 38px;
    object-fit: contain;
    filter: drop-shadow(0 4px 10px rgba(0,0,0,0.8)) drop-shadow(0 0 8px rgba(226,54,54,0.8));
    animation: spideyMaskFloat 3s infinite alternate ease-in-out;
}

@keyframes spideyMaskFloat {
    0% { transform: scale(1) rotate(0deg); }
    100% { transform: scale(1.1) rotate(6deg); }
}

.spidey-hero-pill, .gamer-pro-pill {
    position: absolute;
    bottom: -10px;
    background: linear-gradient(135deg, #E23636 0%, #0D47A1 100%);
    color: #FFFFFF;
    font-size: 0.72rem;
    font-weight: 900;
    padding: 3px 12px;
    border-radius: 8px;
    border: 1px solid rgba(255, 255, 255, 0.8);
    font-family: 'Cairo', sans-serif;
    letter-spacing: 0.6px;
    box-shadow: 0 4px 12px rgba(226, 54, 54, 0.6);
    white-space: nowrap;
}

.spidey-card-header h2, .spidey-card-header h2 {
    font-family: 'Cairo', sans-serif;
    font-size: 1.7rem;
    color: #FFFFFF;
    font-weight: 900;
    margin: 4px 0 6px 0;
    text-shadow: 0 0 20px rgba(226, 54, 54, 0.6);
}

.spidey-login-tag, .spidey-login-tag {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    background: rgba(226, 54, 54, 0.12);
    color: #FF6B6B;
    font-family: 'Cairo', sans-serif;
    font-weight: 800;
    font-size: 0.88rem;
    padding: 4px 16px;
    border-radius: 14px;
    border: 1px solid rgba(226, 54, 54, 0.35);
    box-shadow: 0 0 15px rgba(226, 54, 54, 0.2);
}

.spidey-tag-icon {
    width: 22px;
    height: 22px;
    object-fit: contain;
}

/* Card Body */
.spidey-card-body, .spidey-card-body {
    padding: 24px 28px 22px;
}

.spidey-card-body p, .spidey-card-body p {
    color: #D1D5DB;
    font-size: 1.05rem;
    margin-bottom: 22px;
    font-weight: 700;
    font-family: 'Cairo', 'Tajawal', sans-serif;
    line-height: 1.6;
}

.spidey-input-wrap, .spidey-input-wrap {
    margin-bottom: 18px;
    position: relative;
    display: flex;
    align-items: center;
}

.spidey-input-icon {
    position: absolute;
    right: 16px;
    font-size: 1.3rem;
    pointer-events: none;
    z-index: 2;
    opacity: 0.85;
}

#access-code {
    width: 100%;
    background: #0B0E17;
    border: 2px solid rgba(226, 54, 54, 0.4);
    padding: 14px 45px 14px 18px;
    border-radius: 16px;
    color: #FFFFFF;
    font-size: 1.8rem;
    text-align: center;
    letter-spacing: 6px;
    font-family: 'Cairo', monospace;
    font-weight: 900;
    outline: none;
    transition: all 0.28s ease;
    box-shadow: inset 0 2px 10px rgba(0, 0, 0, 0.9);
}

#access-code:focus {
    background: #111624;
    border-color: #E23636;
    box-shadow: 
        0 0 25px rgba(226, 54, 54, 0.6),
        0 0 40px rgba(13, 71, 161, 0.4),
        inset 0 2px 10px rgba(0, 0, 0, 0.9);
}

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

/* Spider-Man Blast Login Button */
.spidey-login-btn, .spidey-login-btn {
    width: 100%;
    background: linear-gradient(135deg, #E23636 0%, #B11313 50%, #0D47A1 100%);
    background-size: 200% auto;
    color: #FFFFFF;
    border: 2px solid rgba(255, 255, 255, 0.4);
    padding: 15px 24px;
    border-radius: 16px;
    font-size: 1.25rem;
    font-weight: 900;
    font-family: 'Cairo', sans-serif;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    box-shadow: 
        0 6px 0 #7A0C06,
        0 10px 25px rgba(226, 54, 54, 0.5),
        0 0 25px rgba(13, 71, 161, 0.4);
    transition: all 0.25s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

.spidey-login-btn:hover, .spidey-login-btn:hover {
    transform: translateY(-3px);
    background-position: right center;
    box-shadow: 
        0 8px 0 #002171,
        0 12px 30px rgba(13, 71, 161, 0.7),
        0 0 35px rgba(226, 54, 54, 0.6);
    border-color: #FFFFFF;
}

.spidey-login-btn:active, .spidey-login-btn:active {
    transform: translateY(3px);
    box-shadow: 0 2px 0 #002171;
}

.spidey-login-footer, .spidey-login-footer {
    margin-top: 18px;
    padding-top: 14px;
    border-top: 1px solid rgba(255, 255, 255, 0.08);
}

.spidey-login-footer span, .spidey-login-footer span {
    color: #9CA3AF;
    font-size: 0.82rem;
    font-family: 'Cairo', sans-serif;
    font-weight: 700;
}

.error-msg {
    color: #FF4757;
    font-size: 0.95rem;
    font-weight: 800;
    margin-top: 12px;
    min-height: 1.4em;
    font-family: 'Cairo', sans-serif;
    text-shadow: 0 0 10px rgba(255, 71, 87, 0.4);
}

.spidey-login-footer {
    margin-top: 14px;
    padding-top: 12px;
    border-top: 1px solid rgba(255, 255, 255, 0.08);
    color: var(--text-dim);
    font-size: 0.8rem;
    font-weight: 700;
    font-family: 'Cairo', sans-serif;
}

/* Expired Subscription Box */
.expired-alert-box {
    background: #24272D;
    border: 2px solid var(--spidey-gold);
    border-radius: 16px;
    padding: 1.5rem;
    text-align: center;
}

.expired-icon {
    font-size: 3rem;
    margin-bottom: 0.5rem;
}

.expired-alert-box h3 {
    color: var(--spidey-gold);
    font-family: 'Cairo', sans-serif;
    font-size: 1.4rem;
    margin-bottom: 0.5rem;
}

.expired-alert-box p {
    color: var(--text-muted);
    font-size: 0.95rem;
    margin-bottom: 1.2rem;
}

.contact-us-btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    background: #1877F2;
    color: #FFF;
    text-decoration: none;
    padding: 0.7rem 1.6rem;
    border-radius: 12px;
    font-weight: 800;
    font-family: 'Cairo', sans-serif;
    transition: 0.2s;
    box-shadow: 0 4px 0 #0D47A1;
}

.contact-us-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 0 #0D47A1, 0 0 15px rgba(24, 119, 242, 0.5);
}

/* =========================================
   Portal Header (Student Profile)
   ========================================= */
.spidey-portal-header {
    padding: 2.2rem 1rem 0.8rem;
    display: flex;
    justify-content: center;
    align-items: center;
    position: relative;
    z-index: 2;
}

.portal-profile-wrap {
    display: flex;
    align-items: center;
    gap: 1.2rem;
    background: rgba(26, 28, 32, 0.9);
    border: 2px solid var(--spidey-border);
    border-radius: 22px;
    padding: 0.9rem 2rem 0.9rem 1.4rem;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.6), 0 0 25px rgba(0, 162, 255, 0.2);
    backdrop-filter: blur(8px);
}

.portal-avatar-box {
    width: 64px;
    height: 64px;
    border-radius: 16px;
    position: relative;
    background: #14161B;
    border: 2.5px solid var(--spidey-gold);
    box-shadow: 0 0 18px rgba(255, 215, 0, 0.4);
    display: flex;
    align-items: center;
    justify-content: center;
}

.portal-avatar-img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    border-radius: 13px;
}

.portal-avatar-box .gamer-lvl {
    position: absolute;
    bottom: -8px;
    right: 50%;
    transform: translateX(50%);
    background: linear-gradient(135deg, #E23636, #0D47A1);
    color: #FFF;
    font-size: 0.62rem;
    font-weight: 900;
    padding: 2px 8px;
    border-radius: 6px;
    border: 1px solid rgba(255, 255, 255, 0.5);
    box-shadow: 0 3px 8px rgba(0, 0, 0, 0.6);
    white-space: nowrap;
    z-index: 2;
}

.portal-profile-text {
    display: flex;
    flex-direction: column;
    text-align: right;
}

.portal-student-name {
    font-size: 1.65rem;
    font-weight: 900;
    color: #FFFFFF;
    font-family: 'Cairo', sans-serif;
    margin: 0;
    line-height: 1.2;
}

.portal-grade-badge {
    font-size: 0.9rem;
    font-weight: 800;
    color: var(--spidey-gold);
    font-family: 'Cairo', sans-serif;
}

/* =========================================
   Portal Main Content & Educational Platforms Grid
   ========================================= */
.portal-main-wrap {
    max-width: 1150px;
    width: 94%;
    margin: 1.5rem auto 3rem auto;
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    position: relative;
    z-index: 1;
}

.spidey-cards-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 2.2rem;
    width: 100%;
    margin: 1.5rem 0;
}

.spidey-subject-card {
    background: #1E2127;
    border: 2px solid var(--spidey-border);
    border-radius: 22px;
    padding: 2.2rem 1.6rem;
    text-decoration: none;
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    box-shadow: 0 8px 0 #121418, 0 12px 30px rgba(0, 0, 0, 0.5);
    transition: all 0.28s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    position: relative;
    overflow: hidden;
    min-height: 380px;
}

.spidey-subject-card:hover {
    transform: translateY(-8px);
    background: #262B34;
    border-color: var(--spidey-blue);
    box-shadow: 0 14px 0 #121418, 0 0 30px rgba(0, 162, 255, 0.35);
}

.spidey-subject-card:active {
    transform: translateY(2px);
    box-shadow: 0 2px 0 #121418;
}

/* Specific Card Themes */
.card-reading-theme { border-top: 5px solid var(--spidey-gold); }
.card-english-theme { border-top: 5px solid var(--spidey-blue); }
.card-math-theme { border-top: 5px solid var(--spidey-green); }
.card-game-theme { border-top: 5px solid var(--spidey-red); }

.card-header-pill {
    margin-bottom: 1rem;
}

.lesson-status-pill {
    font-size: 0.8rem;
    font-weight: 800;
    padding: 4px 14px;
    border-radius: 12px;
    font-family: 'Cairo', sans-serif;
    background: rgba(255, 255, 255, 0.08);
    color: #FFF;
    border: 1px solid var(--spidey-border);
}

.special-game-pill {
    background: rgba(226, 35, 26, 0.2) !important;
    color: #FF7675 !important;
    border-color: rgba(226, 35, 26, 0.4) !important;
}

.card-stage-bubble {
    width: 88px;
    height: 88px;
    border-radius: 20px;
    background: #14161B;
    border: 2px solid var(--spidey-border);
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 1.2rem;
    box-shadow: inset 0 2px 8px rgba(0,0,0,0.6);
    transition: transform 0.3s ease;
}

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

.card-reading-theme .card-stage-bubble { color: var(--spidey-gold); }
.card-english-theme .card-stage-bubble { color: var(--spidey-blue); }
.card-math-theme .card-stage-bubble { color: var(--spidey-green); }
.card-game-theme .card-stage-bubble { color: var(--spidey-red); }

.spidey-subject-card:hover .card-stage-bubble {
    transform: scale(1.1) rotate(5deg);
}

.card-title {
    font-size: 1.4rem;
    font-weight: 800;
    color: #FFFFFF;
    font-family: 'Cairo', sans-serif;
    margin-bottom: 0.6rem;
}

.card-desc {
    font-size: 0.92rem;
    color: var(--text-muted);
    line-height: 1.5;
    margin-bottom: 1.5rem;
    flex-grow: 1;
}

.spidey-card-btn {
    width: 100%;
    padding: 0.75rem 1rem;
    background: #24272D;
    border: 2px solid var(--spidey-border);
    color: #FFFFFF;
    border-radius: 12px;
    font-weight: 800;
    font-family: 'Cairo', sans-serif;
    font-size: 1rem;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    box-shadow: 0 4px 0 #121418;
    transition: all 0.2s ease;
}

.spidey-subject-card:hover .spidey-card-btn {
    background: linear-gradient(135deg, var(--spidey-blue) 0%, #0070BA 100%);
    box-shadow: 0 4px 0 #004573;
    border-color: #70CFFF;
}

/* =========================================
   Footer
   ========================================= */
.app-footer.spidey-footer {
    text-align: center;
    padding: 2.5rem 1rem 2rem 1rem;
    margin-top: auto;
    width: 100%;
    position: relative;
    z-index: 2;
}

.footer-link {
    color: #9DA3AE;
    text-decoration: none;
    font-family: 'Cairo', 'Cairo', sans-serif;
    font-size: 1.05rem;
    font-weight: 700;
    padding: 8px 24px;
    border-radius: 20px;
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid rgba(255, 255, 255, 0.1);
    transition: all 0.25s ease;
    display: inline-block;
}

.footer-link:hover {
    color: #00E5FF;
    background: rgba(0, 229, 255, 0.1);
    border-color: #00E5FF;
    transform: translateY(-2px);
    box-shadow: 0 4px 18px rgba(0, 229, 255, 0.35);
}

/* =========================================
   Responsive Adjustments
   ========================================= */
@media (max-width: 992px) {
    .spidey-cards-grid {
        grid-template-columns: 1fr;
        max-width: 420px;
        gap: 1.5rem;
    }
    .portal-profile-wrap {
        padding: 0.8rem 1.4rem;
        gap: 0.9rem;
    }
    .portal-student-name {
        font-size: 1.4rem;
    }
}


