/* =========================================
   Q-BEE OFFICIAL UI THEME
   Premium EdTech Design System
========================================= */

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

/* =========================================
   1. DESIGN TOKENS
========================================= */

:root {
    /* Brand colours */
    --qb-primary: #168FFF;
    --qb-primary-dark: #0752C6;
    --qb-primary-light: #66C7FF;

    --qb-navy: #073B91;

    --qb-text: #123C78;
    --qb-text-muted: #5279B5;

    /* Backgrounds */
    --qb-white: #FFFFFF;
    --qb-background: #F4FAFF;
    --qb-ice: #EAF6FF;

    /* Accent colours */
    --qb-purple: #8957FF;
    --qb-green: #27C98B;
    --qb-orange: #FF9C32;
    --qb-pink: #FF578C;
    --qb-teal: #13C8C2;

    /* Gradients */
    --qb-gradient-primary: linear-gradient(135deg, #168FFF 0%, #66C7FF 100%);
    --qb-gradient-soft: linear-gradient(135deg, #FFFFFF 0%, #EAF6FF 100%);
    --qb-gradient-hero: linear-gradient(115deg, #168FFF 0%, #53B6FF 55%, #9DE2FF 100%);
    --qb-gradient-card: linear-gradient(180deg, #FFFFFF 0%, #F9FCFF 100%);

    /* Borders */
    --qb-border: 1px solid rgba(22, 143, 255, 0.14);
    --qb-border-subtle: 1px solid rgba(200, 225, 255, 0.6);

    /* Shadows */
    --qb-shadow: 0 8px 30px rgba(30, 112, 200, 0.07);
    --qb-shadow-hover: 0 15px 35px rgba(30, 112, 200, 0.15);
    --qb-shadow-button: 0 6px 18px rgba(22, 143, 255, 0.28);
    --qb-shadow-card-3d: 0 12px 28px -6px rgba(22, 143, 255, 0.12), 0 4px 10px rgba(0, 0, 0, 0.03);

    /* Border radius */
    --qb-radius-sm: 12px;
    --qb-radius-md: 18px;
    --qb-radius-lg: 24px;
    --qb-radius-pill: 999px;

    /* Typography */
    --qb-font: 'Nunito', 'Inter', Arial, sans-serif;

    /* Transitions */
    --qb-transition: 0.25s ease;
}

/* =========================================
   2. GLOBAL STYLING
========================================= */

body.qbee-theme,
.qbee-theme {
    font-family: var(--qb-font);
    background: linear-gradient(135deg, #FFFFFF 0%, #F4FAFF 60%, #EDF7FF 100%);
    color: var(--qb-text);
    min-height: 100vh;
    -webkit-font-smoothing: antialiased;
}

.qbee-theme *,
.qbee-theme *::before,
.qbee-theme *::after {
    box-sizing: border-box;
}

.qbee-theme h1,
.qbee-theme h2,
.qbee-theme h3,
.qbee-theme h4 {
    color: var(--qb-navy);
    font-family: var(--qb-font);
    font-weight: 800;
}

.qbee-theme p {
    line-height: 1.6;
}

/* Smooth Links */
.qbee-theme a {
    text-decoration: none;
    transition: color var(--qb-transition);
}

/* =========================================
   3. Q-BEE CARDS
========================================= */

.qb-card,
.qbee-theme .card,
.qbee-theme .card-soft {
    background: var(--qb-white);
    border: var(--qb-border);
    border-radius: var(--qb-radius-lg);
    box-shadow: var(--qb-shadow);
    padding: 22px;
    transition: transform var(--qb-transition), box-shadow var(--qb-transition), border-color var(--qb-transition);
}

.qb-card-interactive:hover,
.qbee-theme .card-3d:hover {
    transform: translateY(-4px);
    box-shadow: var(--qb-shadow-hover);
    border-color: rgba(22, 143, 255, 0.28);
}

.qbee-theme .card-3d {
    background: var(--qb-white);
    border: 1.5px solid rgba(22, 143, 255, 0.16);
    border-top: 2px solid #ffffff;
    border-radius: var(--qb-radius-lg);
    box-shadow: 0 6px 0 rgba(102, 199, 255, 0.25), 0 14px 26px -4px rgba(22, 143, 255, 0.12);
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
    overflow: hidden;
}

.qbee-theme .card-3d:active {
    transform: translateY(3px);
    box-shadow: 0 2px 0 rgba(102, 199, 255, 0.25), 0 6px 12px -2px rgba(22, 143, 255, 0.08);
}

/* =========================================
   4. HERO / WELCOME SECTIONS
========================================= */

.qb-hero,
.qbee-theme .hero {
    position: relative;
    background: var(--qb-gradient-hero);
    border-radius: var(--qb-radius-lg);
    padding: 32px;
    color: white;
    overflow: hidden;
    isolation: isolate;
    box-shadow: 0 14px 34px rgba(22, 143, 255, 0.22);
}

.qb-hero h1,
.qb-hero h2,
.qb-hero p,
.qbee-theme .hero h1,
.qbee-theme .hero h2,
.qbee-theme .hero p {
    color: white;
}

.qb-hero::after,
.qbee-theme .hero::after {
    content: "";
    position: absolute;
    width: 260px;
    height: 260px;
    right: -70px;
    bottom: -130px;
    border-radius: 50%;
    background: radial-gradient(circle, rgba(255,255,255,0.22) 0%, rgba(255,255,255,0) 70%);
    pointer-events: none;
    z-index: -1;
}

/* =========================================
   5. BUTTONS (PRIMARY & SECONDARY)
========================================= */

.qb-btn-primary,
.qbee-theme .primary-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    min-height: 44px;
    padding: 11px 24px;
    border: none;
    border-radius: var(--qb-radius-pill);
    background: var(--qb-gradient-primary);
    color: white !important;
    font-family: var(--qb-font);
    font-weight: 800;
    font-size: 14px;
    cursor: pointer;
    box-shadow: var(--qb-shadow-button);
    transition: transform 0.25s ease, box-shadow 0.25s ease, opacity 0.2s ease;
    text-decoration: none;
}

.qb-btn-primary:hover,
.qbee-theme .primary-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 10px 24px rgba(22, 143, 255, 0.35);
}

.qb-btn-primary:active,
.qbee-theme .primary-btn:active {
    transform: translateY(1px);
    box-shadow: 0 3px 8px rgba(22, 143, 255, 0.25);
}

.qb-btn-secondary,
.qbee-theme .secondary-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    min-height: 44px;
    padding: 11px 24px;
    background: white;
    color: var(--qb-primary-dark) !important;
    border: 1px solid #D5E9FF;
    border-radius: var(--qb-radius-pill);
    font-weight: 800;
    font-size: 14px;
    font-family: var(--qb-font);
    cursor: pointer;
    box-shadow: 0 4px 12px rgba(30, 112, 200, 0.05);
    transition: all 0.25s ease;
    text-decoration: none;
}

.qb-btn-secondary:hover,
.qbee-theme .secondary-btn:hover {
    background: var(--qb-ice);
    border-color: var(--qb-primary);
    transform: translateY(-1px);
    box-shadow: 0 6px 16px rgba(22, 143, 255, 0.12);
}

/* =========================================
   6. FORM INPUTS & SELECTS
========================================= */

.qb-input,
.qb-select,
.qb-textarea,
.qbee-theme input[type="text"],
.qbee-theme input[type="email"],
.qbee-theme input[type="password"],
.qbee-theme input[type="number"],
.qbee-theme input[type="search"],
.qbee-theme select,
.qbee-theme textarea {
    width: 100%;
    min-height: 46px;
    padding: 12px 18px;
    border-radius: 16px;
    border: 1px solid #D8EAFE;
    background: #F8FBFF;
    color: var(--qb-text);
    font-family: var(--qb-font);
    font-size: 14px;
    outline: none;
    transition: border-color 0.25s ease, box-shadow 0.25s ease, background 0.2s ease;
}

.qb-input:focus,
.qb-select:focus,
.qb-textarea:focus,
.qbee-theme input:focus,
.qbee-theme select:focus,
.qbee-theme textarea:focus {
    background: white;
    border-color: var(--qb-primary);
    box-shadow: 0 0 0 4px rgba(22, 143, 255, 0.12);
}

/* =========================================
   7. SUBJECT / FEATURE ICONS
========================================= */

.qb-icon {
    width: 48px;
    height: 48px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 16px;
    color: white;
    font-size: 20px;
    box-shadow: inset 0 1px 2px rgba(255, 255, 255, 0.5), 0 6px 16px rgba(30, 112, 200, 0.16);
    flex-shrink: 0;
}

.qb-icon-blue   { background: linear-gradient(135deg, #66C7FF, #168FFF); }
.qb-icon-purple { background: linear-gradient(135deg, #B08AFF, #7546ED); }
.qb-icon-green  { background: linear-gradient(135deg, #70DF9C, #20B86B); }
.qb-icon-orange { background: linear-gradient(135deg, #FFCB68, #FF8528); }
.qb-icon-pink   { background: linear-gradient(135deg, #FF8BAC, #F73576); }
.qb-icon-teal   { background: linear-gradient(135deg, #52E1DC, #08AFAA); }

/* =========================================
   8. PROGRESS BARS
========================================= */

.qb-progress,
.qbee-theme .progress-track {
    width: 100%;
    height: 8px;
    background: #E4F0FC;
    border-radius: 100px;
    overflow: hidden;
}

.qb-progress-fill,
.qbee-theme .progress-fill {
    height: 100%;
    width: 0;
    border-radius: inherit;
    background: var(--qb-gradient-primary);
    transition: width 0.6s cubic-bezier(0.4, 0, 0.2, 1);
}

/* =========================================
   9. SIDEBAR / NAVIGATION
========================================= */

.qb-sidebar,
.qbee-theme aside {
    background: linear-gradient(180deg, #FFFFFF 0%, #EFF8FF 100%);
    border-right: 1px solid #E0EEFF;
}

.qb-nav-item {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 12px 18px;
    border-radius: 16px;
    color: #4775B5;
    text-decoration: none;
    font-weight: 700;
    font-size: 14px;
    transition: all 0.2s ease;
}

.qb-nav-item:hover {
    background: #EAF5FF;
    color: var(--qb-primary-dark);
    transform: translateX(3px);
}

.qb-nav-item.active {
    background: linear-gradient(110deg, #E4F3FF, #CFE7FF);
    color: var(--qb-primary-dark);
    font-weight: 900;
    box-shadow: 0 4px 12px rgba(22, 143, 255, 0.12);
}

/* =========================================
   10. BADGES
========================================= */

.qb-badge {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 5px 12px;
    border-radius: 100px;
    font-size: 11px;
    font-weight: 800;
}

.qb-badge-success {
    background: #E2F8ED;
    color: #15965A;
    border: 1px solid rgba(39, 201, 139, 0.25);
}

.qb-badge-info {
    background: #E5F3FF;
    color: #0872D9;
    border: 1px solid rgba(22, 143, 255, 0.22);
}

.qb-badge-warning {
    background: #FFF0D9;
    color: #B66500;
    border: 1px solid rgba(255, 156, 50, 0.25);
}

/* =========================================
   11. SPLASH SCREEN STYLES
========================================= */

.qb-splash {
    position: fixed;
    inset: 0;
    z-index: 99999;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    background: radial-gradient(circle at center, #FFFFFF 20%, #EAF6FF 100%);
    transition: opacity 0.6s ease, visibility 0.6s ease;
    overflow: hidden;
}

.qb-splash.hidden-splash {
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
}

.qb-splash-logo-wrap {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
    animation: qbSplashEntrance 1.6s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

@keyframes qbSplashEntrance {
    0% {
        opacity: 0;
        transform: scale(0.82) translateY(18px);
    }
    40% {
        opacity: 1;
        transform: scale(1.02) translateY(-4px);
    }
    70% {
        transform: scale(1) translateY(0);
    }
    100% {
        opacity: 1;
        transform: scale(1) translateY(0);
    }
}

.qb-splash-glow {
    position: absolute;
    width: 450px;
    height: 450px;
    border-radius: 50%;
    background: radial-gradient(circle, rgba(102, 199, 255, 0.35) 0%, rgba(234, 246, 255, 0) 70%);
    pointer-events: none;
    animation: qbPulse 3s ease-in-out infinite;
}

@keyframes qbPulse {
    0%, 100% { transform: scale(1); opacity: 0.6; }
    50% { transform: scale(1.15); opacity: 0.9; }
}

/* =========================================
   12. DECORATIVE MASCOT PLACEMENT SYSTEM
========================================= */

.qb-mascot-slot {
    position: relative;
    display: inline-block;
}

.qb-mascot-placed {
    position: absolute;
    pointer-events: none;
    z-index: 20;
    user-select: none;
    filter: drop-shadow(0 8px 16px rgba(22, 143, 255, 0.18));
}

.qb-pos-top-left      { top: -24px; left: -20px; }
.qb-pos-top-right     { top: -24px; right: -20px; }
.qb-pos-bottom-left   { bottom: -24px; left: -20px; }
.qb-pos-bottom-right  { bottom: -24px; right: -20px; }
.qb-pos-card-corner   { top: -28px; right: 16px; }
.qb-pos-beside-heading { position: relative; top: auto; right: auto; margin-left: 10px; display: inline-block; vertical-align: middle; }
.qb-pos-beside-text   { position: relative; top: auto; right: auto; margin-right: 8px; display: inline-block; vertical-align: middle; }

/* Responsive Adjustments */
@media (max-width: 768px) {
    .qb-card {
        padding: 16px;
        border-radius: 18px;
    }
    .qb-hero {
        padding: 22px;
    }
    .qb-pos-top-left   { top: -14px; left: -10px; }
    .qb-pos-top-right  { top: -14px; right: -10px; }
    .qb-pos-card-corner { top: -18px; right: 8px; }
}

@media (prefers-reduced-motion: reduce) {
    .qbee-theme *,
    .qbee-theme *::before,
    .qbee-theme *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
        scroll-behavior: auto !important;
    }
}
