/* ==========================================================================
   PORTAL DESIGN SYSTEM v3
   STEMulus — Blob + Standalone 3D Object Architecture
   Reference: videotemp.mp4 layout
   ========================================================================== */

@import url('https://fonts.googleapis.com/css2?family=Fredoka+One&family=Nunito:wght@400;600;700;800&family=JetBrains+Mono&display=swap');

:root {
    --brand-orange: #F4600C;
    --brand-indigo: #4B49AC;

    --stage-parent-1: #4FC3F7;
    --stage-parent-2: #66BB6A;
    --stage-tutor-1: #AB47BC;
    --stage-tutor-2: #5C6BC0;
    --stage-admin-1: #26A69A;
    --stage-admin-2: #EC407A;

    --bg-page: #ECECEC;
    --surface-white: #FFFFFF;
    --text-main: #1A2332;
    --text-muted: #64748B;
    --text-light: #94A3B8;
    --border-soft: #E2E8F0;

    --status-green: #48BB78;
    --status-amber: #ECC94B;
    --status-red: #F56565;

    --shadow-shell: 0 25px 60px -15px rgba(0, 0, 0, 0.12),
                    0 10px 20px -5px rgba(0, 0, 0, 0.06);
    --shadow-float: 0 15px 35px -8px rgba(0, 0, 0, 0.2);
    --shadow-card: 0 4px 16px rgba(0, 0, 0, 0.04);
    --shadow-btn: 0 8px 16px rgba(0, 0, 0, 0.1), inset 0 -4px 0 rgba(0, 0, 0, 0.15);

    --radius-shell: 32px;
    --radius-card: 20px;
    --radius-pill: 40px;
    --radius-btn: 16px;
}

/* ==========================================================================
   BASE
   ========================================================================== */
* { box-sizing: border-box; }

body {
    font-family: 'Nunito', sans-serif;
    background-color: var(--bg-page);
    color: var(--text-main);
    margin: 0;
    padding: 0;
    -webkit-font-smoothing: antialiased;
}

h1, h2, h3, h4 { font-weight: 800; color: var(--text-main); margin-top: 0; }
.blob-headline {
    font-family: 'Fredoka One', cursive;
    font-weight: normal;
    color: white;
    line-height: 1.15;
    text-shadow: 0 4px 20px rgba(0, 0, 0, 0.2);
}

/* ==========================================================================
   LOGIN SHELL (Videotemp Split Layout)
   ========================================================================== */
.portal-container {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 100vh;
    padding: 2rem;
    background: var(--bg-page);
}

.portal-shell {
    display: flex;
    width: 100%;
    max-width: 1200px;
    min-height: 680px;
    background: var(--surface-white);
    border-radius: var(--radius-shell);
    box-shadow: var(--shadow-shell);
    position: relative;
    overflow: visible;
}

/* ==========================================================================
   BLOB PANEL (Left 40%)
   ========================================================================== */
.blob-panel {
    flex: 0 0 42%;
    position: relative;
    padding: 3rem 2.5rem;
    display: flex;
    flex-direction: column;
    justify-content: center;
    overflow: visible;
    z-index: 1;
    border-radius: var(--radius-shell) 0 0 var(--radius-shell);
}

.blob-bg {
    position: absolute;
    top: 0;
    left: 0;
    bottom: 0;
    width: 115%;
    background: linear-gradient(135deg, var(--stage-parent-1), var(--stage-parent-2));
    border-radius: 0 48% 52% 0 / 0 42% 58% 0;
    z-index: -1;
    transition: background 0.6s cubic-bezier(0.4, 0, 0.2, 1);
}

.blob-panel .blob-headline {
    position: relative;
    z-index: 5;
    font-size: 2.2rem;
    margin-bottom: 0.5rem;
}

.blob-panel .blob-subtitle {
    position: relative;
    z-index: 5;
    color: rgba(255, 255, 255, 0.85);
    font-size: 0.95rem;
    font-weight: 600;
}

/* ==========================================================================
   HERO 3D OBJECT (Breaks boundary — the videotemp "pop")
   ========================================================================== */
.hero-3d-object {
    position: absolute;
    right: -20%;
    top: 50%;
    transform: translateY(-50%);
    width: 270px;
    height: 270px;
    object-fit: contain;
    z-index: 10;
    filter: drop-shadow(0 20px 40px rgba(0, 0, 0, 0.22));
    transition: opacity 0.5s cubic-bezier(0.16, 1, 0.3, 1),
                transform 0.5s cubic-bezier(0.16, 1, 0.3, 1);
    pointer-events: none;
}

