:root {
    /* Color Palette - PADMA */
    --magenta-primary: #D81B60;
    --magenta-dark: #C2185B;
    --magenta-light: #F48FB1;
    
    --plum-primary: #7B1FA2;
    --plum-dark: #4A148C;
    
    --gold-accent: #FFB300;
    
    /* Light Theme */
    --bg-body: #F8FAFC;
    --bg-glass: rgba(255, 255, 255, 0.7);
    --bg-glass-solid: rgba(255, 255, 255, 0.95);
    --border-glass: rgba(255, 255, 255, 0.5);
    
    --text-main: #0F172A;
    --text-muted: #64748B;
    
    --shadow-sm: 0 4px 6px -1px rgba(0, 0, 0, 0.05), 0 2px 4px -1px rgba(0, 0, 0, 0.03);
    --shadow-md: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
    --shadow-lg: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 10px 10px -5px rgba(0, 0, 0, 0.04);
    --shadow-glow: 0 0 20px rgba(216, 27, 96, 0.3);
}

[data-theme="dark"] {
    --bg-body: #0F172A;
    --bg-glass: rgba(30, 41, 59, 0.7);
    --bg-glass-solid: rgba(30, 41, 59, 0.95);
    --border-glass: rgba(255, 255, 255, 0.1);
    
    --text-main: #F8FAFC;
    --text-muted: #94A3B8;
    
    --shadow-glow: 0 0 20px rgba(216, 27, 96, 0.5);
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Plus Jakarta Sans', sans-serif;
    background-color: var(--bg-body);
    color: var(--text-main);
    line-height: 1.6;
    overflow-x: hidden;
    transition: background-color 0.5s ease, color 0.5s ease;
}

/* Typography */
h1, h2, h3, h4, h5, h6 {
    line-height: 1.2;
    margin-bottom: 0.5em;
}

.font-baloo {
    font-family: 'Baloo 2', cursive;
}

.text-magenta { color: var(--magenta-primary); }
.text-plum { color: var(--plum-primary); }
.text-gold { color: var(--gold-accent); }
.text-danger { color: #EF4444; }
.text-muted { color: var(--text-muted); }
.text-center { text-align: center; }
.mb-2 { margin-bottom: 0.5rem; }
.mb-6 { margin-bottom: 1.5rem; }
.mb-8 { margin-bottom: 2rem; }
.mt-2 { margin-top: 0.5rem; }
.mt-4 { margin-top: 1rem; }
.mt-8 { margin-top: 2rem; }

/* Background Animated Orbs */
.bg-orbs {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    z-index: -1;
    overflow: hidden;
    background: radial-gradient(circle at top left, rgba(216, 27, 96, 0.05), transparent 40%),
                radial-gradient(circle at bottom right, rgba(123, 31, 162, 0.05), transparent 40%);
}

.orb {
    position: absolute;
    border-radius: 50%;
    filter: blur(80px);
    opacity: 0.5;
    animation: float 20s infinite alternate ease-in-out;
}

.orb-1 {
    width: 400px;
    height: 400px;
    background: var(--magenta-light);
    top: -100px;
    right: -100px;
    animation-delay: 0s;
}

.orb-2 {
    width: 500px;
    height: 500px;
    background: var(--plum-primary);
    bottom: -150px;
    left: -150px;
    animation-delay: -5s;
    opacity: 0.3;
}

.orb-3 {
    width: 300px;
    height: 300px;
    background: var(--gold-accent);
    top: 40%;
    left: 40%;
    animation-delay: -10s;
    opacity: 0.2;
}

@keyframes float {
    0% { transform: translate(0, 0) rotate(0deg) scale(1); }
    100% { transform: translate(100px, 150px) rotate(180deg) scale(1.2); }
}

/* Floating Math Symbols */
.floating-math {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: -1;
}

.math-symbol {
    position: absolute;
    font-family: 'Baloo 2', cursive;
    font-weight: bold;
    color: var(--text-main);
    opacity: 0.05;
    user-select: none;
    animation: drift 15s linear infinite;
}

@keyframes drift {
    0% { transform: translateY(110vh) rotate(0deg); }
    100% { transform: translateY(-10vh) rotate(360deg); }
}

/* Views Management */
.app-container {
    position: relative;
    min-height: 100vh;
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 2rem;
}

.view {
    display: none;
    width: 100%;
    animation: fadeScaleIn 0.4s ease forwards;
}

.view.active-view {
    display: block;
}

@keyframes fadeScaleIn {
    0% { opacity: 0; transform: scale(0.95) translateY(10px); }
    100% { opacity: 1; transform: scale(1) translateY(0); }
}

/* Glass Panels */
.glass-panel {
    background: var(--bg-glass);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border: 1px solid var(--border-glass);
    border-radius: 24px;
    box-shadow: var(--shadow-lg);
    padding: 2.5rem;
}

.compact-panel {
    max-width: 480px;
    margin: 0 auto;
    position: relative;
}

.full-panel {
    width: 100%;
    max-width: 1400px;
    height: calc(100vh - 4rem);
    display: flex;
    flex-direction: column;
    padding: 0;
    overflow: hidden;
}

/* Header & Nav */
.app-header {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    padding: 2rem 4rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    z-index: 10;
}

.logo {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    font-size: 1.5rem;
    font-weight: 800;
    color: var(--magenta-primary);
    letter-spacing: -0.5px;
}

.logo-icon {
    width: 32px;
    height: 32px;
    stroke-width: 2.5;
}

.nav-links {
    display: flex;
    align-items: center;
    gap: 2rem;
}

.nav-links a {
    text-decoration: none;
    color: var(--text-main);
    font-weight: 600;
    transition: color 0.2s;
}

.nav-links a:hover {
    color: var(--magenta-primary);
}

/* Buttons */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    padding: 0.75rem 1.5rem;
    border-radius: 12px;
    font-weight: 600;
    font-family: inherit;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    border: none;
    font-size: 1rem;
}

