/* ============================================================
   Geografi LMS - Main Stylesheet
   SMA Dwiwarna Boarding School
   ============================================================ */

/* ---- CSS Custom Properties ---- */
:root {
    --primary: #0D47A1;
    --primary-light: #1565C0;
    --primary-dark: #0a3578;
    --secondary: #1565C0;
    --accent: #26C6DA;
    --accent-light: #4DD0E1;
    --success: #2E7D32;
    --success-light: #43A047;
    --warning: #F57F17;
    --danger: #C62828;
    --bg: #F5F7FA;
    --dark: #263238;
    --sidebar-width: 270px;
    --navbar-height: 64px;
    --border-radius: 12px;
    --border-radius-lg: 20px;
    --shadow: 0 4px 15px rgba(0,0,0,0.08);
    --shadow-lg: 0 10px 40px rgba(0,0,0,0.12);
    --transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    --font-main: 'Segoe UI', system-ui, -apple-system, BlinkMacSystemFont, sans-serif;
}

/* ---- Reset & Base ---- */
*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
    font-family: var(--font-main);
    background-color: var(--bg);
    color: var(--dark);
    line-height: 1.6;
    margin: 0;
    overflow-x: hidden;
}

/* ---- Typography ---- */
h1, h2, h3, h4, h5, h6 { font-weight: 700; line-height: 1.3; }
.text-primary { color: var(--primary) !important; }
.text-accent { color: var(--accent) !important; }
.fw-600 { font-weight: 600; }

/* ============================================================
   LAYOUT
   ============================================================ */
.app-wrapper { display: flex; min-height: 100vh; }

/* ---- Sidebar ---- */
.sidebar {
    width: var(--sidebar-width);
    min-height: 100vh;
    background: linear-gradient(180deg, var(--primary-dark) 0%, var(--primary) 40%, var(--primary-light) 100%);
    position: fixed;
    left: 0; top: 0;
    z-index: 1000;
    display: flex;
    flex-direction: column;
    transition: var(--transition);
    overflow-y: auto;
    overflow-x: hidden;
}
.sidebar::-webkit-scrollbar { width: 4px; }
.sidebar::-webkit-scrollbar-track { background: rgba(255,255,255,0.05); }
.sidebar::-webkit-scrollbar-thumb { background: rgba(255,255,255,0.2); border-radius: 2px; }

.sidebar-header {
    padding: 24px 20px;
    border-bottom: 1px solid rgba(255,255,255,0.1);
    display: flex;
    align-items: center;
    gap: 12px;
}
.sidebar-logo {
    width: 44px; height: 44px;
    border-radius: 50%;
    object-fit: cover;
    border: 2px solid rgba(255,255,255,0.3);
}
.sidebar-brand h6 {
    color: white;
    font-size: 0.9rem;
    font-weight: 700;
    margin: 0;
    line-height: 1.2;
}
.sidebar-brand small {
    color: rgba(255,255,255,0.65);
    font-size: 0.72rem;
}

.sidebar-user {
    padding: 16px 20px;
    background: rgba(255,255,255,0.08);
    margin: 12px;
    border-radius: var(--border-radius);
    display: flex;
    align-items: center;
    gap: 10px;
}
.sidebar-user-avatar {
    width: 38px; height: 38px;
    border-radius: 50%;
    background: rgba(255,255,255,0.2);
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 0.9rem;
    font-weight: 700;
    flex-shrink: 0;
}
.sidebar-user-info span {
    display: block;
    color: white;
    font-size: 0.85rem;
    font-weight: 600;
    line-height: 1.2;
}
.sidebar-user-info small {
    color: rgba(255,255,255,0.6);
    font-size: 0.72rem;
}

