@import url('https://fonts.googleapis.com/css2?family=Cairo:wght@400;600;700;800;900&family=Fredoka:wght@500;700;800&family=Alexandria:wght@400;700;900&family=Orbitron:wght@700;900&family=Bangers&display=swap');

:root {
    /* Spider-Man Hero Color Palette */
    --primary: #e62429;          /* Spider Crimson Red */
    --primary-dark: #b30006;     /* Deep Marvel Red */
    --primary-light: #ff3344;    /* Glowing Neon Red */
    --secondary: #0066cc;        /* Spider Blue */
    --secondary-dark: #03194a;   /* Midnight Hero Blue */
    --secondary-light: #00b4d8;  /* Electric Blue */
    --accent: #ffd60a;           /* Spider-Sense Gold */
    --accent-glow: #ffe066;      /* Golden Glow */
    --accent-cyan: #00f0ff;      /* Web Glow Cyan */
    --dark: #080a14;             /* Dark Web Night */
    
    --card-bg: linear-gradient(135deg, rgba(14, 21, 46, 0.94) 0%, rgba(8, 12, 28, 0.98) 100%);
    --card-border: rgba(230, 36, 41, 0.55);
    --card-border-hover: #00f0ff;
    
    --text-main: #ffffff;
    --text-light: #bde0fe;
    --text-muted: #8ecae6;
    --white: #ffffff;
    --success: #00f0ff;
    --warning: #ffd60a;

    --spidey-glow: 0 0 25px rgba(230, 36, 41, 0.8), 0 0 45px rgba(0, 102, 204, 0.5);
    --gold-glow: 0 0 20px rgba(255, 214, 10, 0.85), 0 0 35px rgba(255, 214, 10, 0.45);
    --blue-glow: 0 0 20px rgba(0, 102, 204, 0.8), 0 0 35px rgba(0, 240, 255, 0.45);
    --shadow: 0 12px 35px rgba(0, 0, 0, 0.7);
    --shadow-hover: 0 18px 45px rgba(230, 36, 41, 0.6), 0 0 30px rgba(0, 240, 255, 0.4);
    --radius: 26px;

    --font-ar: 'Cairo', 'Alexandria', sans-serif;
    --font-en: 'Fredoka', 'Cairo', sans-serif;
    --font-digital: 'Orbitron', 'Courier New', monospace;
    --font-comic: 'Bangers', 'Cairo', sans-serif;
}

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

body {
    font-family: var(--font-ar);
    background-color: var(--dark);
    color: var(--text-main);
    line-height: 1.6;
    background-image: 
        radial-gradient(circle at 15% 30%, rgba(230, 36, 41, 0.35), transparent 550px),
        radial-gradient(circle at 85% 70%, rgba(0, 102, 204, 0.4), transparent 600px),
        radial-gradient(circle at 50% 50%, rgba(255, 214, 10, 0.1), transparent 650px),
        url("data:image/svg+xml,%3Csvg width='120' height='120' viewBox='0 0 120 120' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M60 0 L60 120 M0 60 L120 60 M0 0 L120 120 M120 0 L0 120' stroke='rgba(255, 255, 255, 0.05)' stroke-width='1'/%3E%3Cpolygon points='60,20 95,60 60,100 25,60' fill='none' stroke='rgba(0, 240, 255, 0.07)' stroke-width='1'/%3E%3Cpolygon points='60,40 75,60 60,80 45,60' fill='none' stroke='rgba(230, 36, 41, 0.08)' stroke-width='1'/%3E%3C/svg%3E");
    background-size: auto, auto, auto, 120px 120px;
    background-attachment: fixed;
    animation: breathingBackground 16s ease-in-out infinite alternate;
    min-height: 100vh;
    overflow-x: hidden;
    direction: rtl;
    display: flex;
    flex-direction: column;
}

@keyframes breathingBackground {
    0% { background-position: 0% 0%, 0% 0%, 0% 0%, 0 0; }
    100% { background-position: 5% 5%, -5% 5%, 0% 5%, 0 40px; }
}

