/* ============================================
   SCOLA DESA - Tema "Kartu Besar"
   Filosofi: Jangan buat mereka berpikir
   ============================================ */

:root {
    /* Warna Utama */
    --primary-blue: #2563eb;
    --primary-green: #16a34a;
    --primary-yellow: #eab308;
    --primary-red: #dc2626;
    --primary-purple: #7c3aed;

    /* Warna Background */
    --bg-light: #f8fafc;
    --bg-card: #ffffff;
    --bg-dark: #1e293b;

    /* Warna Text */
    --text-primary: #1e293b;
    --text-secondary: #64748b;
    --text-light: #ffffff;

    /* Spacing */
    --space-xs: 0.5rem;
    --space-sm: 1rem;
    --space-md: 1.5rem;
    --space-lg: 2rem;
    --space-xl: 3rem;

    /* Border Radius */
    --radius-sm: 8px;
    --radius-md: 12px;
    --radius-lg: 20px;
    --radius-full: 50%;

    /* Shadow */
    --shadow-sm: 0 1px 3px rgba(0, 0, 0, 0.1);
    --shadow-md: 0 4px 12px rgba(0, 0, 0, 0.15);
    --shadow-lg: 0 8px 24px rgba(0, 0, 0, 0.2);

    /* Font */
    --font-base: 18px;
    --font-lg: 22px;
    --font-xl: 28px;
    --font-2xl: 36px;
}

/* Reset & Base */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

/* Alpine.js cloak - hide until ready */
[x-cloak] {
    display: none !important;
}

/* Utility: Text Colors */
.text-danger {
    color: #dc2626 !important;
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    font-size: var(--font-base);
    line-height: 1.6;
    background: var(--bg-light);
    color: var(--text-primary);
    min-height: 100vh;
}

/* ============================================
   LAYOUT
   ============================================ */

.container {
    max-width: 800px;
    margin: 0 auto;
    padding: var(--space-sm);
}

.page {
    min-height: 100vh;
    padding-bottom: var(--space-xl);
}

/* ============================================
   HEADER
   ============================================ */