.sidebar-nav {
    padding: 8px 12px;
    flex: 1;
}
.nav-section-title {
    color: rgba(255,255,255,0.45);
    font-size: 0.68rem;
    font-weight: 700;
    letter-spacing: 1.5px;
    text-transform: uppercase;
    padding: 12px 10px 4px;
}
.sidebar-nav a {
    display: flex;
    align-items: center;
    gap: 10px;
    color: rgba(255,255,255,0.75);
    text-decoration: none;
    padding: 10px 14px;
    border-radius: 10px;
    margin-bottom: 2px;
    font-size: 0.875rem;
    font-weight: 500;
    transition: var(--transition);
    position: relative;
}
.sidebar-nav a i {
    width: 20px;
    text-align: center;
    font-size: 0.95rem;
    flex-shrink: 0;
}
.sidebar-nav a:hover,
.sidebar-nav a.active {
    background: rgba(255,255,255,0.15);
    color: white;
    transform: translateX(3px);
}
.sidebar-nav a.active::before {
    content: '';
    position: absolute;
    left: 0; top: 50%;
    transform: translateY(-50%);
    width: 4px; height: 60%;
    background: var(--accent);
    border-radius: 0 4px 4px 0;
}
.sidebar-nav .badge-count {
    margin-left: auto;
    background: var(--accent);
    color: var(--dark);
    border-radius: 20px;
    padding: 2px 8px;
    font-size: 0.72rem;
    font-weight: 700;
}

.sidebar-footer {
    padding: 16px 20px;
    border-top: 1px solid rgba(255,255,255,0.1);
    margin-top: auto;
}
.sidebar-footer a {
    display: flex;
    align-items: center;
    gap: 8px;
    color: rgba(255,255,255,0.6);
    text-decoration: none;
    font-size: 0.85rem;
    transition: var(--transition);
    padding: 8px;
    border-radius: 8px;
}
.sidebar-footer a:hover { color: white; background: rgba(255,255,255,0.1); }