/* =========================================================
   Spider-Man Header & Profile
========================================================= */
.fairy-header {
    background: linear-gradient(135deg, rgba(14, 21, 46, 0.95) 0%, rgba(8, 10, 24, 0.98) 100%);
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.7), 0 0 35px rgba(230, 36, 41, 0.35);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border-bottom: 2px solid rgba(230, 36, 41, 0.6);
    border-bottom-left-radius: 30px;
    border-bottom-right-radius: 30px;
    padding: 0.85rem 2rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    position: sticky;
    top: 0;
    z-index: 100;
    gap: 16px;
    width: 100%;
}

/* 1. Student Profile */
.user-profile-header {
    display: flex;
    align-items: center;
    gap: 12px;
    cursor: pointer;
    transition: transform 0.25s ease;
}

.user-profile-header:hover {
    transform: translateY(-2px);
}

.user-avatar-glow {
    position: relative;
    width: 64px;
    height: 64px;
    border-radius: 50%;
    background: radial-gradient(circle, #e62429 0%, #03194a 100%);
    border: 2.5px solid #ffd60a;
    box-shadow: 0 0 18px rgba(255, 214, 10, 0.7), 0 0 28px rgba(230, 36, 41, 0.5);
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    transition: transform 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.user-avatar-glow:hover {
    transform: scale(1.08) rotate(4deg);
    box-shadow: 0 0 25px rgba(255, 214, 10, 0.9), 0 0 35px rgba(230, 36, 41, 0.8);
}

.user-profile-img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    border-radius: 50%;
    display: block;
}

.avatar-fairy-badge {
    position: absolute;
    bottom: -4px;
    left: -4px;
    background: #e62429;
    border: 1.5px solid #ffd60a;
    border-radius: 50%;
    width: 24px;
    height: 24px;
    font-size: 0.8rem;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.6);
}

.user-info-text {
    display: flex;
    flex-direction: column;
    text-align: right;
}

.student-name {
    font-size: 1.25rem;
    font-weight: 900;
    color: #FFFFFF;
    text-shadow: 0 0 10px rgba(230, 36, 41, 0.8);
    margin: 0;
    line-height: 1.2;
}

.student-grade-pill {
    display: inline-block;
    font-size: 0.75rem;
    font-weight: 800;
    color: #ffd60a;
    background: rgba(0, 102, 204, 0.6);
    border: 1px solid rgba(255, 214, 10, 0.5);
    border-radius: 20px;
    padding: 2px 8px;
    margin-top: 3px;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.4);
}

/* =========================================================
   Main Wrapper & Glass Card
========================================================= */
.main-wrapper {
    width: 100%;
    max-width: 1100px;
    margin: auto;
    padding: 30px 20px;
    z-index: 10;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    min-height: 100vh;
}

.section-container {
    display: flex;
    flex-direction: column;
    align-items: center;
    width: 100%;
}

.glass-card {
    background: var(--card-bg);
    backdrop-filter: blur(25px);
    -webkit-backdrop-filter: blur(25px);
    border: 3px solid var(--card-border);
    border-radius: var(--radius);
    padding: 45px 35px;
    width: 100%;
    max-width: 520px;
    position: relative;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.8), 
                0 0 35px rgba(230, 36, 41, 0.35), 
                inset 0 0 25px rgba(0, 240, 255, 0.1);
    overflow: hidden;
    text-align: center;
    transition: all 0.4s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.glass-card.wide-portal {
    max-width: 1000px;
    padding: 40px 30px;
}

.card-glow {
    position: absolute;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background: radial-gradient(circle at center, rgba(230, 36, 41, 0.25) 0%, rgba(0, 102, 204, 0.15) 35%, transparent 65%);
    pointer-events: none;
}

/* Spider Emblem / Avatar inside Login Card */
.fairy-emblem-wrap {
    position: relative;
    width: 130px;
    height: 130px;
    margin: 0 auto 20px;
}

.fairy-emblem-ring {
    width: 100%;
    height: 100%;
    border-radius: 50%;
    background: radial-gradient(circle, #e62429 0%, #03194a 80%);
    border: 3px solid #ffd60a;
    box-shadow: 0 0 25px rgba(255, 214, 10, 0.85), 0 0 35px rgba(230, 36, 41, 0.75);
    padding: 4px;
    animation: emblemFloat 3.5s ease-in-out infinite alternate;
}

@keyframes emblemFloat {
    0% { transform: translateY(0) rotate(0deg); }
    100% { transform: translateY(-10px) rotate(3deg); }
}

.fairy-emblem-img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    border-radius: 50%;
    display: block;
}