.btn-primary {
    background: linear-gradient(135deg, var(--magenta-primary), var(--magenta-dark));
    color: white;
    box-shadow: 0 4px 15px rgba(216, 27, 96, 0.3);
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(216, 27, 96, 0.4);
}

.btn-outline {
    background: transparent;
    border: 2px solid var(--text-muted);
    color: var(--text-main);
}

.btn-outline:hover {
    border-color: var(--magenta-primary);
    color: var(--magenta-primary);
}

.btn-light {
    background: white;
    color: var(--magenta-primary);
}

.btn-sm { padding: 0.5rem 1rem; font-size: 0.875rem; border-radius: 8px; }
.btn-lg { padding: 1rem 2rem; font-size: 1.125rem; border-radius: 16px; }
.btn-block { width: 100%; }
.btn-icon { padding: 0.5rem; border-radius: 50%; width: 40px; height: 40px; }

.pulse-on-hover:hover {
    animation: pulse 1s infinite;
}

@keyframes pulse {
    0% { transform: scale(1); }
    50% { transform: scale(1.05); }
    100% { transform: scale(1); }
}

/* Landing Page Hero */
#view-landing {
    max-width: 1200px;
    margin: 0 auto;
    padding-top: 5rem;
}

.hero-section {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 4rem;
    align-items: center;
    min-height: 70vh;
}

.hero-content {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
}

.badge {
    background: rgba(255, 179, 0, 0.15);
    color: var(--gold-accent);
    padding: 0.5rem 1rem;
    border-radius: 20px;
    font-size: 0.875rem;
    font-weight: 700;
    margin-bottom: 1.5rem;
    display: inline-block;
    border: 1px solid rgba(255, 179, 0, 0.3);
}

.hero-title {
    font-size: 3.5rem;
    font-weight: 800;
    line-height: 1.1;
    margin-bottom: 1.5rem;
    color: var(--text-main);
}

.highlight-text {
    background: linear-gradient(135deg, var(--magenta-primary), var(--plum-primary));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    display: inline-block;
}

.hero-subtitle {
    font-size: 1.25rem;
    color: var(--text-muted);
    margin-bottom: 3rem;
    max-width: 500px;
}

/* Role Selector Cards */
.role-selector {
    width: 100%;
}

.role-title {
    font-size: 1rem;
    color: var(--text-muted);
    margin-bottom: 1rem;
    text-transform: uppercase;
    letter-spacing: 1px;
    font-weight: 700;
}