/* ---- Main Content Area ---- */
.main-content {
    margin-left: var(--sidebar-width);
    flex: 1;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

/* ---- Top Navbar ---- */
.top-navbar {
    height: var(--navbar-height);
    background: white;
    border-bottom: 1px solid rgba(0,0,0,0.06);
    display: flex;
    align-items: center;
    padding: 0 28px;
    gap: 16px;
    position: sticky;
    top: 0;
    z-index: 100;
    box-shadow: 0 2px 10px rgba(0,0,0,0.06);
}
.navbar-toggle {
    background: none;
    border: none;
    color: #546e7a;
    font-size: 1.2rem;
    cursor: pointer;
    padding: 6px;
    border-radius: 8px;
    transition: var(--transition);
    display: none;
}
.navbar-toggle:hover { background: #f5f7fa; }
.navbar-search {
    flex: 1;
    max-width: 320px;
    position: relative;
}
.navbar-search input {
    width: 100%;
    padding: 8px 16px 8px 38px;
    border: 2px solid #e8eaf6;
    border-radius: 20px;
    font-size: 0.875rem;
    background: #f8f9ff;
    transition: var(--transition);
    outline: none;
    color: var(--dark);
}
.navbar-search input:focus {
    border-color: var(--accent);
    background: white;
    box-shadow: 0 0 0 3px rgba(38,198,218,0.12);
}
.navbar-search i {
    position: absolute;
    left: 12px; top: 50%;
    transform: translateY(-50%);
    color: #9e9e9e;
    font-size: 0.875rem;
}
.navbar-actions {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-left: auto;
}
.navbar-icon-btn {
    width: 38px; height: 38px;
    border-radius: 50%;
    background: #f5f7fa;
    border: none;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #546e7a;
    font-size: 0.95rem;
    cursor: pointer;
    transition: var(--transition);
    position: relative;
    text-decoration: none;
}
.navbar-icon-btn:hover { background: var(--primary); color: white; }
.navbar-icon-btn .notif-badge {
    position: absolute;
    top: -2px; right: -2px;
    background: var(--danger);
    color: white;
    font-size: 0.65rem;
    width: 16px; height: 16px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
}
.navbar-user {
    display: flex;
    align-items: center;
    gap: 10px;
    background: none;
    border: none;
    cursor: pointer;
    padding: 6px 10px;
    border-radius: 10px;
    transition: var(--transition);
    text-decoration: none;
    color: inherit;
}
.navbar-user:hover { background: #f5f7fa; }
.navbar-user-avatar {
    width: 36px; height: 36px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--primary), var(--accent));
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 0.875rem;
    font-weight: 700;
}
.navbar-user-info span {
    display: block;
    font-size: 0.875rem;
    font-weight: 600;
    color: var(--dark);
    line-height: 1.2;
}
.navbar-user-info small {
    color: #9e9e9e;
    font-size: 0.75rem;
}

/* ---- Page Content ---- */
.page-content {
    padding: 28px;
    flex: 1;
}
.page-header {
    margin-bottom: 28px;
}
.page-header h1 {
    font-size: 1.6rem;
    color: var(--dark);
    margin: 0;
}
.page-header p {
    color: #78909c;
    margin: 4px 0 0;
    font-size: 0.9rem;
}
.breadcrumb {
    background: none;
    padding: 0;
    margin-bottom: 6px;
    font-size: 0.8rem;
}
.breadcrumb-item a { color: var(--primary); text-decoration: none; }
.breadcrumb-item.active { color: #78909c; }

/* ============================================================
   CARDS
   ============================================================ */
.card {
    border: none;
    border-radius: var(--border-radius);
    box-shadow: var(--shadow);
    transition: var(--transition);
    background: white;
}
.card:hover { box-shadow: var(--shadow-lg); }
.card-header {
    background: none;
    border-bottom: 1px solid rgba(0,0,0,0.06);
    padding: 18px 22px;
    font-weight: 700;
    font-size: 0.95rem;
    color: var(--dark);
}
.card-body { padding: 22px; }
.card-footer {
    background: none;
    border-top: 1px solid rgba(0,0,0,0.06);
    padding: 14px 22px;
}

/* Stat Cards */
.stat-card {
    border-radius: var(--border-radius);
    padding: 22px;
    display: flex;
    align-items: center;
    gap: 18px;
    color: white;
    position: relative;
    overflow: hidden;
    cursor: default;
    transition: var(--transition);
}
.stat-card::before {
    content: '';
    position: absolute;
    right: -20px; top: -20px;
    width: 100px; height: 100px;
    background: rgba(255,255,255,0.1);
    border-radius: 50%;
}
.stat-card::after {
    content: '';
    position: absolute;
    right: 10px; bottom: -30px;
    width: 80px; height: 80px;
    background: rgba(255,255,255,0.08);
    border-radius: 50%;
}
.stat-card:hover { transform: translateY(-3px); box-shadow: var(--shadow-lg); }
.stat-card-icon {
    width: 56px; height: 56px;
    border-radius: 14px;
    background: rgba(255,255,255,0.2);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.4rem;
    flex-shrink: 0;
    position: relative;
    z-index: 1;
}
.stat-card-info { position: relative; z-index: 1; }
.stat-card-value {
    font-size: 1.8rem;
    font-weight: 800;
    line-height: 1;
    margin-bottom: 4px;
}
.stat-card-label {
    font-size: 0.8rem;
    opacity: 0.85;
    font-weight: 500;
}
.bg-gradient-primary { background: linear-gradient(135deg, #0D47A1, #1976D2); }
.bg-gradient-success { background: linear-gradient(135deg, #2E7D32, #43A047); }
.bg-gradient-accent { background: linear-gradient(135deg, #00838F, #26C6DA); }
.bg-gradient-warning { background: linear-gradient(135deg, #E65100, #FFA726); }
.bg-gradient-purple { background: linear-gradient(135deg, #4527A0, #7E57C2); }
.bg-gradient-info { background: linear-gradient(135deg, #0277BD, #42A5F5); }

/* Module Cards */
.module-card {
    border-radius: var(--border-radius);
    border: 2px solid transparent;
    overflow: hidden;
    transition: var(--transition);
    cursor: pointer;
    background: white;
    box-shadow: var(--shadow);
}
.module-card:hover {
    border-color: var(--accent);
    transform: translateY(-4px);
    box-shadow: var(--shadow-lg);
}
.module-card.completed { border-color: var(--success); }
.module-card.in-progress { border-color: var(--accent); }
.module-card-header {
    padding: 20px;
    position: relative;
    overflow: hidden;
    min-height: 90px;
    display: flex;
    align-items: center;
    gap: 15px;
}
.module-card-icon {
    width: 52px; height: 52px;
    border-radius: 14px;
    background: rgba(255,255,255,0.25);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.4rem;
    color: white;
    flex-shrink: 0;
}
.module-card-title {
    color: white;
    font-size: 0.95rem;
    font-weight: 700;
    line-height: 1.3;
}
.module-card-num {
    color: rgba(255,255,255,0.6);
    font-size: 0.75rem;
    font-weight: 600;
    letter-spacing: 1px;
}
.module-card-body { padding: 16px 20px; }
.module-progress-bar {
    height: 6px;
    border-radius: 3px;
    background: #e8eaf6;
    overflow: hidden;
    margin-bottom: 10px;
}
.module-progress-fill {
    height: 100%;
    border-radius: 3px;
    background: linear-gradient(90deg, var(--primary), var(--accent));
    transition: width 0.8s ease-out;
}
.module-card-meta {
    display: flex;
    justify-content: space-between;
    font-size: 0.78rem;
    color: #78909c;
}
.module-status-badge {
    font-size: 0.72rem;
    padding: 3px 10px;
    border-radius: 20px;
    font-weight: 600;
}

/* ============================================================
   PROGRESS BARS
   ============================================================ */
.progress {
    height: 8px;
    border-radius: 4px;
    background: #e8eaf6;
}
.progress-bar {
    border-radius: 4px;
    transition: width 1s ease-out;
}
.progress-lg { height: 12px; border-radius: 6px; }
.progress-sm { height: 5px; border-radius: 3px; }

/* ============================================================
   BUTTONS
   ============================================================ */
.btn {
    border-radius: 10px;
    font-weight: 600;
    font-size: 0.875rem;
    padding: 9px 20px;
    transition: var(--transition);
    border: none;
    letter-spacing: 0.2px;
}
.btn-primary {
    background: linear-gradient(135deg, var(--primary), var(--primary-light));
    color: white;
}
.btn-primary:hover {
    background: linear-gradient(135deg, var(--primary-dark), var(--primary));
    color: white;
    transform: translateY(-1px);
    box-shadow: 0 6px 15px rgba(13,71,161,0.3);
}
.btn-accent {
    background: linear-gradient(135deg, var(--accent), var(--accent-light));
    color: var(--dark);
}
.btn-accent:hover { transform: translateY(-1px); }
.btn-outline-primary {
    border: 2px solid var(--primary);
    color: var(--primary);
    background: transparent;
}
.btn-outline-primary:hover {
    background: var(--primary);
    color: white;
}
.btn-lg { padding: 12px 28px; font-size: 1rem; border-radius: 12px; }
.btn-sm { padding: 6px 14px; font-size: 0.8rem; border-radius: 8px; }
.btn-icon {
    width: 36px; height: 36px;
    padding: 0;
    border-radius: 10px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

/* ============================================================
   TABLES
   ============================================================ */
.table { margin: 0; }
.table th {
    font-size: 0.78rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.8px;
    color: #78909c;
    border: none;
    background: #f8f9ff;
    padding: 12px 16px;
}
.table td {
    padding: 14px 16px;
    vertical-align: middle;
    border-color: #f0f2f7;
    font-size: 0.875rem;
}
.table-hover tbody tr:hover { background: #f8f9ff; }

/* ============================================================
   BADGES
   ============================================================ */
.badge {
    border-radius: 8px;
    font-size: 0.75rem;
    padding: 4px 10px;
    font-weight: 600;
}

/* ============================================================
   QUIZ / SOAL STYLES
   ============================================================ */
.quiz-container {
    max-width: 800px;
    margin: 0 auto;
}
.question-card {
    background: white;
    border-radius: var(--border-radius-lg);
    padding: 32px;
    box-shadow: var(--shadow);
    margin-bottom: 20px;
}
.question-number {
    font-size: 0.8rem;
    color: var(--accent);
    font-weight: 700;
    letter-spacing: 1px;
    text-transform: uppercase;
    margin-bottom: 12px;
}
.question-text {
    font-size: 1.05rem;
    font-weight: 600;
    color: var(--dark);
    line-height: 1.6;
    margin-bottom: 24px;
}
.options-list { list-style: none; padding: 0; margin: 0; }
.option-item {
    display: flex;
    align-items: flex-start;
    gap: 14px;
    padding: 14px 18px;
    border: 2px solid #e8eaf6;
    border-radius: 12px;
    margin-bottom: 10px;
    cursor: pointer;
    transition: var(--transition);
    background: white;
}
.option-item:hover { border-color: var(--accent); background: #f0faff; }
.option-item.selected { border-color: var(--primary); background: #e8f0fe; }
.option-item.correct { border-color: var(--success); background: #e8f5e9; }
.option-item.wrong { border-color: var(--danger); background: #fce4ec; }
.option-letter {
    width: 32px; height: 32px;
    border-radius: 50%;
    background: #e8eaf6;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 0.875rem;
    flex-shrink: 0;
    color: #546e7a;
}
.option-item.selected .option-letter { background: var(--primary); color: white; }
.option-item.correct .option-letter { background: var(--success); color: white; }
.option-item.wrong .option-letter { background: var(--danger); color: white; }

/* ============================================================
   SIMULATION STYLES
   ============================================================ */
.simulation-container {
    background: #0a0a1a;
    border-radius: var(--border-radius-lg);
    overflow: hidden;
    position: relative;
}
.sim-canvas { width: 100%; display: block; }
.sim-controls {
    background: rgba(0,0,0,0.6);
    padding: 16px 20px;
    backdrop-filter: blur(10px);
}
.sim-label {
    font-size: 0.78rem;
    color: rgba(255,255,255,0.7);
    margin-bottom: 4px;
    font-weight: 600;
}
.sim-value {
    font-size: 1.2rem;
    color: var(--accent);
    font-weight: 700;
}

/* ============================================================
   STEM PROJECT STYLES
   ============================================================ */
.phase-indicator {
    display: flex;
    gap: 0;
    margin-bottom: 30px;
    position: relative;
}
.phase-indicator::before {
    content: '';
    position: absolute;
    top: 20px;
    left: 20px;
    right: 20px;
    height: 2px;
    background: #e8eaf6;
    z-index: 0;
}
.phase-step {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
    position: relative;
    z-index: 1;
}
.phase-circle {
    width: 40px; height: 40px;
    border-radius: 50%;
    background: #e8eaf6;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.9rem;
    color: #9e9e9e;
    font-weight: 700;
    border: 3px solid #e8eaf6;
    transition: var(--transition);
}
.phase-step.active .phase-circle { background: var(--primary); border-color: var(--primary); color: white; }
.phase-step.completed .phase-circle { background: var(--success); border-color: var(--success); color: white; }
.phase-label { font-size: 0.72rem; color: #9e9e9e; text-align: center; font-weight: 600; }
.phase-step.active .phase-label { color: var(--primary); }
.phase-step.completed .phase-label { color: var(--success); }

/* ============================================================
   CHART CONTAINERS
   ============================================================ */
.chart-container {
    position: relative;
    width: 100%;
}
.chart-container canvas { max-width: 100%; }

/* ============================================================
   RESPONSIVE SIDEBAR
   ============================================================ */
@media (max-width: 992px) {
    .sidebar {
        transform: translateX(-100%);
        transition: transform 0.3s ease;
    }
    .sidebar.show { transform: translateX(0); }
    .main-content { margin-left: 0; }
    .navbar-toggle { display: flex; }
    .sidebar-overlay {
        display: none;
        position: fixed;
        inset: 0;
        background: rgba(0,0,0,0.5);
        z-index: 999;
    }
    .sidebar-overlay.show { display: block; }
    .page-content { padding: 16px; }
}
@media (max-width: 576px) {
    .navbar-search { display: none; }
    .stat-card-value { font-size: 1.4rem; }
    .page-content { padding: 12px; }
}

/* ============================================================
   ANIMATIONS
   ============================================================ */
@keyframes fadeIn {
    from { opacity: 0; transform: translateY(10px); }
    to { opacity: 1; transform: translateY(0); }
}
@keyframes slideInLeft {
    from { opacity: 0; transform: translateX(-20px); }
    to { opacity: 1; transform: translateX(0); }
}
@keyframes pulse {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.05); }
}
.animate-fade { animation: fadeIn 0.5s ease-out; }
.animate-slide { animation: slideInLeft 0.4s ease-out; }

/* Loading Spinner */
.spinner-overlay {
    position: fixed;
    inset: 0;
    background: rgba(255,255,255,0.9);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 9999;
    backdrop-filter: blur(4px);
}
.spinner-box {
    text-align: center;
}
.spinner-box .spinner-border {
    width: 48px; height: 48px;
    border-width: 4px;
    color: var(--primary);
    margin-bottom: 12px;
}

/* Scrollbar */
::-webkit-scrollbar { width: 6px; height: 6px; }
::-webkit-scrollbar-track { background: #f0f2f7; }
::-webkit-scrollbar-thumb { background: #c5cae9; border-radius: 3px; }
::-webkit-scrollbar-thumb:hover { background: var(--primary); }

/* Print Styles */
@media print {
    .sidebar, .top-navbar { display: none; }
    .main-content { margin-left: 0; }
    .btn { display: none; }
}