.hero-3d-object.switching {
    opacity: 0;
    transform: translateY(-50%) scale(0.8);
}

/* ==========================================================================
   FLOATING ACCENTS (Blurred decorative elements)
   ========================================================================== */
.float-accent {
    position: absolute;
    pointer-events: none;
    object-fit: contain;
    z-index: 6;
}

.float-accent--sm { width: 36px; height: 36px; }
.float-accent--md { width: 52px; height: 52px; }
.float-accent--lg { width: 70px; height: 70px; }

.float-accent--blur {
    filter: blur(2.5px);
    opacity: 0.55;
}

.float-accent--soft {
    filter: blur(4px);
    opacity: 0.35;
}

/* CSS-only abstract shapes (matches videotemp's bean/pill shapes) */
.accent-bean {
    position: absolute;
    width: 40px;
    height: 22px;
    background: rgba(255, 255, 255, 0.7);
    border-radius: 50%;
    filter: blur(1px);
    pointer-events: none;
    z-index: 6;
}

.accent-sphere {
    position: absolute;
    width: 30px;
    height: 30px;
    border-radius: 50%;
    background: radial-gradient(circle at 35% 35%, rgba(255, 200, 150, 0.8), rgba(244, 96, 12, 0.4));
    filter: blur(3px);
    pointer-events: none;
    z-index: 6;
}

.accent-sphere--pink {
    background: radial-gradient(circle at 35% 35%, rgba(255, 180, 220, 0.8), rgba(171, 71, 188, 0.4));
}

.accent-sphere--teal {
    background: radial-gradient(circle at 35% 35%, rgba(150, 230, 220, 0.8), rgba(38, 166, 154, 0.4));
}

/* ==========================================================================
   DATA PANEL (Right 60%)
   ========================================================================== */
.data-panel {
    flex: 1;
    padding: 3rem;
    display: flex;
    flex-direction: column;
    justify-content: center;
    background: var(--surface-white);
    border-radius: 0 var(--radius-shell) var(--radius-shell) 0;
    position: relative;
    z-index: 5;
}

/* ==========================================================================
   PILL TOOLBAR (Floating bottom bar — videotemp style)
   ========================================================================== */
.pill-toolbar {
    position: fixed;
    bottom: 1.5rem;
    left: 50%;
    transform: translateX(-50%);
    background: var(--surface-white);
    padding: 0.5rem 1.25rem;
    border-radius: var(--radius-pill);
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.12), 0 2px 8px rgba(0, 0, 0, 0.06);
    display: flex;
    gap: 0.5rem;
    z-index: 100;
    border: 1px solid var(--border-soft);
}

.blob-pill-nav {
    position: absolute !important;
    bottom: 2rem !important;
    left: 42% !important;
    transform: translateX(-50%) !important;
    z-index: 20 !important;
    margin: 0 !important;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.15) !important;
}

@media (max-width: 960px) {
    .blob-pill-nav {
        position: fixed !important;
        bottom: 1.5rem !important;
        left: 50% !important;
        transform: translateX(-50%) !important;
        z-index: 100 !important;
    }
}

.toolbar-btn {
    width: 42px;
    height: 42px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    border: none;
    background: transparent;
    cursor: pointer;
    color: var(--text-muted);
    transition: all 0.2s ease;
    font-size: 0;
}

.toolbar-btn:hover {
    background: #F1F5F9;
    color: var(--brand-indigo);
}

.toolbar-btn.active {
    background: var(--brand-indigo);
    color: white;
    box-shadow: inset 0 -3px 0 rgba(0, 0, 0, 0.15);
}

/* ==========================================================================
   DASHBOARD: HERO BAND (Horizontal blob for dashboard pages)
   ========================================================================== */
.hero-band {
    position: relative;
    width: 100%;
    padding: 2.5rem 3rem;
    min-height: 200px;
    border-radius: 0 0 24px 24px;
    overflow: visible;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 2rem;
}

.hero-band-content {
    flex: 1;
    z-index: 2;
}

.hero-band-content h1 {
    font-family: 'Fredoka One', cursive;
    color: white;
    font-size: 1.75rem;
    margin-bottom: 0.5rem;
    text-shadow: 0 2px 10px rgba(0, 0, 0, 0.15);
}