.cards-container {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.role-card {
    display: flex;
    align-items: center;
    gap: 1.5rem;
    background: var(--bg-glass);
    border: 1px solid var(--border-glass);
    padding: 1.25rem;
    border-radius: 20px;
    cursor: pointer;
    transition: all 0.3s ease;
    backdrop-filter: blur(10px);
}

.role-card:hover {
    transform: translateX(10px);
    background: var(--bg-glass-solid);
    border-color: var(--magenta-light);
    box-shadow: var(--shadow-md);
}

.card-icon {
    width: 60px;
    height: 60px;
    border-radius: 16px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    transition: transform 0.3s ease;
}

.role-card:hover .card-icon {
    transform: scale(1.1) rotate(5deg);
}

.siswa-icon { background: rgba(216, 27, 96, 0.1); color: var(--magenta-primary); }
.guru-icon { background: rgba(123, 31, 162, 0.1); color: var(--plum-primary); }
.tamu-icon { background: rgba(255, 179, 0, 0.1); color: var(--gold-accent); }

.card-content {
    flex-grow: 1;
}

.card-content h4 {
    font-size: 1.25rem;
    font-weight: 700;
    margin-bottom: 0.25rem;
}

.card-content p {
    font-size: 0.875rem;
    color: var(--text-muted);
}

.card-arrow {
    color: var(--text-muted);
    transition: transform 0.3s, color 0.3s;
}

.role-card:hover .card-arrow {
    transform: translateX(5px);
    color: var(--magenta-primary);
}

/* Hero Visual / Mascot */
.hero-visual {
    position: relative;
    display: flex;
    justify-content: center;
    align-items: center;
}

.mascot-container {
    position: relative;
    z-index: 2;
    transition: transform 0.1s ease-out;
}

.hero-image {
    width: 100%;
    max-width: 500px;
    object-fit: contain;
    filter: drop-shadow(0 20px 30px rgba(0,0,0,0.15));
    animation: float-slow 6s infinite ease-in-out;
    border-radius: 30px;
}

@keyframes float-slow {
    0% { transform: translateY(0); }
    50% { transform: translateY(-20px); }
    100% { transform: translateY(0); }
}

.floating-badge {
    position: absolute;
    background: var(--bg-glass-solid);
    backdrop-filter: blur(10px);
    padding: 0.75rem 1.25rem;
    border-radius: 50px;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-weight: 600;
    font-size: 0.875rem;
    box-shadow: var(--shadow-md);
    border: 1px solid var(--border-glass);
    animation: bounce-float 4s infinite alternate ease-in-out;
}

.floating-badge i { width: 20px; height: 20px; }

.badge-1 { top: 10%; left: -5%; color: var(--magenta-primary); animation-delay: 0s; }
.badge-2 { bottom: 20%; right: -10%; color: var(--plum-primary); animation-delay: 1s; }
.badge-3 { top: 50%; left: -15%; color: var(--gold-accent); animation-delay: 2s; }

@keyframes bounce-float {
    0% { transform: translateY(0) scale(1); }
    100% { transform: translateY(-15px) scale(1.05); }
}

/* Forms & Inputs */
.form-group {
    margin-bottom: 1.5rem;
    text-align: left;
}

.form-group label {
    display: block;
    font-weight: 600;
    margin-bottom: 0.5rem;
    color: var(--text-main);
}

.input-wrapper {
    position: relative;
    display: flex;
    align-items: center;
}

.input-icon {
    position: absolute;
    left: 1rem;
    color: var(--text-muted);
    width: 20px;
    height: 20px;
}

.input-wrapper input {
    width: 100%;
    padding: 1rem 1rem 1rem 3rem;
    border: 2px solid var(--border-glass);
    background: rgba(255, 255, 255, 0.5);
    border-radius: 12px;
    font-size: 1.125rem;
    font-family: inherit;
    font-weight: 600;
    color: var(--text-main);
    transition: all 0.3s;
}

[data-theme="dark"] .input-wrapper input {
    background: rgba(15, 23, 42, 0.5);
}

.input-wrapper input:focus {
    outline: none;
    border-color: var(--magenta-primary);
    background: var(--bg-glass-solid);
    box-shadow: 0 0 0 4px rgba(216, 27, 96, 0.1);
}

.back-btn {
    position: absolute;
    top: 1.5rem;
    left: 1.5rem;
}

.avatar-placeholder {
    width: 96px;
    height: 96px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--magenta-light), var(--plum-primary));
    color: white;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    box-shadow: var(--shadow-md);
}

.bouncing { animation: bouncing 2s infinite ease-in-out; }