.emblem-crown {
    position: absolute;
    top: -12px;
    right: 50%;
    transform: translateX(50%);
    background: linear-gradient(135deg, #e62429, #b30006);
    border: 2px solid #ffd60a;
    border-radius: 50%;
    width: 38px;
    height: 38px;
    font-size: 1.25rem;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 4px 15px rgba(230, 36, 41, 0.8), 0 0 10px rgba(255, 214, 10, 0.6);
    animation: pulseStar 1.5s infinite alternate;
}

@keyframes pulseStar {
    0% { transform: translateX(50%) scale(0.88); opacity: 0.8; }
    100% { transform: translateX(50%) scale(1.15); opacity: 1; filter: drop-shadow(0 0 8px #ffd60a); }
}

.brand-header h1 {
    font-size: 2.2rem;
    font-weight: 900;
    margin-bottom: 6px;
    background: linear-gradient(135deg, #ffffff 0%, #ff4d4d 45%, #ffd60a 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    text-shadow: 0 0 20px rgba(230, 36, 41, 0.6);
}

.tagline {
    color: var(--text-light);
    font-size: 1.05rem;
    margin-bottom: 25px;
    font-weight: 600;
}

.instruction {
    font-size: 1.05rem;
    color: #ffffff;
    background: rgba(14, 21, 46, 0.8);
    border: 1.5px dashed rgba(230, 36, 41, 0.6);
    border-radius: 20px;
    padding: 12px 18px;
    margin-bottom: 28px;
    line-height: 1.6;
    font-weight: 700;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.4), inset 0 0 10px rgba(0, 240, 255, 0.1);
}

/* =========================================================
   Premium Form (Password Input & Button)
========================================================= */
.premium-form {
    display: flex;
    flex-direction: column;
    gap: 20px;
    width: 100%;
}

.field-container {
    position: relative;
    width: 100%;
}

.field-container label {
    display: flex;
    align-items: center;
    justify-content: flex-start;
    gap: 8px;
    margin-bottom: 10px;
    font-size: 1rem;
    font-weight: 800;
    color: var(--accent);
    text-shadow: 0 0 8px rgba(255, 214, 10, 0.6);
    padding-right: 5px;
}

.field-container input {
    width: 100%;
    background: rgba(8, 12, 28, 0.85);
    border: 2px solid rgba(230, 36, 41, 0.6);
    border-radius: 22px;
    padding: 16px 20px;
    color: #ffffff;
    font-size: 26px;
    text-align: center;
    letter-spacing: 10px;
    font-weight: 900;
    transition: all 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
    box-shadow: inset 0 2px 8px rgba(0, 0, 0, 0.7);
}

.field-container input:focus {
    outline: none;
    border-color: #00f0ff;
    background: rgba(14, 21, 46, 0.95);
    box-shadow: 0 0 25px rgba(0, 240, 255, 0.7), inset 0 0 10px rgba(230, 36, 41, 0.5);
    transform: scale(1.02);
}

.field-container input::placeholder {
    color: rgba(255, 255, 255, 0.3);
    letter-spacing: 6px;
}

.primary-btn {
    background: linear-gradient(135deg, #e62429 0%, #0066cc 100%);
    color: #ffffff !important;
    border: 2px solid #ffd60a;
    padding: 16px 24px;
    border-radius: 50px;
    font-size: 1.15rem;
    font-weight: 900;
    cursor: pointer;
    position: relative;
    overflow: hidden;
    transition: all 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
    box-shadow: 0 6px 20px rgba(230, 36, 41, 0.6), 0 0 16px rgba(255, 214, 10, 0.4);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    text-decoration: none;
    width: 100%;
}

.primary-btn:hover {
    transform: translateY(-3px) scale(1.03);
    box-shadow: 0 10px 30px rgba(230, 36, 41, 0.85), 0 0 28px rgba(0, 240, 255, 0.7);
    background: linear-gradient(135deg, #0066cc 0%, #e62429 100%);
}

.btn-shine {
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(120deg, transparent, rgba(255, 255, 255, 0.35), transparent);
    transition: 0.5s;
}

.primary-btn:hover .btn-shine {
    left: 100%;
}

.subject-btn {
    padding: 18px 24px;
    font-size: 1.22rem;
    letter-spacing: 0.5px;
    border-radius: 50px;
}

/* =========================================================
   Expired Subscription Message
========================================================= */
.expired-box {
    background: linear-gradient(135deg, rgba(14, 21, 46, 0.95), rgba(8, 10, 24, 0.98));
    border: 2px solid #e62429;
    border-radius: 24px;
    padding: 25px 20px;
    text-align: center;
    box-shadow: 0 0 30px rgba(230, 36, 41, 0.5), inset 0 0 15px rgba(0, 240, 255, 0.15);
}

.expired-box h3 {
    color: #ffd60a;
    font-size: 1.4rem;
    font-weight: 900;
    margin-bottom: 12px;
    text-shadow: 0 0 12px rgba(255, 214, 10, 0.8);
}

.expired-box p {
    color: #ffffff;
    font-size: 1.15rem;
    font-weight: 700;
    line-height: 1.8;
    margin-bottom: 22px;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.6);
}

.contact-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    background: linear-gradient(135deg, #1877f2, #00c6ff);
    color: #ffffff !important;
    text-decoration: none;
    padding: 14px 34px;
    border-radius: 50px;
    font-size: 1.15rem;
    font-weight: 900;
    border: 2px solid #ffd60a;
    box-shadow: 0 8px 25px rgba(24, 119, 242, 0.6), 0 0 15px rgba(255, 214, 10, 0.5);
    transition: all 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.contact-btn:hover {
    transform: translateY(-3px) scale(1.05);
    box-shadow: 0 12px 30px rgba(24, 119, 242, 0.85), 0 0 25px rgba(255, 214, 10, 0.8);
}

/* =========================================================
   Dancing Floating Spider Stickers & Particles
========================================================= */
.spidey-particle {
    position: fixed;
    pointer-events: none;
    z-index: 10000;
    display: inline-block;
    will-change: transform, opacity;
    animation: spideyFloatAway 3.8s cubic-bezier(0.25, 1, 0.5, 1) forwards;
    filter: drop-shadow(0 0 12px rgba(230, 36, 41, 0.9));
}

.spidey-sticker-img {
    width: 75px;
    height: 75px;
    border-radius: 50%;
    overflow: hidden;
    object-fit: cover;
    border: 2.5px solid #ffd60a;
    box-shadow: 0 0 15px rgba(0, 240, 255, 0.9), 0 0 25px rgba(230, 36, 41, 0.8);
}

@keyframes spideyFloatAway {
    0% {
        opacity: 0;
        transform: translate(0, 0) scale(0.4) rotate(0deg);
    }
    15% {
        opacity: 1;
        transform: translate(calc(var(--tx) * 0.25), calc(var(--ty) * 0.25)) scale(var(--scale)) rotate(calc(var(--rot) * 0.25));
    }
    70% {
        opacity: 1;
        transform: translate(calc(var(--tx) + var(--sway)), calc(var(--ty) - 80px)) scale(var(--scale)) rotate(var(--rot));
    }
    100% {
        opacity: 0;
        transform: translate(calc(var(--tx) + (var(--sway) * 2)), calc(var(--ty) - 180px)) scale(calc(var(--scale) * 0.7)) rotate(calc(var(--rot) * 1.5));
    }
}

/* =========================================================
   7-Second Profile Magic Effects & Lighting
========================================================= */
.magic-glow-overlay {
    position: fixed;
    inset: 0;
    pointer-events: none;
    z-index: 9999;
    box-shadow: inset 0 0 100px rgba(230, 36, 41, 0.7), inset 0 0 160px rgba(0, 102, 204, 0.5), inset 0 0 200px rgba(0, 240, 255, 0.4);
    animation: heroAuraPulse 1.2s ease-in-out infinite alternate;
    transition: opacity 0.8s ease;
}

@keyframes heroAuraPulse {
    0% {
        box-shadow: inset 0 0 90px rgba(230, 36, 41, 0.8), inset 0 0 160px rgba(255, 214, 10, 0.6);
        background: radial-gradient(circle at 50% 10%, rgba(230, 36, 41, 0.2), transparent 70%);
    }
    50% {
        box-shadow: inset 0 0 130px rgba(0, 240, 255, 0.8), inset 0 0 190px rgba(0, 102, 204, 0.7);
        background: radial-gradient(circle at 50% 50%, rgba(0, 240, 255, 0.22), transparent 75%);
    }
    100% {
        box-shadow: inset 0 0 110px rgba(255, 214, 10, 0.8), inset 0 0 170px rgba(230, 36, 41, 0.7);
        background: radial-gradient(circle at 50% 90%, rgba(255, 214, 10, 0.2), transparent 70%);
    }
}

.user-avatar-glow.magic-active, #userAvatarGlow.magic-active {
    animation: royalHeroGlow 1.2s ease-in-out infinite alternate !important;
}

@keyframes royalHeroGlow {
    0% {
        transform: scale(1.18) rotate(0deg);
        box-shadow: 0 0 35px #ffd60a, 0 0 60px #e62429, 0 0 90px #00f0ff;
    }
    100% {
        transform: scale(1.26) rotate(6deg);
        box-shadow: 0 0 50px #e62429, 0 0 80px #ffd60a, 0 0 120px #0066cc;
    }
}

.magic-platform-dancing {
    animation: cutePlatformDance 1.4s ease-in-out infinite alternate;
}

@keyframes cutePlatformDance {
    0% { transform: translateY(0) scale(1); }
    50% { transform: translateY(-6px) scale(1.008); }
    100% { transform: translateY(4px) scale(1); }
}

.magic-sparkle-card {
    animation: cardMagicSparkle 1.2s ease-in-out infinite alternate !important;
}

@keyframes cardMagicSparkle {
    0% {
        box-shadow: 0 10px 25px rgba(0, 0, 0, 0.4), 0 0 25px rgba(230, 36, 41, 0.6);
        transform: translateY(-4px);
    }
    100% {
        box-shadow: 0 12px 30px rgba(0, 0, 0, 0.5), 0 0 45px rgba(0, 240, 255, 0.85);
        transform: translateY(-10px) scale(1.03);
    }
}

/* =========================================================
   Toast Notification & Shake
========================================================= */
.toast {
    position: fixed;
    bottom: 35px;
    left: 50%;
    transform: translateX(-50%) translateY(100px);
    background: linear-gradient(135deg, rgba(14, 21, 46, 0.96), rgba(8, 10, 24, 0.98));
    border: 2px solid #ffd60a;
    padding: 14px 28px;
    border-radius: 50px;
    display: flex;
    align-items: center;
    gap: 12px;
    box-shadow: 0 15px 35px rgba(0, 0, 0, 0.7), 0 0 25px rgba(230, 36, 41, 0.6);
    opacity: 0;
    transition: all 0.4s cubic-bezier(0.34, 1.56, 0.64, 1);
    z-index: 10000;
    color: #ffffff;
    font-weight: 800;
    font-size: 1.05rem;
}

.toast.show {
    transform: translateX(-50%) translateY(0);
    opacity: 1;
}

.toast-icon {
    font-size: 22px;
}

@keyframes shake {
    0%, 100% { transform: translateX(0); }
    25% { transform: translateX(-8px); }
    75% { transform: translateX(8px); }
}

.shake {
    animation: shake 0.4s ease-in-out;
}

/* =========================================================
   Footer Copyright
========================================================= */
.footer-copyright {
    text-align: center;
    margin: 25px 0 15px 0;
}

.footer-copyright a {
    color: rgba(255, 255, 255, 0.85);
    text-decoration: none;
    font-size: 0.95rem;
    font-weight: 700;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.7);
    transition: all 0.25s ease;
    padding: 6px 14px;
    border-radius: 20px;
    background: rgba(14, 21, 46, 0.6);
    border: 1px solid rgba(255, 214, 10, 0.3);
}

.footer-copyright a:hover {
    color: var(--accent) !important;
    text-shadow: 0 0 12px rgba(255, 214, 10, 0.9) !important;
    border-color: var(--accent);
    background: rgba(230, 36, 41, 0.4);
}

/* =========================================================
   Responsive Breakpoints
========================================================= */
@media (max-width: 768px) {
    .fairy-header {
        padding: 0.6rem 1rem;
        flex-wrap: wrap;
    }
    .glass-card {
        padding: 30px 20px;
    }
}