.header {
    background: linear-gradient(135deg, var(--primary-blue), #1d4ed8);
    color: var(--text-light);
    padding: var(--space-md);
    position: sticky;
    top: 0;
    z-index: 100;
    box-shadow: var(--shadow-md);
}

.header--siswa {
    background: linear-gradient(135deg, var(--primary-green), #15803d);
}

.header__title {
    font-size: var(--font-xl);
    font-weight: 700;
    text-align: center;
}

.header__subtitle {
    font-size: var(--font-base);
    text-align: center;
    opacity: 0.9;
}

.header__back {
    display: flex;
    align-items: center;
    gap: var(--space-xs);
    color: var(--text-light);
    text-decoration: none;
    font-size: var(--font-lg);
    margin-bottom: var(--space-xs);
}

.header__back:hover {
    opacity: 0.8;
}

/* ============================================
   TOMBOL RAKSASA (Dashboard Guru)
   ============================================ */

.menu-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: var(--space-md);
    padding: var(--space-md);
}

.menu-card {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: var(--space-lg);
    border-radius: var(--radius-lg);
    text-decoration: none;
    color: var(--text-light);
    min-height: 140px;
    box-shadow: var(--shadow-md);
    transition: transform 0.2s, box-shadow 0.2s;
    cursor: pointer;
    border: none;
    font-family: inherit;
    width: 100%;
}

.menu-card:hover {
    transform: translateY(-4px);
    box-shadow: var(--shadow-lg);
}

.menu-card:active {
    transform: translateY(0);
}

.menu-card--blue {
    background: linear-gradient(135deg, #3b82f6, #1d4ed8);
}

.menu-card--green {
    background: linear-gradient(135deg, #22c55e, #16a34a);
}

.menu-card--yellow {
    background: linear-gradient(135deg, #facc15, #ca8a04);
    color: var(--text-primary);
}

.menu-card--red {
    background: linear-gradient(135deg, #f87171, #dc2626);
}

.menu-card--purple {
    background: linear-gradient(135deg, #a78bfa, #7c3aed);
}

.menu-card__icon {
    font-size: 48px;
    margin-bottom: var(--space-xs);
}

.menu-card__label {
    font-size: var(--font-lg);
    font-weight: 600;
    text-align: center;
}

/* ============================================
   KARTU INFO (Jadwal, Materi, dll)
   ============================================ */

.info-card {
    background: var(--bg-card);
    border-radius: var(--radius-md);
    padding: var(--space-md);
    margin-bottom: var(--space-sm);
    box-shadow: var(--shadow-sm);
    border-left: 4px solid var(--primary-blue);
}

.info-card--warning {
    border-left-color: var(--primary-yellow);
    background: #fefce8;
}

.info-card--success {
    border-left-color: var(--primary-green);
    background: #f0fdf4;
}

.info-card--danger {
    border-left-color: var(--primary-red);
    background: #fef2f2;
}

.info-card__title {
    font-size: var(--font-lg);
    font-weight: 600;
    margin-bottom: var(--space-xs);
}

.info-card__text {
    color: var(--text-secondary);
}

.info-card__meta {
    display: flex;
    gap: var(--space-sm);
    margin-top: var(--space-xs);
    font-size: 14px;
    color: var(--text-secondary);
}

/* ============================================
   FORM ELEMENTS (Besar & Ramah Lansia)
   ============================================ */

.form-group {
    margin-bottom: var(--space-md);
}

.form-label {
    display: block;
    font-size: var(--font-lg);
    font-weight: 600;
    margin-bottom: var(--space-xs);
    color: var(--text-primary);
}

.form-label__hint {
    font-weight: 400;
    font-size: var(--font-base);
    color: var(--text-secondary);
}

.form-input,
.form-select,
.form-textarea {
    width: 100%;
    padding: var(--space-sm);
    font-size: var(--font-base);
    border: 2px solid #e2e8f0;
    border-radius: var(--radius-sm);
    background: var(--bg-card);
    transition: border-color 0.2s;
}

.form-input:focus,
.form-select:focus,
.form-textarea:focus {
    outline: none;
    border-color: var(--primary-blue);
}

.form-textarea {
    min-height: 150px;
    resize: vertical;
}

.form-select {
    cursor: pointer;
}

/* ============================================
   FILE UPLOAD (Visual Besar)
   ============================================ */

.file-upload {
    border: 3px dashed #cbd5e1;
    border-radius: var(--radius-md);
    padding: var(--space-lg);
    text-align: center;
    cursor: pointer;
    transition: border-color 0.2s, background 0.2s;
}

.file-upload:hover {
    border-color: var(--primary-blue);
    background: #f1f5f9;
}

.file-upload--active {
    border-color: var(--primary-green);
    background: #f0fdf4;
}

.file-upload__icon {
    font-size: 64px;
    margin-bottom: var(--space-sm);
}

.file-upload__text {
    font-size: var(--font-lg);
    font-weight: 600;
    color: var(--text-primary);
}

.file-upload__hint {
    color: var(--text-secondary);
    margin-top: var(--space-xs);
}

.file-upload input[type="file"] {
    display: none;
}

.file-preview {
    display: flex;
    flex-wrap: wrap;
    gap: var(--space-sm);
    margin-top: var(--space-sm);
}

.file-preview__item {
    display: flex;
    align-items: center;
    gap: var(--space-xs);
    padding: var(--space-xs) var(--space-sm);
    background: #e0f2fe;
    border-radius: var(--radius-sm);
    font-size: 14px;
}

.file-preview__remove {
    background: none;
    border: none;
    color: var(--primary-red);
    cursor: pointer;
    font-size: 18px;
    padding: 0;
}

/* ============================================
   BUTTONS (Besar & Jelas)
   ============================================ */

.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: var(--space-xs);
    padding: var(--space-sm) var(--space-lg);
    font-size: var(--font-lg);
    font-weight: 600;
    border: none;
    border-radius: var(--radius-md);
    cursor: pointer;
    transition: transform 0.2s, box-shadow 0.2s;
    text-decoration: none;
    min-height: 56px;
}

.btn:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
}

.btn:active {
    transform: translateY(0);
}

.btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
    transform: none;
}

.btn--primary {
    background: var(--primary-blue);
    color: var(--text-light);
}

.btn--success {
    background: var(--primary-green);
    color: var(--text-light);
}

.btn--warning {
    background: var(--primary-yellow);
    color: var(--text-primary);
}

.btn--danger {
    background: var(--primary-red);
    color: var(--text-light);
}

.btn--whatsapp {
    background: #25d366;
    color: var(--text-light);
}

.btn--outline {
    background: transparent;
    border: 2px solid var(--primary-blue);
    color: var(--primary-blue);
}

.btn--block {
    width: 100%;
}

.btn--lg {
    padding: var(--space-md) var(--space-xl);
    font-size: var(--font-xl);
    min-height: 72px;
}

/* ============================================
   WIZARD STEPS (Langkah-langkah)
   ============================================ */

.wizard {
    background: var(--bg-card);
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.06);
    border: 1px solid #e2e8f0;
}

.wizard__header {
    background: #f1f5f9;
    padding: var(--space-md);
    display: flex;
    justify-content: center;
    gap: var(--space-sm);
}

.wizard__step {
    display: flex;
    align-items: center;
    gap: var(--space-xs);
    color: var(--text-secondary);
}

.wizard__step--active {
    color: var(--primary-blue);
    font-weight: 600;
}

.wizard__step--done {
    color: var(--primary-green);
}

.wizard__number {
    width: 32px;
    height: 32px;
    border-radius: var(--radius-full);
    background: #e2e8f0;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 600;
}

.wizard__step--active .wizard__number {
    background: var(--primary-blue);
    color: var(--text-light);
}

.wizard__step--done .wizard__number {
    background: var(--primary-green);
    color: var(--text-light);
}

.wizard__body {
    padding: var(--space-lg);
}

.wizard__footer {
    padding: var(--space-md);
    display: flex;
    gap: var(--space-sm);
    justify-content: space-between;
    border-top: 1px solid #e2e8f0;
}

/* ============================================
   TIMELINE / FEED (Siswa)
   ============================================ */

.feed {
    padding: var(--space-sm);
}

.feed__item {
    background: var(--bg-card);
    border-radius: var(--radius-md);
    padding: var(--space-md);
    margin-bottom: var(--space-sm);
    box-shadow: var(--shadow-sm);
    display: flex;
    gap: var(--space-md);
}

.feed__icon {
    width: 48px;
    height: 48px;
    border-radius: var(--radius-sm);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 24px;
    flex-shrink: 0;
}

.feed__icon--materi {
    background: #dbeafe;
    color: var(--primary-blue);
}

.feed__icon--tugas {
    background: #fef3c7;
    color: #d97706;
}

.feed__icon--ujian {
    background: #fce7f3;
    color: #db2777;
}

.feed__content {
    flex: 1;
}

.feed__title {
    font-size: var(--font-lg);
    font-weight: 600;
    margin-bottom: var(--space-xs);
}

.feed__meta {
    font-size: 14px;
    color: var(--text-secondary);
    margin-bottom: var(--space-xs);
}

.feed__badge {
    display: inline-block;
    padding: 4px 12px;
    border-radius: 20px;
    font-size: 14px;
    font-weight: 600;
}

.feed__badge--pending {
    background: #fee2e2;
    color: #991b1b;
}

.feed__badge--done {
    background: #dcfce7;
    color: #166534;
}

.feed__badge--overdue {
    background: #ffedd5;
    color: #c2410c;
}

/* ============================================
   ALERT / NOTIFIKASI
   ============================================ */

.alert {
    padding: var(--space-md);
    border-radius: var(--radius-md);
    margin-bottom: var(--space-md);
    display: flex;
    align-items: flex-start;
    gap: var(--space-sm);
}

.alert--info {
    background: #dbeafe;
    color: #1e40af;
}

.alert--success {
    background: #dcfce7;
    color: #166534;
}

.alert--warning {
    background: #fef3c7;
    color: #92400e;
}

.alert--error {
    background: #fee2e2;
    color: #991b1b;
}

.alert__icon {
    font-size: 24px;
    flex-shrink: 0;
}

.alert__content {
    flex: 1;
}

.alert__title {
    font-weight: 600;
    margin-bottom: 4px;
}

/* ============================================
   LOADING & SKELETON
   ============================================ */

.loading {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: var(--space-xl);
    color: var(--text-secondary);
}

.loading__spinner {
    width: 48px;
    height: 48px;
    border: 4px solid #e2e8f0;
    border-top-color: var(--primary-blue);
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    to {
        transform: rotate(360deg);
    }
}

.skeleton {
    background: linear-gradient(90deg, #f1f5f9 25%, #e2e8f0 50%, #f1f5f9 75%);
    background-size: 200% 100%;
    animation: shimmer 1.5s infinite;
    border-radius: var(--radius-sm);
}

@keyframes shimmer {
    0% {
        background-position: 200% 0;
    }

    100% {
        background-position: -200% 0;
    }
}

/* ============================================
   MODAL
   ============================================ */

.modal-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.5);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: var(--space-sm);
    z-index: 1000;
}

.modal {
    background: var(--bg-card);
    border-radius: var(--radius-lg);
    width: 100%;
    max-width: 500px;
    max-height: 90vh;
    overflow-y: auto;
    box-shadow: var(--shadow-lg);
}

.modal__header {
    padding: var(--space-md);
    border-bottom: 1px solid #e2e8f0;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.modal__title {
    font-size: var(--font-lg);
    font-weight: 600;
}

.modal__close {
    background: none;
    border: none;
    font-size: 28px;
    cursor: pointer;
    color: var(--text-secondary);
    padding: 0;
    line-height: 1;
}

.modal__body {
    padding: var(--space-md);
}

.modal__footer {
    padding: var(--space-md);
    border-top: 1px solid #e2e8f0;
    display: flex;
    gap: var(--space-sm);
    justify-content: flex-end;
}

/* ============================================
   RESPONSIVE
   ============================================ */

@media (max-width: 600px) {
    :root {
        --font-base: 16px;
        --font-lg: 18px;
        --font-xl: 24px;
    }

    .menu-grid {
        gap: var(--space-sm);
        padding: var(--space-sm);
    }

    .menu-card {
        min-height: 120px;
        padding: var(--space-md);
    }

    .menu-card__icon {
        font-size: 36px;
    }

    .wizard__header {
        flex-wrap: wrap;
    }

    .wizard__step span:not(.wizard__number) {
        display: none;
    }

    /* ============================================
       RESPONSIVE TABLE TO CARD (Hasil Pengumpulan)
       ============================================ */

    .table-responsive {
        overflow-x: visible;
    }

    .table-responsive table {
        border: none;
    }

    .table-responsive thead {
        display: none;
        /* Sembunyikan header tabel */
    }

    .table-responsive tbody {
        display: flex;
        flex-direction: column;
        gap: var(--space-sm);
    }

    .table-responsive tr {
        display: flex;
        flex-direction: column;
        background: var(--bg-card);
        border: 1px solid #e2e8f0;
        border-radius: var(--radius-md);
        padding: var(--space-sm);
        box-shadow: var(--shadow-sm);
    }

    .table-responsive td {
        display: flex;
        align-items: center;
        justify-content: space-between;
        padding: 8px 0 !important;
        border-bottom: 1px solid #f1f5f9;
    }

    .table-responsive td:last-child {
        border-bottom: none;
        padding-top: var(--space-sm) !important;
    }

    /* Tambahkan label sebelum setiap cell */
    .table-responsive td::before {
        content: attr(data-label);
        font-weight: 600;
        font-size: 12px;
        color: var(--text-secondary);
        text-transform: uppercase;
        min-width: 80px;
    }

    /* File column - allow wrap */
    .table-responsive td[data-label="File"] {
        flex-direction: column;
        align-items: flex-start;
    }

    .table-responsive td[data-label="File"]::before {
        margin-bottom: 4px;
    }

    .table-responsive td[data-label="File"] a {
        word-break: break-all;
    }

    /* Tombol Aksi lebar penuh */
    .table-responsive td[data-label="Aksi"] {
        flex-direction: column;
    }

    .table-responsive td[data-label="Aksi"]::before {
        display: none;
    }

    .table-responsive td[data-label="Aksi"] button {
        width: 100%;
        padding: var(--space-sm) var(--space-md) !important;
        font-size: 16px !important;
    }
}

/* ============================================
   UTILITY CLASSES
   ============================================ */

.text-center {
    text-align: center;
}

.text-left {
    text-align: left;
}

.text-right {
    text-align: right;
}

.mt-sm {
    margin-top: var(--space-sm);
}

.mt-md {
    margin-top: var(--space-md);
}

.mt-lg {
    margin-top: var(--space-lg);
}

.mb-sm {
    margin-bottom: var(--space-sm);
}

.mb-md {
    margin-bottom: var(--space-md);
}

.mb-lg {
    margin-bottom: var(--space-lg);
}

.hidden {
    display: none !important;
}

.flex {
    display: flex;
}

.flex-col {
    flex-direction: column;
}

.items-center {
    align-items: center;
}

.justify-center {
    justify-content: center;
}

.justify-between {
    justify-content: space-between;
}

.gap-sm {
    gap: var(--space-sm);
}

.gap-md {
    gap: var(--space-md);
}

/* ============================================
   RESPONSIVE APP LAYOUT
   ============================================ */

.app-layout {
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

.app-content {
    flex: 1;
    padding-bottom: 80px;
    /* Space for bottom nav on mobile */
}

/* ============================================
   SIDEBAR (Desktop Only)
   ============================================ */

.sidebar {
    display: none;
    /* Hidden on mobile */
}

.sidebar__profile {
    text-align: center;
    padding: var(--space-md) var(--space-sm);
    border-bottom: 1px solid #e2e8f0;
}

.sidebar__avatar {
    width: 64px;
    height: 64px;
    border-radius: var(--radius-full);
    background: linear-gradient(135deg, var(--primary-blue), #1d4ed8);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 32px;
    margin: 0 auto var(--space-xs);
    color: white;
}

.sidebar__name {
    font-size: 16px;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: 0;
}

.sidebar__role {
    font-size: 14px;
    color: var(--text-secondary);
    text-transform: capitalize;
}

.sidebar__menu {
    padding: var(--space-sm);
}

.sidebar__item {
    display: flex;
    align-items: center;
    gap: var(--space-sm);
    padding: var(--space-sm) var(--space-md);
    border-radius: var(--radius-md);
    color: var(--text-secondary);
    text-decoration: none;
    font-size: var(--font-base);
    transition: all 0.2s;
    cursor: pointer;
    border: none;
    background: none;
    width: 100%;
    text-align: left;
}

.sidebar__item:hover {
    background: #f1f5f9;
    color: var(--text-primary);
}

.sidebar__item--active {
    background: #dbeafe;
    color: var(--primary-blue);
    font-weight: 600;
}

.sidebar__item--danger {
    color: var(--primary-red);
}

.sidebar__item--danger:hover {
    background: #fef2f2;
}

.sidebar__icon {
    font-size: 20px;
    width: 24px;
    text-align: center;
}

/* ============================================
   BOTTOM NAVIGATION (Mobile Only)
   ============================================ */

.bottom-nav {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    height: 70px;
    background: var(--bg-card);
    display: flex;
    justify-content: space-around;
    align-items: center;
    box-shadow: 0 -4px 20px rgba(0, 0, 0, 0.1);
    z-index: 2000;
    padding: 0 var(--space-xs);
    border-top: 1px solid #e2e8f0;
}

.bottom-nav__item {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: var(--space-xs);
    color: var(--text-secondary);
    text-decoration: none;
    font-size: 11px;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    cursor: pointer;
    border: none;
    background: none;
    min-width: 64px;
    margin: 0 2px;
    border-radius: var(--radius-md);
    opacity: 0.6;
    /* Inactive state agak pudar */
    position: relative;
    user-select: none;
    -webkit-tap-highlight-color: transparent;
}

/* Efek Tekan: Scale Down */
.bottom-nav__item:active {
    transform: scale(0.9);
    opacity: 1;
    background-color: rgba(37, 99, 235, 0.05);
}

.bottom-nav__item:hover {
    color: var(--primary-blue);
    opacity: 0.8;
}

/* State Aktif: Full Opacity, Bouncy, Glow */
.bottom-nav__item--active {
    color: var(--primary-blue);
    opacity: 1;
    font-weight: 600;
    transform: translateY(-2px);
    background: radial-gradient(circle at center, rgba(37, 99, 235, 0.08) 0%, transparent 70%);
}

.bottom-nav__item--active .bottom-nav__icon {
    transform: scale(1.1);
    filter: drop-shadow(0 2px 4px rgba(37, 99, 235, 0.2));
    transition: transform 0.4s cubic-bezier(0.34, 1.56, 0.64, 1);
    /* Bouncy effect */
}

.bottom-nav__icon {
    font-size: 24px;
    margin-bottom: 2px;
    transition: transform 0.2s;
}

.bottom-nav__label {
    font-weight: 500;
    letter-spacing: 0.2px;
}

/* ============================================
   HALAMAN AKUN (Profile Page)
   ============================================ */

.profile-page {
    padding-top: var(--space-lg);
}

.profile-card {
    background: var(--bg-card);
    border-radius: var(--radius-lg);
    padding: var(--space-lg);
    text-align: center;
    box-shadow: var(--shadow-md);
    margin-bottom: var(--space-md);
}

.profile-card__avatar {
    width: 100px;
    height: 100px;
    border-radius: var(--radius-full);
    background: linear-gradient(135deg, var(--primary-blue), #1d4ed8);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 50px;
    margin: 0 auto var(--space-md);
    color: white;
}

.profile-card__name {
    font-size: var(--font-xl);
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: 4px;
}

.profile-card__role {
    font-size: var(--font-base);
    color: var(--text-secondary);
    text-transform: capitalize;
}

.profile-menu {
    background: var(--bg-card);
    border-radius: var(--radius-lg);
    overflow: hidden;
    box-shadow: var(--shadow-sm);
}

.profile-menu__item {
    display: flex;
    align-items: center;
    gap: var(--space-sm);
    padding: var(--space-md);
    color: var(--text-primary);
    text-decoration: none;
    border-bottom: 1px solid #e2e8f0;
    transition: background 0.2s;
    cursor: pointer;
    border-left: none;
    border-right: none;
    border-top: none;
    background: none;
    width: 100%;
    font-size: var(--font-base);
    text-align: left;
}

.profile-menu__item:last-child {
    border-bottom: none;
}

.profile-menu__item:hover {
    background: #f8fafc;
}

.profile-menu__item--danger {
    color: var(--primary-red);
}

/* ============================================
   RESPONSIVE - DESKTOP (≥ 768px)
   ============================================ */

@media (min-width: 768px) {
    .app-layout {
        flex-direction: row;
    }

    .sidebar {
        display: block;
        width: 280px;
        min-height: 100vh;
        background: var(--bg-card);
        border-right: 1px solid #e2e8f0;
        position: fixed;
        left: 0;
        top: 0;
        bottom: 0;
        overflow-y: auto;
        z-index: 100;
    }

    .app-content {
        margin-left: 280px;
        padding-bottom: var(--space-lg);
        flex: 1;
    }

    .bottom-nav {
        display: none !important;
    }

    /* Adjust header for desktop */
    .header {
        margin-left: 0;
    }

    /* Wider container on desktop */
    .container {
        max-width: 900px;
    }

    /* Menu grid adjustments */
    .menu-grid {
        grid-template-columns: repeat(3, 1fr);
    }
}

/* ============================================
   RESPONSIVE - MOBILE ADJUSTMENTS
   ============================================ */

@media (max-width: 767px) {
    .sidebar {
        display: none !important;
    }

    .app-content {
        margin-left: 0;
    }

    /* Hide old logout button on mobile if in nav */
    .mobile-hide {
        display: none !important;
    }
}

/* Hide elements based on device */
.desktop-only {
    display: none;
}

.mobile-only {
    display: block;
}

@media (min-width: 768px) {
    .desktop-only {
        display: block;
    }

    .mobile-only {
        display: none;
    }
}

/* ============================================
   MATERI CARD - Mobile First Design
   ============================================ */

.materi-card {
    background: var(--bg-card);
    border-radius: 16px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
    overflow: hidden;
    margin-bottom: var(--space-md);
    transition: box-shadow 0.3s ease;
}

.materi-card:hover {
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.12);
}

/* AREA A: Header & Konten */
.materi-card__header {
    padding: var(--space-md);
    border-bottom: 1px solid #e2e8f0;
}

.materi-card__title {
    font-size: 18px;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: 4px;
    line-height: 1.3;
}

.materi-card__mapel {
    font-size: 14px;
    color: var(--text-secondary);
    margin-bottom: var(--space-sm);
}

.materi-card__files {
    display: flex;
    flex-direction: column;
    gap: 8px;
    margin-bottom: var(--space-sm);
}

.materi-card__file {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 13px;
    color: var(--text-primary);
    min-width: 0;
    /* Penting untuk text truncation dalam flex container */
}

/* Ikon - Fixed, tidak menyusut */
.materi-card__file i {
    flex-shrink: 0;
    width: 20px;
    text-align: center;
    font-size: 16px;
}

.materi-card__file i.fa-file-pdf {
    color: #dc2626;
}

.materi-card__file i.fa-file-powerpoint {
    color: #ea580c;
}

.materi-card__file i.fa-youtube,
.materi-card__file i.fa-video {
    color: #dc2626;
}

.materi-card__file i.fa-file-word {
    color: #2563eb;
}

.materi-card__file i.fa-file-image {
    color: #16a34a;
}

.materi-card__file i.fa-file-excel {
    color: #16a34a;
}

/* Nama File - Flexible dengan truncation */
.materi-card__file-name {
    flex: 1;
    min-width: 0;
    /* Penting untuk text truncation */
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* Ukuran File - Fixed, tidak menyusut */
.materi-card__file-size {
    flex-shrink: 0;
    color: var(--text-secondary);
    font-size: 12px;
    padding-left: 8px;
    white-space: nowrap;
}

.materi-card__time {
    font-size: 12px;
    color: var(--text-secondary);
    margin-top: var(--space-xs);
}

.materi-card__time i {
    margin-right: 4px;
    opacity: 0.7;
}

/* AREA B: Control Bar (Toggle Kelas) */
.materi-card__control {
    padding: var(--space-sm) var(--space-md);
    background: #f8fafc;
    border-bottom: 1px solid #e2e8f0;
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    align-items: center;
}

.materi-card__control-label {
    font-size: 12px;
    color: var(--text-secondary);
    font-weight: 500;
    width: 100%;
    margin-bottom: 4px;
}

.materi-card__kelas-toggle {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 8px 16px;
    border-radius: 50px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    border: 2px solid var(--primary-blue);
    background: white;
    color: var(--primary-blue);
}

.materi-card__kelas-toggle--active {
    background: var(--primary-blue);
    color: white;
}

.materi-card__kelas-toggle:hover {
    transform: scale(1.02);
}

/* AREA C: Footer (Tombol Aksi) */
.materi-card__footer {
    display: grid;
    grid-template-columns: 1fr 1fr;
}

.materi-card__action {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 14px;
    font-size: 15px;
    font-weight: 600;
    border: none;
    cursor: pointer;
    transition: background 0.2s;
}

.materi-card__action--edit {
    background: #f0f9ff;
    color: var(--primary-blue);
    border-right: 1px solid #e2e8f0;
}

.materi-card__action--edit:hover {
    background: #e0f2fe;
}

.materi-card__action--delete {
    background: #fef2f2;
    color: #dc2626;
}

.materi-card__action--delete:hover {
    background: #fee2e2;
}

/* ============================================
   TUGAS CARD - Enhanced Mobile Card Design
   ============================================ */

.tugas-list {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.tugas-card {
    width: 100%;
    box-sizing: border-box;
    margin-left: 0;
    margin-right: 0;
    background: var(--bg-card);
    border-radius: 12px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.06);
    overflow: hidden;
    border: 1px solid #e2e8f0;
}

.tugas-card:hover {
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.12);
}

/* Header: Mapel + Badge Kelas */
.tugas-card__header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px 16px;
    background: linear-gradient(to right, #f8fafc, #f1f5f9);
    border-bottom: 1px solid #e2e8f0;
}

.tugas-card__mapel {
    font-size: 13px;
    color: var(--text-secondary);
    font-weight: 600;
}

.tugas-card__kelas-badge {
    display: inline-flex;
    align-items: center;
    padding: 5px 14px;
    background: #dbeafe;
    color: #1e40af;
    border-radius: 50px;
    font-size: 12px;
    font-weight: 700;
}

/* Body: Judul + Deadline + Progress */
.tugas-card__body {
    padding: 16px;
}

.tugas-card__title {
    font-size: 16px;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: 12px;
    line-height: 1.4;
}

.tugas-card__info {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.tugas-card__info-row {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 13px;
    color: var(--text-secondary);
}

.tugas-card__info-row i {
    width: 16px;
    text-align: center;
    color: var(--text-secondary);
}

.tugas-card__deadline {
    color: var(--text-secondary);
}

.tugas-card__deadline--overdue {
    color: #dc2626;
    font-weight: 600;
}

.tugas-card__progress {
    color: var(--text-secondary);
}

.tugas-card__progress-count {
    font-weight: 700;
    color: var(--primary-blue);
}

/* Footer: Action Buttons */
.tugas-card__actions {
    display: flex;
}

.tugas-card__action {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 14px 16px;
    font-size: 13px;
    font-weight: 600;
    border: none;
    cursor: pointer;
    transition: all 0.2s;
}

.tugas-card__action--hasil {
    background: #eff6ff;
    color: var(--primary-blue);
    border-top: 1px solid #e2e8f0;
}

.tugas-card__action--hasil:hover {
    background: #dbeafe;
}

.tugas-card__action--hapus {
    background: #fef2f2;
    color: #dc2626;
    border-top: 1px solid #e2e8f0;
    border-left: 1px solid #e2e8f0;
}

.tugas-card__action--hapus:hover {
    background: #fee2e2;
}

/* ============================================
   SEGMENT CONTROL - Modern Tab Toggle
   ============================================ */

.segment-control {
    display: flex;
    width: 100%;
    box-sizing: border-box;
    background: #f1f5f9;
    border-radius: 12px;
    padding: 4px;
    gap: 4px;
    border: 1px solid #e2e8f0;
}

.segment-control__item {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 14px 16px;
    font-size: 14px;
    font-weight: 600;
    color: var(--text-secondary);
    background: transparent;
    border: none;
    border-radius: 10px;
    cursor: pointer;
    transition: all 0.25s ease;
}

.segment-control__item:hover {
    color: var(--text-primary);
    background: rgba(255, 255, 255, 0.5);
}

.segment-control__item--active {
    background: white;
    color: var(--primary-blue);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.segment-control__item--active:hover {
    background: white;
}

.segment-control__item i {
    font-size: 14px;
}

/* ============================================
   FILE CARD LINK - Attachment Download
   ============================================ */

.file-card-link {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 16px;
    background: #f3f4f6;
    border-radius: 10px;
    text-decoration: none;
    color: var(--text-primary);
    transition: all 0.2s;
    min-width: 0;
}

.file-card-link:hover {
    background: #e5e7eb;
}

.file-card-link__icon {
    flex-shrink: 0;
    font-size: 20px;
    width: 24px;
    text-align: center;
}

.file-card-link__icon.fa-file-pdf {
    color: #dc2626;
}

.file-card-link__icon.fa-file-powerpoint {
    color: #ea580c;
}

.file-card-link__icon.fa-file-word {
    color: #2563eb;
}

.file-card-link__icon.fa-file-image {
    color: #16a34a;
}

.file-card-link__name {
    flex: 1;
    min-width: 0;
    font-size: 14px;
    font-weight: 500;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.file-card-link__download {
    flex-shrink: 0;
    font-size: 14px;
    color: var(--primary-blue);
    opacity: 0.7;
}

.file-card-link:hover .file-card-link__download {
    opacity: 1;
}

/* ============================================
   MATERI DETAIL PAGE - Student View
   ============================================ */

.materi-detail-header {
    background: var(--bg-card);
    border-radius: 16px;
    padding: 20px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.08);
    border: 1px solid #e2e8f0;
    margin-bottom: 16px;
}

.materi-detail-header__top {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 12px;
    flex-wrap: wrap;
    gap: 8px;
}

.materi-detail-header__meta {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 13px;
    color: var(--text-secondary);
}

.materi-detail-header__divider {
    opacity: 0.5;
}

.materi-detail-header__kelas-badge {
    display: inline-flex;
    align-items: center;
    padding: 5px 14px;
    background: #dbeafe;
    color: #1e40af;
    border-radius: 50px;
    font-size: 12px;
    font-weight: 700;
}

.materi-detail-header__title {
    font-size: 22px;
    font-weight: 800;
    color: var(--text-primary);
    line-height: 1.3;
    margin-bottom: 8px;
}

.materi-detail-header__time {
    font-size: 13px;
    color: var(--text-secondary);
}

/* Section Styling */
.materi-detail-section {
    background: #f8fafc;
    border-radius: 12px;
    padding: 16px 20px;
    margin-bottom: 16px;
}

.materi-detail-section__title {
    font-size: 15px;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: 12px;
}

.materi-detail-section__text {
    font-size: 15px;
    line-height: 1.7;
    color: #374151;
    white-space: pre-wrap;
}

/* Modern Video Wrapper (16:9) */
.video-wrapper {
    position: relative;
    padding-bottom: 56.25%;
    height: 0;
    overflow: hidden;
    border-radius: 16px;
    background: #000;
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.15);
}

.video-wrapper iframe {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    border: none;
}

/* Tugas Deadline Badge */
.tugas-deadline-badge {
    display: inline-flex;
    align-items: center;
    padding: 5px 12px;
    background: #dbeafe;
    color: #1e40af;
    border-radius: 50px;
    font-size: 12px;
    font-weight: 600;
}

.tugas-deadline-badge--overdue {
    background: #fee2e2;
    color: #dc2626;
}
/* Utility: Hide Scrollbar */
.hide-scrollbar::-webkit-scrollbar { display: none; }
.hide-scrollbar { -ms-overflow-style: none; scrollbar-width: none; }
