/* assets/css/app.css - Official Styling for Sekolah Unggul Sejahtera Indonesia (USI) */
@import url('https://fonts.googleapis.com/css2?family=Nunito:wght@400;600;700;800;900&family=Plus+Jakarta+Sans:wght@400;500;600;700;800&family=Amiri:wght@400;700&display=swap');

:root {
    --usi-dark: #1b3d2c;
    --usi-primary: #2d5a43;
    --usi-light-green: #e9f4ee;
    --usi-subtle: #f4faf6;
    --usi-accent: #3d8060;
    --usi-gold: #f59e0b;
    --usi-gold-light: #fef3c7;
    --usi-gold-dark: #b45309;
    --usi-cyan: #06b6d4;
    --usi-purple: #8b5cf6;
    --usi-pink: #ec4899;
    --usi-text-main: #1f2937;
    --usi-text-muted: #6b7280;
    --sidebar-width: 270px;
}

body {
    font-family: 'Plus Jakarta Sans', sans-serif;
    color: var(--usi-text-main);
    background-color: #f8faf9;
    margin: 0;
    padding: 0;
    overflow-x: hidden;
}

.font-child {
    font-family: 'Nunito', sans-serif;
}

.font-arabic {
    font-family: 'Amiri', serif;
    direction: rtl;
    line-height: 2.2;
}

/* Navbar & Brand */
.navbar-usi {
    background-color: #ffffff;
    border-bottom: 2px solid #e5efe8;
    box-shadow: 0 4px 15px -3px rgba(32, 74, 55, 0.05);
}

.brand-logo {
    height: 48px;
    width: auto;
    object-fit: contain;
}

.brand-logo-lg {
    height: 75px;
    width: auto;
    object-fit: contain;
}