.hero-band-content p {
    color: rgba(255, 255, 255, 0.85);
    font-size: 0.9rem;
    font-weight: 600;
    margin: 0;
}

.hero-band .hero-3d-object {
    position: relative;
    right: auto;
    top: auto;
    transform: translateY(20px);
    width: 180px;
    height: 180px;
    flex-shrink: 0;
}

.hero-band .float-accent {
    z-index: 1;
}

/* KPI Pills (inline in hero band) */
.kpi-pills {
    display: flex;
    gap: 0.75rem;
    margin-top: 1rem;
    flex-wrap: wrap;
}

.kpi-pill {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    padding: 0.4rem 0.85rem;
    background: rgba(255, 255, 255, 0.2);
    backdrop-filter: blur(8px);
    border: 1px solid rgba(255, 255, 255, 0.25);
    border-radius: 20px;
    color: white;
    font-size: 0.8rem;
    font-weight: 700;
}

/* ==========================================================================
   DATA SECTIONS (Dashboard content areas)
   ========================================================================== */
.data-section {
    background: var(--surface-white);
    border-radius: var(--radius-card);
    padding: 2rem;
    margin-bottom: 1.5rem;
    border: 1px solid var(--border-soft);
    box-shadow: var(--shadow-card);
}

.data-section-title {
    font-size: 1.1rem;
    font-weight: 800;
    margin-bottom: 1.25rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.data-section-title img {
    width: 28px;
    height: 28px;
    object-fit: contain;
}

/* ==========================================================================
   KPI GRID (4-column metric cards)
   ========================================================================== */
.kpi-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 1rem;
    margin-bottom: 2rem;
}

.kpi-card {
    background: #F8FAFC;
    border-radius: 16px;
    padding: 1.25rem;
    display: flex;
    align-items: center;
    gap: 1rem;
    border: 1px solid var(--border-soft);
    transition: transform 0.2s, box-shadow 0.2s;
}

.kpi-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.06);
}

.kpi-icon {
    width: 48px;
    height: 48px;
    object-fit: contain;
    flex-shrink: 0;
}

.kpi-number {
    font-size: 1.75rem;
    font-weight: 800;
    color: var(--text-main);
    line-height: 1;
}

.kpi-label {
    font-size: 0.7rem;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.05em;
    font-weight: 700;
    margin-top: 0.2rem;
}

/* ==========================================================================
   SECTION BREAK (inline 3D icon + lines)
   ========================================================================== */
.section-break {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 1.5rem 0;
}

.section-break::before,
.section-break::after {
    content: '';
    flex: 1;
    height: 1px;
    background: var(--border-soft);
}

.section-break img {
    width: 48px;
    height: 48px;
    object-fit: contain;
    opacity: 0.75;
}

/* ==========================================================================
   VIDEO BACKDROP (Ambient video sections)
   ========================================================================== */
