/* ==========================================================================
   🎮 ROBLOX GAMING THEME - DIRASATI PLATFORM PORTAL - AMIR MOHAMMED (GRADE 3)
   ========================================================================== */

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

body.roblox-theme {
    font-family: 'Cairo', 'Changa', 'Tajawal', sans-serif;
    background-color: var(--roblox-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 Roblox Blox Background Elements
   ========================================= */
.roblox-floating-bg {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 0;
    overflow: hidden;
}

.r-blox {
    position: absolute;
    font-size: 2.2rem;
    opacity: 0.25;
    filter: drop-shadow(0 0 10px rgba(255, 255, 255, 0.3));
    animation: floatBlox 8s ease-in-out infinite alternate;
}

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

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

/* =========================================
   Login Overlay (Roblox Gaming Console Style)
   ========================================= */
.login-overlay {
    position: fixed;
    top: 0; left: 0; width: 100vw; height: 100vh;
    background: rgba(10, 11, 14, 0.88);
    backdrop-filter: blur(10px);
    z-index: 99999;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 1rem;
    transition: opacity 0.4s ease, visibility 0.4s ease;
}

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

.roblox-login-card {
    background: #1A1C20;
    border-radius: 24px;
    border: 2px solid var(--roblox-border);
    border-top: 5px solid var(--roblox-red);
    max-width: 460px;
    width: 100%;
    box-shadow: 
        0 25px 60px rgba(0, 0, 0, 0.8),
        0 0 30px var(--roblox-red-glow);
    animation: robloxCardPop 0.4s cubic-bezier(0.34, 1.56, 0.64, 1);
    overflow: hidden;
    position: relative;
    text-align: center;
}

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

.roblox-card-header {
    background: linear-gradient(180deg, #24272D 0%, #1A1C20 100%);
    padding: 26px 20px 18px;
    position: relative;
    border-bottom: 2px solid var(--roblox-border);
}

.roblox-avatar-outer {
    width: 96px;
    height: 96px;
    border-radius: 20px;
    background: #121316;
    border: 3px solid var(--roblox-gold);
    box-shadow: 0 0 25px rgba(255, 215, 0, 0.4), inset 0 2px 8px rgba(0,0,0,0.8);
    margin: 0 auto 12px;
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
}

.roblox-avatar-outer img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    border-radius: 16px;
    display: block;
}

.gamer-pro-pill {
    position: absolute;
    bottom: -8px;
    background: linear-gradient(135deg, var(--roblox-red), #A5140D);
    color: #FFF;
    font-size: 0.7rem;
    font-weight: 900;
    padding: 2px 10px;
    border-radius: 6px;
    border: 1px solid #FFF;
    font-family: 'Changa', sans-serif;
    letter-spacing: 0.5px;
    box-shadow: 0 2px 6px rgba(0,0,0,0.5);
}

.roblox-card-header h2 {
    font-family: 'Changa', sans-serif;
    font-size: 1.7rem;
    color: #FFFFFF;
    font-weight: 800;
    margin: 0 0 6px 0;
    text-shadow: 0 0 15px rgba(255,255,255,0.3);
}

.roblox-login-tag {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    background: rgba(0, 162, 255, 0.15);
    color: #52BFFF;
    font-family: 'Changa', sans-serif;
    font-weight: 800;
    font-size: 0.85rem;
    padding: 3px 14px;
    border-radius: 12px;
    border: 1px solid rgba(0, 162, 255, 0.35);
}

.roblox-card-body {
    padding: 24px 26px 22px;
}

.roblox-card-body p {
    color: var(--text-muted);
    font-size: 1.05rem;
    margin-bottom: 20px;
    font-weight: 700;
    font-family: 'Cairo', 'Tajawal', sans-serif;
    line-height: 1.5;
}

.roblox-input-wrap {
    margin-bottom: 18px;
}

#access-code {
    width: 100%;
    background: #121418;
    border: 2px solid var(--roblox-border);
    padding: 14px 18px;
    border-radius: 14px;
    color: #FFFFFF;
    font-size: 1.8rem;
    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 8px rgba(0, 0, 0, 0.8);
}

#access-code:focus {
    background: #16181F;
    border-color: var(--roblox-blue);
    box-shadow: 0 0 20px rgba(0, 162, 255, 0.4), inset 0 2px 8px rgba(0,0,0,0.8);
}

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

/* 3D Roblox Login Button */
.roblox-login-btn {
    width: 100%;
    background: linear-gradient(135deg, var(--roblox-red) 0%, #B81912 100%);
    color: #FFFFFF;
    border: 2px solid rgba(255, 255, 255, 0.25);
    padding: 14px 22px;
    border-radius: 14px;
    font-size: 1.25rem;
    font-weight: 800;
    font-family: 'Changa', sans-serif;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    box-shadow: 0 5px 0 #7A0C06, 0 8px 20px var(--roblox-red-glow);
    transition: all 0.22s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

.roblox-login-btn:hover {
    transform: translateY(-3px);
    background: linear-gradient(135deg, var(--roblox-blue) 0%, #0070BA 100%);
    box-shadow: 0 7px 0 #004573, 0 10px 25px rgba(0, 162, 255, 0.5);
    border-color: #70CFFF;
}

.roblox-login-btn:active {
    transform: translateY(3px);
    box-shadow: 0 1px 0 #004573;
}

.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);
}

.roblox-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: 'Changa', sans-serif;
}

/* Expired Subscription Box */
.expired-alert-box {
    background: #24272D;
    border: 2px solid var(--roblox-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(--roblox-gold);
    font-family: 'Changa', 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: 'Changa', 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)
   ========================================= */
.roblox-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(--roblox-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(--roblox-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-profile-text {
    display: flex;
    flex-direction: column;
    text-align: right;
}

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

.portal-grade-badge {
    font-size: 0.9rem;
    font-weight: 800;
    color: var(--roblox-gold);
    font-family: 'Changa', 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;
}

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

.roblox-subject-card {
    background: #1E2127;
    border: 2px solid var(--roblox-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;
}

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

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

/* Specific Card Themes */
.card-reading-theme { border-top: 5px solid var(--roblox-gold); }
.card-english-theme { border-top: 5px solid var(--roblox-blue); }
.card-math-theme { border-top: 5px solid var(--roblox-green); }
.card-game-theme { border-top: 5px solid var(--roblox-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: 'Changa', sans-serif;
    background: rgba(255, 255, 255, 0.08);
    color: #FFF;
    border: 1px solid var(--roblox-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(--roblox-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(--roblox-gold); }
.card-english-theme .card-stage-bubble { color: var(--roblox-blue); }
.card-math-theme .card-stage-bubble { color: var(--roblox-green); }
.card-game-theme .card-stage-bubble { color: var(--roblox-red); }

.roblox-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: 'Changa', 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;
}

.roblox-card-btn {
    width: 100%;
    padding: 0.75rem 1rem;
    background: #24272D;
    border: 2px solid var(--roblox-border);
    color: #FFFFFF;
    border-radius: 12px;
    font-weight: 800;
    font-family: 'Changa', 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;
}

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

/* =========================================
   Footer
   ========================================= */
.app-footer.roblox-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', 'Changa', 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) {
    .roblox-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;
    }
}