@keyframes bouncing {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-10px); }
}

/* Dashboard Layout */
.dashboard-layout {
    display: flex;
    height: 100%;
    background: var(--bg-glass-solid);
    border-radius: inherit;
}

.sidebar {
    width: 280px;
    border-right: 1px solid var(--border-glass);
    padding: 2rem;
    display: flex;
    flex-direction: column;
    background: rgba(255,255,255,0.2);
}

[data-theme="dark"] .sidebar { background: rgba(0,0,0,0.2); }

.sidebar-nav {
    margin-top: 3rem;
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    flex-grow: 1;
}

.sidebar-nav a {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 1rem;
    border-radius: 12px;
    color: var(--text-muted);
    text-decoration: none;
    font-weight: 600;
    transition: all 0.2s;
}

.sidebar-nav a:hover {
    background: rgba(216, 27, 96, 0.05);
    color: var(--magenta-primary);
}

.sidebar-nav a.active {
    background: var(--magenta-primary);
    color: white;
    box-shadow: 0 4px 10px rgba(216, 27, 96, 0.2);
}

.premium-link {
    background: linear-gradient(to right, rgba(255, 179, 0, 0.1), transparent);
    border-left: 3px solid var(--gold-accent);
    color: var(--gold-accent) !important;
}

.user-profile {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 1rem;
    background: var(--bg-glass);
    border-radius: 12px;
    border: 1px solid var(--border-glass);
}

.user-avatar {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: var(--plum-primary);
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: bold;
}

.user-info { display: flex; flex-direction: column; font-size: 0.875rem; }
.user-info strong { color: var(--text-main); }
.user-info span { color: var(--text-muted); font-size: 0.75rem; }

.dashboard-content {
    flex-grow: 1;
    padding: 2rem 3rem;
    overflow-y: auto;
}

.dashboard-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 2rem;
}

.kpi-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 1.5rem;
}

.kpi-card {
    padding: 1.5rem;
}

.kpi-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1rem;
}

.kpi-header h3 {
    font-size: 1rem;
    color: var(--text-muted);
    font-weight: 600;
    margin: 0;
}

.kpi-value {
    font-size: 2.5rem;
    font-weight: 800;
    color: var(--text-main);
    line-height: 1;
    margin-bottom: 0.5rem;
}

.kpi-trend {
    display: flex;
    align-items: center;
    gap: 0.25rem;
    font-size: 0.875rem;
    font-weight: 600;
}