.video-backdrop {
    position: relative;
    width: 100%;
    height: 220px;
    overflow: hidden;
    border-radius: var(--radius-card);
    margin: 1.5rem 0;
    background: linear-gradient(135deg, #1A2332 0%, #4B49AC 100%);
}

.video-backdrop video {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    z-index: 1;
}

.video-overlay {
    position: relative;
    z-index: 2;
    padding: 2.5rem;
    background: linear-gradient(to right, rgba(0, 0, 0, 0.75) 50%, rgba(0, 0, 0, 0.25));
    height: 100%;
    display: flex;
    flex-direction: column;
    justify-content: center;
    color: white;
}

.video-overlay h3 {
    color: white;
    font-size: 1.3rem;
    margin-bottom: 0.5rem;
}

.video-overlay p {
    color: rgba(255, 255, 255, 0.8);
    font-size: 0.9rem;
}

/* ==========================================================================
   DATA ROWS (Clean lists)
   ========================================================================== */
.data-row {
    display: flex;
    align-items: center;
    padding: 1rem 1.25rem;
    border-radius: 14px;
    transition: background 0.2s;
    margin-bottom: 0.4rem;
    gap: 1rem;
}

.data-row:hover { background: #F8FAFC; }

.avatar-circle {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: linear-gradient(135deg, #F1F5F9, #E2E8F0);
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 0.85rem;
    color: var(--brand-indigo);
    flex-shrink: 0;
}

/* ==========================================================================
   BUTTONS
   ========================================================================== */
.btn-3d {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    padding: 0.75rem 1.5rem;
    border-radius: var(--radius-btn);
    font-family: 'Nunito', sans-serif;
    font-weight: 700;
    font-size: 0.9rem;
    text-decoration: none;
    border: none;
    cursor: pointer;
    box-shadow: var(--shadow-btn);
    transition: all 0.15s ease;
}

.btn-3d:active {
    transform: translateY(3px);
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1), inset 0 -2px 0 rgba(0, 0, 0, 0.15);
}

.btn-3d.brand { background-color: var(--brand-indigo); color: white; }
.btn-3d.orange { background-color: var(--brand-orange); color: white; }
.btn-3d.green { background-color: var(--status-green); color: white; }
.btn-3d.teal { background-color: var(--stage-admin-1); color: white; }

/* ==========================================================================
   STATUS CUBES (Attendance badges)
   ========================================================================== */
.attendance-cube {
    display: inline-flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    width: 72px;
    height: 80px;
    border-radius: 20px;
    color: white;
    font-weight: 800;
    box-shadow: 0 8px 16px rgba(0, 0, 0, 0.12), inset -3px -6px 0 rgba(0, 0, 0, 0.1);
    cursor: pointer;
    border: none;
    text-align: center;
    transition: transform 0.15s ease;
}

.attendance-cube:active { transform: translateY(3px) scale(0.97); }

.cube-green { background: linear-gradient(145deg, #48BB78, #38A169); }
.cube-red { background: linear-gradient(145deg, #F56565, #E53E3E); }
.cube-amber { background: linear-gradient(145deg, #ECC94B, #D69E2E); }

.cube-icon { font-size: 22px; margin-bottom: 3px; }
.cube-label { font-size: 10px; text-transform: uppercase; letter-spacing: 0.5px; opacity: 0.9; }

/* ==========================================================================
   STAGE BADGES
   ========================================================================== */
.stage-badge {
    padding: 4px 10px;
    border-radius: 12px;
    font-size: 11px;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: white;
    display: inline-block;
}

/* ==========================================================================
   EMPTY STATES
   ========================================================================== */
.empty-state {
    text-align: center;
    padding: 3rem 2rem;
}

.empty-state img {
    width: 120px;
    height: 120px;
    object-fit: contain;
    margin: 0 auto 1.5rem;
    opacity: 0.85;
}

.empty-state p {
    color: var(--text-muted);
    font-weight: 600;
    margin-bottom: 1rem;
}

/* ==========================================================================
   RESPONSIVE
   ========================================================================== */
@media (max-width: 900px) {
    .portal-shell {
        flex-direction: column;
        border-radius: 0;
        min-height: 100vh;
        max-width: 100%;
    }

    .blob-panel {
        flex: 0 0 auto;
        min-height: 280px;
        border-radius: 0;
        padding: 2.5rem 2rem;
        text-align: center;
        align-items: center;
    }

    .blob-bg {
        width: 100%;
        border-radius: 0 0 40% 40% / 0 0 25% 25%;
    }

    .hero-3d-object {
        position: relative;
        right: auto;
        top: auto;
        transform: none;
        width: 180px;
        height: 180px;
        margin: 1rem auto 0;
    }

    .data-panel {
        border-radius: 24px 24px 0 0;
        margin-top: -24px;
        z-index: 10;
        padding: 2.5rem 1.5rem;
    }

    .pill-toolbar {
        position: fixed;
        bottom: 1rem;
    }

    .hero-band {
        flex-direction: column;
        text-align: center;
        padding: 2rem 1.5rem;
        min-height: 160px;
    }

    .hero-band .hero-3d-object {
        width: 130px;
        height: 130px;
        transform: none;
    }

    .kpi-grid { grid-template-columns: repeat(2, 1fr); }
    .kpi-pills { justify-content: center; }
}

@media (max-width: 480px) {
    .portal-container { padding: 0; }
    .blob-panel { min-height: 240px; padding: 2rem 1.5rem; }
    .blob-headline { font-size: 1.7rem; }
    .hero-3d-object { width: 150px; height: 150px; }
    .data-panel { padding: 2rem 1.25rem; }
    .kpi-grid { grid-template-columns: 1fr; }
    .hero-band .hero-3d-object { width: 100px; height: 100px; }
}