.btn-usi {
    background: linear-gradient(135deg, var(--usi-primary), #234c38);
    color: #ffffff !important;
    font-weight: 600;
    border-radius: 12px;
    padding: 10px 20px;
    border: none;
    transition: all 0.25s ease;
}

.btn-usi:hover {
    background: linear-gradient(135deg, #234c38, #183727);
    transform: translateY(-2px);
    box-shadow: 0 8px 16px -4px rgba(45, 90, 67, 0.35);
}

.btn-usi-gold {
    background: linear-gradient(135deg, #fbbf24, #f59e0b);
    color: #78350f !important;
    font-weight: 700;
    border-radius: 12px;
    border: none;
    transition: all 0.25s ease;
}

.btn-usi-gold:hover {
    background: linear-gradient(135deg, #f59e0b, #d97706);
    color: #ffffff !important;
    transform: translateY(-2px);
    box-shadow: 0 8px 16px -4px rgba(245, 158, 11, 0.4);
}

/* Gamification Badges */
.badge-star {
    background: #fef3c7;
    color: #b45309;
    border: 1.5px solid #fde68a;
    font-weight: 800;
    border-radius: 30px;
    padding: 6px 14px;
    display: inline-flex;
    align-items: center;
    gap: 6px;
}

.badge-coin {
    background: #fffbeb;
    color: #d97706;
    border: 1.5px solid #fcd34d;
    font-weight: 800;
    border-radius: 30px;
    padding: 6px 14px;
    display: inline-flex;
    align-items: center;
    gap: 6px;
}

.badge-xp {
    background: #ede9fe;
    color: #6d28d9;
    border: 1.5px solid #ddd6fe;
    font-weight: 800;
    border-radius: 30px;
    padding: 6px 14px;
    display: inline-flex;
    align-items: center;
    gap: 6px;
}

/* Cards & Containers */
.card-usi {
    background: #ffffff;
    border-radius: 18px;
    border: 1px solid #e7efe9;
    box-shadow: 0 4px 18px rgba(0, 0, 0, 0.03);
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.card-usi:hover {
    box-shadow: 0 10px 25px -4px rgba(45, 90, 67, 0.08);
}

.card-child {
    border-radius: 22px;
    border: 2px solid #e0eee4;
    transition: transform 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

.card-child:hover {
    transform: translateY(-6px);
}

/* Audio Player & TTS Control */
.tts-control-bar {
    background: linear-gradient(135deg, #eaf5ee, #d8ece0);
    border: 2px solid #b8dfc7;
    border-radius: 20px;
    padding: 16px 22px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 12px;
}

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

.sidebar {
    width: var(--sidebar-width);
    background: #ffffff;
    border-right: 1.5px solid #e5ede7;
    display: flex;
    flex-direction: column;
    flex-shrink: 0;
    transition: all 0.3s;
}

.sidebar-header {
    padding: 24px 20px;
    border-bottom: 1.5px solid #e8f0ea;
    text-align: center;
}

.sidebar-menu {
    list-style: none;
    padding: 15px 12px;
    margin: 0;
    flex-grow: 1;
}

.sidebar-menu .nav-item {
    margin-bottom: 5px;
}

.sidebar-menu .nav-link {
    display: flex;
    align-items: center;
    padding: 12px 16px;
    color: #4b5563;
    font-weight: 600;
    font-size: 0.93rem;
    border-radius: 12px;
    text-decoration: none;
    transition: all 0.2s;
}

.sidebar-menu .nav-link i {
    width: 26px;
    font-size: 1.15rem;
    color: var(--usi-primary);
    margin-right: 10px;
}

.sidebar-menu .nav-link:hover {
    background-color: var(--usi-light-green);
    color: var(--usi-dark);
}

.sidebar-menu .nav-link.active {
    background: linear-gradient(135deg, var(--usi-primary), #1f4734);
    color: #ffffff;
}

.sidebar-menu .nav-link.active i {
    color: #ffffff;
}

.main-content {
    flex-grow: 1;
    display: flex;
    flex-direction: column;
    overflow-y: auto;
    min-width: 0;
}

.content-body {
    padding: 26px;
    flex-grow: 1;
}

/* Top Stats Widget */
.stat-widget {
    background: #ffffff;
    border-radius: 16px;
    padding: 20px;
    border: 1px solid #e5ede7;
    display: flex;
    align-items: center;
    gap: 16px;
}

.stat-icon {
    width: 54px;
    height: 54px;
    border-radius: 14px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
}

/* Avatar Selector */
.avatar-choice-card {
    border: 3px solid transparent;
    border-radius: 18px;
    cursor: pointer;
    transition: all 0.25s;
    background: #ffffff;
}

.avatar-choice-card:hover {
    border-color: #93c5fd;
    transform: scale(1.05);
}

.avatar-choice-card.selected {
    border-color: var(--usi-primary);
    background-color: #f0f7f3;
}

/* Quiz Option Card */
.quiz-opt-btn {
    display: block;
    width: 100%;
    text-align: left;
    padding: 16px 20px;
    font-size: 1.05rem;
    font-weight: 600;
    border: 2px solid #e2e8f0;
    border-radius: 14px;
    background-color: #ffffff;
    margin-bottom: 12px;
    transition: all 0.2s;
    cursor: pointer;
}

.quiz-opt-btn:hover {
    border-color: var(--usi-primary);
    background-color: #f4faf6;
}

.quiz-opt-btn.correct {
    border-color: #10b981 !important;
    background-color: #ecfdf5 !important;
    color: #065f46 !important;
}

.quiz-opt-btn.wrong {
    border-color: #ef4444 !important;
    background-color: #fef2f2 !important;
    color: #991b1b !important;
}

/* Official Print & PDF Styles */
.kop-surat {
    display: none;
}

@media print {
    body {
        background-color: #ffffff !important;
        font-size: 11pt;
        color: #000000 !important;
    }

    .no-print, .sidebar, .navbar-usi, footer, .btn, .tts-control-bar, .modal {
        display: none !important;
    }

    .main-content {
        margin: 0 !important;
        padding: 0 !important;
    }

    .content-body {
        padding: 0 !important;
    }

    .card-usi {
        box-shadow: none !important;
        border: none !important;
        padding: 0 !important;
    }

    .kop-surat {
        display: block !important;
        margin-bottom: 20px;
        border-bottom: 3px double #1b3d2c;
        padding-bottom: 12px;
    }

    .kop-surat img {
        max-height: 80px;
    }

    .kop-header-text h3 {
        margin: 0;
        font-size: 15pt;
        font-weight: 800;
        color: #1b3d2c;
        text-transform: uppercase;
    }

    .kop-header-text h4 {
        margin: 2px 0;
        font-size: 12pt;
        font-weight: 700;
    }

    .kop-header-text p {
        margin: 0;
        font-size: 9pt;
        color: #444;
    }

    .table-print {
        width: 100%;
        border-collapse: collapse;
        margin-top: 15px;
    }

    .table-print th, .table-print td {
        border: 1px solid #333 !important;
        padding: 6px 10px !important;
    }

    .table-print th {
        background-color: #f0f4f1 !important;
        -webkit-print-color-adjust: exact;
        print-color-adjust: exact;
    }

    .ttd-box {
        margin-top: 40px;
        page-break-inside: avoid;
    }
}