.kpi-trend.positive { color: #10B981; }
.kpi-trend.neutral { color: var(--text-muted); }
.kpi-trend i { width: 16px; height: 16px; }

.highlight-card {
    background: linear-gradient(135deg, rgba(216, 27, 96, 0.1), rgba(123, 31, 162, 0.1));
    border-color: rgba(216, 27, 96, 0.3);
}

/* Data Table */
.data-table {
    width: 100%;
    border-collapse: collapse;
}

.data-table th, .data-table td {
    padding: 1rem 1.5rem;
    text-align: left;
    border-bottom: 1px solid var(--border-glass);
}

.data-table th {
    font-weight: 700;
    color: var(--text-muted);
    text-transform: uppercase;
    font-size: 0.75rem;
    letter-spacing: 1px;
}

.data-table tbody tr { transition: background 0.2s; }
.data-table tbody tr:hover { background: rgba(255, 255, 255, 0.1); }
[data-theme="dark"] .data-table tbody tr:hover { background: rgba(0, 0, 0, 0.2); }

.badge-level {
    padding: 0.25rem 0.75rem;
    border-radius: 20px;
    font-size: 0.75rem;
    font-weight: 700;
}
.level-5 { background: rgba(16, 185, 129, 0.1); color: #10B981; }
.level-3 { background: rgba(245, 158, 11, 0.1); color: #F59E0B; }
.level-2 { background: rgba(239, 68, 68, 0.1); color: #EF4444; }

.status-badge { font-size: 0.875rem; font-weight: 600; display: inline-flex; align-items: center; gap: 0.25rem; }
.status-badge.success::before { content: ''; width: 8px; height: 8px; border-radius: 50%; background: #10B981; }
.status-badge.warning::before { content: ''; width: 8px; height: 8px; border-radius: 50%; background: #F59E0B; }


/* CBT Interface */
.cbt-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1rem 2rem;
    border-radius: 0 0 24px 24px;
    margin-bottom: 3rem;
}

.student-info { display: flex; align-items: center; gap: 1rem; }
.student-avatar { width: 48px; height: 48px; border-radius: 12px; background: var(--magenta-primary); color: white; display: flex; align-items: center; justify-content: center; font-size: 1.25rem; font-weight: bold; }
.student-info div { display: flex; flex-direction: column; }
.student-info strong { font-size: 1.125rem; font-family: 'Baloo 2', cursive; }
.student-info span { font-size: 0.875rem; color: var(--text-muted); }

.progress-container { width: 400px; }
.progress-text { display: flex; justify-content: space-between; font-weight: 600; margin-bottom: 0.5rem; font-size: 0.875rem; }
.progress-bar { height: 12px; background: rgba(0,0,0,0.1); border-radius: 10px; overflow: hidden; }
[data-theme="dark"] .progress-bar { background: rgba(255,255,255,0.1); }
.progress-fill { height: 100%; background: linear-gradient(90deg, var(--magenta-primary), var(--plum-primary)); border-radius: 10px; transition: width 0.5s ease-out; }

.question-card {
    max-width: 800px;
    margin: 0 auto;
}

.question-type-badge {
    display: inline-block;
    background: rgba(123, 31, 162, 0.1);
    color: var(--plum-primary);
    padding: 0.25rem 0.75rem;
    border-radius: 8px;
    font-size: 0.75rem;
    font-weight: 700;
    margin-bottom: 1rem;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.question-text {
    font-size: 1.75rem;
    font-weight: 700;
    margin-bottom: 2rem;
    line-height: 1.4;
}

.options-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1rem;
    margin-bottom: 2rem;
}

.option-card {
    position: relative;
    cursor: pointer;
}

.option-card input {
    position: absolute;
    opacity: 0;
    cursor: pointer;
}

.option-content {
    display: flex;
    align-items: center;
    padding: 1.25rem;
    background: rgba(255, 255, 255, 0.5);
    border: 2px solid var(--border-glass);
    border-radius: 16px;
    transition: all 0.2s;
}

[data-theme="dark"] .option-content { background: rgba(15, 23, 42, 0.5); }

.option-letter {
    width: 32px;
    height: 32px;
    border-radius: 8px;
    background: var(--bg-glass);
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    margin-right: 1rem;
    color: var(--text-muted);
}

.option-text {
    font-size: 1.125rem;
    font-weight: 600;
}

.option-card:hover .option-content {
    border-color: var(--magenta-light);
    transform: translateY(-2px);
}

.option-card input:checked ~ .option-content {
    border-color: var(--magenta-primary);
    background: rgba(216, 27, 96, 0.05);
    box-shadow: 0 4px 15px rgba(216, 27, 96, 0.1);
}

.option-card input:checked ~ .option-content .option-letter {
    background: var(--magenta-primary);
    color: white;
}

.cbt-actions {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: 2rem;
    padding-top: 2rem;
    border-top: 1px solid var(--border-glass);
}

.pop-in {
    animation: popIn 0.5s cubic-bezier(0.175, 0.885, 0.32, 1.275) forwards;
}

@keyframes popIn {
    0% { opacity: 0; transform: scale(0.9); }
    100% { opacity: 1; transform: scale(1); }
}

/* Victory Screen Stats */
.stats-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1rem;
}

.stat-box {
    padding: 1.5rem;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
}

.stat-box i { width: 32px; height: 32px; }
.stat-box strong { font-size: 1.5rem; font-family: 'Baloo 2', cursive; }

/* Responsive adjustments */
@media (max-width: 992px) {
    .hero-section { grid-template-columns: 1fr; text-align: center; gap: 2rem; }
    .hero-content { align-items: center; }
    .hero-subtitle { margin: 0 auto 2rem; }
    .floating-badge { display: none; } /* Hide on smaller screens for cleaner look */
    
    .dashboard-layout { flex-direction: column; }
    .sidebar { width: 100%; border-right: none; border-bottom: 1px solid var(--border-glass); padding: 1rem; flex-direction: row; justify-content: space-between; align-items: center; }
    .sidebar-nav { flex-direction: row; margin-top: 0; }
    .user-profile { display: none; }
}

@media (max-width: 768px) {
    .options-grid { grid-template-columns: 1fr; }
    .kpi-grid { grid-template-columns: 1fr; }
}
