/* ============================================================
   SI-HEBAT SMPN 115 JAKARTA - STYLESHEET
   Sistem Informasi & Habit Tracker 7 Kebiasaan Anak Indonesia Hebat
   ============================================================ */

:root {
    --primary-color: #0f766e;
    --primary-light: #14b8a6;
    --primary-dark: #115e59;
    --primary-subtle: #ccfbf1;
    --secondary-color: #0369a1;
    --accent-color: #f59e0b;
    --success-color: #10b981;
    --danger-color: #ef4444;
    --warning-color: #f59e0b;
    --info-color: #06b6d4;
    --bg-light: #f8fafc;
    --card-bg: #ffffff;
    --text-main: #0f172a;
    --text-muted: #64748b;
    --border-color: #e2e8f0;
    --radius-sm: 8px;
    --radius-md: 12px;
    --radius-lg: 18px;
    --radius-xl: 24px;
    --shadow-soft: 0 4px 20px -2px rgba(15, 23, 42, 0.06), 0 2px 6px -1px rgba(15, 23, 42, 0.04);
    --shadow-hover: 0 10px 25px -3px rgba(15, 118, 110, 0.15), 0 4px 10px -2px rgba(15, 118, 110, 0.08);
}

body {
    font-family: 'Plus Jakarta Sans', system-ui, -apple-system, sans-serif;
    background-color: var(--bg-light);
    color: var(--text-main);
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

/* Navbar */
.navbar-smabel {
    background: linear-gradient(135deg, #0f766e 0%, #115e59 100%);
    box-shadow: 0 4px 20px rgba(15, 118, 110, 0.2);
    border-bottom: 2px solid #2dd4bf;
    padding-top: 6px;
    padding-bottom: 6px;
}

.navbar-smabel .navbar-brand {
    padding: 0;
}

.navbar-smabel .navbar-brand img {
    width: clamp(34px, 2.5vw, 42px);
    height: clamp(34px, 2.5vw, 42px);
    transition: all 0.2s ease;
}

.brand-title-main {
    font-size: clamp(0.92rem, 1.05vw, 1.15rem) !important;
}

.brand-subtitle {
    font-size: clamp(0.6rem, 0.65vw, 0.68rem) !important;
}

.brand-badge {
    background: rgba(255, 255, 255, 0.18);
    backdrop-filter: blur(8px);
    border: 1px solid rgba(255, 255, 255, 0.3);
    color: #fff;
    font-size: clamp(0.6rem, 0.65vw, 0.72rem);
    padding: 2px clamp(5px, 0.5vw, 8px);
    border-radius: 9999px;
    letter-spacing: 0.5px;
    font-weight: 600;
}

/* Nav Link Dinamis & Responsif */
.nav-link-custom {
    color: rgba(255, 255, 255, 0.9) !important;
    font-weight: 500;
    font-size: clamp(0.72rem, 0.82vw, 0.86rem) !important;
    padding: 6px clamp(6px, 0.6vw, 12px) !important;
    border-radius: 8px;
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    display: inline-flex;
    align-items: center;
    gap: clamp(4px, 0.45vw, 7px);
    white-space: nowrap !important;
    line-height: 1.25;
}

.nav-link-custom i {
    font-size: clamp(0.75rem, 0.85vw, 0.92rem);
    flex-shrink: 0;
}

.nav-link-custom:hover {
    color: #ffffff !important;
    background: rgba(255, 255, 255, 0.14);
}

.nav-link-custom.active {
    color: #ffffff !important;
    background: rgba(255, 255, 255, 0.22);
    font-weight: 600;
    box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.28);
}

/* Dynamic Navbar Action Pill (Profil Pengguna) */
.user-nav-btn {
    background: rgba(255, 255, 255, 0.12) !important;
    border: 1px solid rgba(255, 255, 255, 0.28) !important;
    color: #ffffff !important;
    font-size: clamp(0.74rem, 0.82vw, 0.85rem) !important;
    font-weight: 500;
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    border-radius: 9999px !important;
    padding: 3px clamp(8px, 0.7vw, 12px) !important;
    height: 34px;
    display: inline-flex;
    align-items: center;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.08);
    line-height: 1;
    text-decoration: none !important;
}

.user-nav-btn:hover,
.user-nav-btn:focus,
.user-nav-btn.show,
.user-nav-btn[aria-expanded="true"] {
    background: rgba(255, 255, 255, 0.22) !important;
    border-color: rgba(255, 255, 255, 0.5) !important;
    color: #ffffff !important;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15) !important;
}

.user-avatar-badge {
    width: 24px !important;
    height: 24px !important;
    font-size: 0.72rem !important;
    object-fit: cover !important;
    border-radius: 50% !important;
    flex-shrink: 0 !important;
    border: 1.5px solid rgba(255, 255, 255, 0.85);
}

.user-nav-name {
    max-width: 140px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

/* Penyesuaian Presisi Sesuai Lebar Layar */
@media (min-width: 992px) and (max-width: 1199.98px) {
    .navbar-smabel .navbar-nav {
        gap: 2px !important;
    }
    .nav-link-custom {
        font-size: 0.72rem !important;
        padding: 5px 6px !important;
        gap: 4px !important;
    }
    .nav-link-custom i {
        font-size: 0.75rem !important;
    }
    .brand-title-main {
        font-size: 0.92rem !important;
    }
    .brand-subtitle {
        font-size: 0.58rem !important;
    }
    .user-nav-name {
        max-width: 85px !important;
    }
}

@media (min-width: 1200px) and (max-width: 1399.98px) {
    .navbar-smabel .navbar-nav {
        gap: 4px !important;
    }
    .nav-link-custom {
        font-size: 0.79rem !important;
        padding: 6px 9px !important;
        gap: 5px !important;
    }
    .nav-link-custom i {
        font-size: 0.82rem !important;
    }
}

@media (min-width: 1400px) {
    .navbar-smabel .navbar-nav {
        gap: 6px !important;
    }
    .nav-link-custom {
        font-size: 0.86rem !important;
        padding: 7px 12px !important;
        gap: 7px !important;
    }
}

/* Tampilan Menu Mobile (< 992px) */
@media (max-width: 991.98px) {
    .navbar-smabel .navbar-collapse {
        background: rgba(15, 118, 110, 0.98);
        border-radius: 12px;
        padding: 12px 14px;
        margin-top: 10px;
        border: 1px solid rgba(255, 255, 255, 0.15);
        box-shadow: 0 10px 25px rgba(0, 0, 0, 0.25);
    }
    .nav-link-custom {
        font-size: 0.88rem !important;
        padding: 8px 12px !important;
        width: 100%;
        border-radius: 8px;
    }
}

/* Header greeting hero */
.hero-banner {
    background: linear-gradient(135deg, #0f766e 0%, #0369a1 100%);
    color: #ffffff;
    border-radius: var(--radius-lg);
    padding: 24px;
    position: relative;
    overflow: hidden;
    box-shadow: var(--shadow-soft);
}

.hero-banner::after {
    content: '';
    position: absolute;
    right: -20px;
    bottom: -40px;
    width: 220px;
    height: 220px;
    background: radial-gradient(circle, rgba(255,255,255,0.15) 0%, rgba(255,255,255,0) 70%);
    border-radius: 50%;
    pointer-events: none;
}

/* Cards */
.card-custom {
    background: var(--card-bg);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-soft);
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.card-custom:hover {
    box-shadow: var(--shadow-hover);
}

.card-header-clean {
    background: transparent;
    border-bottom: 1px solid var(--border-color);
    padding: 16px 20px;
    font-weight: 700;
}

/* Stat Cards */
.stat-card {
    border-radius: var(--radius-md);
    padding: 20px;
    color: white;
    position: relative;
    overflow: hidden;
    box-shadow: var(--shadow-soft);
}

.stat-card.stat-teal {
    background: linear-gradient(135deg, #0d9488 0%, #0f766e 100%);
}

.stat-card.stat-amber {
    background: linear-gradient(135deg, #f59e0b 0%, #d97706 100%);
}

.stat-card.stat-blue {
    background: linear-gradient(135deg, #0284c7 0%, #0369a1 100%);
}

.stat-card.stat-purple {
    background: linear-gradient(135deg, #8b5cf6 0%, #6d28d9 100%);
}

.stat-card .stat-icon {
    position: absolute;
    right: 15px;
    bottom: 12px;
    font-size: 3.5rem;
    opacity: 0.22;
}

/* Habit Tracker Items */
.habit-card {
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    background: #ffffff;
    transition: all 0.25s ease;
    position: relative;
    overflow: hidden;
}

.habit-card:hover {
    border-color: var(--primary-light);
    transform: translateY(-2px);
    box-shadow: var(--shadow-hover);
}

.habit-card.completed {
    border-color: #10b981;
    background: #f0fdf4;
}

.habit-icon-pill {
    width: 48px;
    height: 48px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.4rem;
    flex-shrink: 0;
}

/* Badges & Utility Colors */
.bg-teal {
    background-color: #0f766e !important;
    color: #ffffff !important;
}
.bg-indigo {
    background-color: #4f46e5 !important;
    color: #ffffff !important;
}
.bg-purple {
    background-color: #7c3aed !important;
    color: #ffffff !important;
}
.text-teal {
    color: #0f766e !important;
}
.text-indigo {
    color: #4f46e5 !important;
}
.text-purple {
    color: #7c3aed !important;
}

.badge-custom {
    padding: 6px 12px;
    border-radius: 9999px;
    font-weight: 600;
    font-size: 0.78rem;
    display: inline-flex;
    align-items: center;
    gap: 5px;
}

.badge-item-card {
    border-radius: var(--radius-lg, 16px);
    border: 1px solid var(--border-color, #e2e8f0);
    padding: clamp(14px, 1.2vw, 18px) clamp(10px, 1vw, 14px) 14px;
    text-align: center;
    transition: all 0.25s ease;
    background: #ffffff;
    height: 100%;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: space-between;
    box-shadow: 0 2px 8px rgba(15, 23, 42, 0.04);
    position: relative;
    overflow: hidden;
}

.badge-item-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 10px 24px -4px rgba(15, 118, 110, 0.12);
    border-color: #14b8a6;
}

.badge-item-card.locked {
    opacity: 0.65;
    filter: grayscale(70%);
    background: #f8fafc;
}

.badge-item-card.locked:hover {
    opacity: 0.9;
    filter: grayscale(20%);
}

.badge-item-card .badge-icon-box {
    width: 64px;
    height: 64px;
    border-radius: 50%;
    margin: 0 auto 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.75rem;
    box-shadow: 0 6px 16px rgba(0, 0, 0, 0.12);
    color: #ffffff !important;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    flex-shrink: 0;
}

.badge-item-card:hover .badge-icon-box {
    transform: scale(1.08);
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.16);
}

.badge-icon-box.bg-warning {
    background: linear-gradient(135deg, #fbbf24 0%, #d97706 100%) !important;
}
.badge-icon-box.bg-success {
    background: linear-gradient(135deg, #34d399 0%, #059669 100%) !important;
}
.badge-icon-box.bg-info {
    background: linear-gradient(135deg, #38bdf8 0%, #0284c7 100%) !important;
}
.badge-icon-box.bg-teal {
    background: linear-gradient(135deg, #2dd4bf 0%, #0f766e 100%) !important;
}
.badge-icon-box.bg-danger {
    background: linear-gradient(135deg, #f87171 0%, #dc2626 100%) !important;
}
.badge-icon-box.bg-primary {
    background: linear-gradient(135deg, #60a5fa 0%, #2563eb 100%) !important;
}
.badge-icon-box.bg-indigo {
    background: linear-gradient(135deg, #818cf8 0%, #4f46e5 100%) !important;
}
.badge-icon-box.bg-purple {
    background: linear-gradient(135deg, #c084fc 0%, #7c3aed 100%) !important;
}

.badge-item-card .badge-title {
    font-size: clamp(0.88rem, 0.95vw, 1rem);
    font-weight: 700;
    color: #1e293b;
    margin-bottom: 6px;
    line-height: 1.25;
}

.badge-item-card .badge-desc {
    font-size: clamp(0.72rem, 0.76vw, 0.8rem);
    line-height: 1.45;
    color: #64748b;
    margin-bottom: 12px;
    min-height: 50px;
    display: flex;
    align-items: center;
    justify-content: center;
    text-align: center;
}

.badge-criteria-box {
    width: 100%;
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    border-radius: 10px;
    padding: 8px 10px;
    font-size: clamp(0.68rem, 0.72vw, 0.76rem);
    line-height: 1.35;
    color: #475569;
    white-space: normal !important;
    word-wrap: break-word;
    text-align: center;
    min-height: 48px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-direction: column;
    gap: 2px;
    transition: all 0.2s ease;
}

.badge-item-card:hover .badge-criteria-box {
    background: #f1f5f9;
    border-color: #cbd5e1;
    color: #1e293b;
}

.badge-status-pill {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 4px;
    padding: 4px 12px;
    border-radius: 9999px;
    font-size: clamp(0.7rem, 0.75vw, 0.78rem);
    font-weight: 600;
}
.badge-status-pill.unlocked {
    background-color: #dcfce7;
    color: #15803d;
    border: 1px solid #bbf7d0;
}
.badge-status-pill.locked {
    background-color: #f1f5f9;
    color: #64748b;
    border: 1px solid #e2e8f0;
}

/* Leaderboard podium */
.podium-box {
    text-align: center;
    padding: 20px 10px;
    border-radius: var(--radius-lg);
    background: white;
    box-shadow: var(--shadow-soft);
    position: relative;
}

.podium-1 {
    border: 2px solid #f59e0b;
    background: linear-gradient(180deg, #fffbeb 0%, #ffffff 100%);
    transform: translateY(-10px);
}

.podium-2 {
    border: 2px solid #94a3b8;
    background: linear-gradient(180deg, #f1f5f9 0%, #ffffff 100%);
}

.podium-3 {
    border: 2px solid #d97706;
    background: linear-gradient(180deg, #fef3c7 0%, #ffffff 100%);
}

.podium-crown {
    font-size: 1.8rem;
    margin-bottom: 5px;
}

/* Mobile Bottom Nav */
.mobile-bottom-nav {
    display: none;
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    background: #ffffff;
    border-top: 1px solid #e2e8f0;
    padding: 8px 12px;
    z-index: 1040;
    box-shadow: 0 -4px 15px rgba(0,0,0,0.06);
}

.mobile-bottom-nav .nav-item {
    flex: 1;
    text-align: center;
}

.mobile-bottom-nav a {
    color: #64748b;
    font-size: 0.72rem;
    text-decoration: none;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 3px;
    font-weight: 600;
}

.mobile-bottom-nav a.active, .mobile-bottom-nav a:hover {
    color: var(--primary-color);
}

.mobile-bottom-nav a i {
    font-size: 1.25rem;
}

@media (max-width: 991.98px) {
    .mobile-bottom-nav {
        display: flex;
    }
    body {
        padding-bottom: 70px;
    }
}

/* Print styling for Rapor Karakter */
@media print {
    .no-print, .navbar-smabel, .mobile-bottom-nav, footer, .btn, .card-header-clean button {
        display: none !important;
    }
    body {
        background: white !important;
        color: black !important;
        font-size: 12pt;
    }
    .print-only {
        display: block !important;
    }
    .card-custom {
        border: 1px solid #ccc !important;
        box-shadow: none !important;
    }
}

/* TinyMCE Word Editor Tweaks for Bootstrap 5 Modals */
.tox-tinymce {
    border-radius: 10px !important;
    border: 1px solid var(--border-color, #cbd5e1) !important;
}
.tox-tinymce-aux {
    z-index: 99999 !important;
}
.tox .tox-toolbar__overflow {
    border-radius: 10px !important;
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.15) !important;
}

/* Styling Konten Literasi & Pengumuman (Word-Style Reader View) */
.content-body {
    color: #1e293b;
    font-size: 1.05rem;
    line-height: 1.75;
}
.content-body p {
    margin-bottom: 1rem;
}
.content-body ul {
    list-style-type: disc;
    margin: 0.8rem 0 1.2rem 0;
    padding-left: 2rem;
}
.content-body ul ul {
    list-style-type: circle;
    margin: 0.4rem 0;
    padding-left: 1.6rem;
}
.content-body ul ul ul {
    list-style-type: square;
    margin: 0.4rem 0;
    padding-left: 1.6rem;
}
.content-body ol {
    list-style-type: decimal;
    margin: 0.8rem 0 1.2rem 0;
    padding-left: 2rem;
}
.content-body ol ol {
    list-style-type: lower-alpha;
    margin: 0.4rem 0;
    padding-left: 1.6rem;
}
.content-body ol ol ol {
    list-style-type: lower-roman;
    margin: 0.4rem 0;
    padding-left: 1.6rem;
}
.content-body li {
    margin-bottom: 0.45rem;
    line-height: 1.7;
}
.content-body blockquote {
    border-left: 4px solid #0f766e;
    margin: 1.2rem 0;
    padding: 0.6rem 1.2rem;
    background-color: #f8fafc;
    border-radius: 0 8px 8px 0;
    color: #475569;
    font-style: italic;
}
.content-body table {
    width: 100%;
    margin: 1.2rem 0;
    border-collapse: collapse;
}
.content-body table th,
.content-body table td {
    border: 1px solid #cbd5e1;
    padding: 8px 14px;
}
.content-body table th {
    background-color: #f1f5f9;
    font-weight: 600;
}

/* ==========================================================================
   Mobile Dashboard & Responsive Enhancements (SI-HEBAT Mobile View)
   ========================================================================== */
.shadow-xs {
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.06) !important;
}

.mobile-dashboard-container .nav-pills .nav-link {
    color: #64748b;
    background: transparent;
    transition: all 0.2s ease;
}

.mobile-dashboard-container .nav-pills .nav-link.active {
    background-color: #0f766e !important;
    color: #ffffff !important;
    box-shadow: 0 2px 6px rgba(15, 118, 110, 0.25);
}

.mobile-habit-item {
    transition: transform 0.15s ease-in-out, background-color 0.15s ease-in-out;
}
.mobile-habit-item:active {
    transform: scale(0.98);
}

@media (max-width: 767.98px) {
    .container {
        padding-left: 12px !important;
        padding-right: 12px !important;
    }
    .stat-card {
        padding: 13px 12px !important;
        border-radius: 14px !important;
    }
    .stat-card .fs-2 {
        font-size: 1.45rem !important;
    }
    .stat-card .stat-icon {
        font-size: 2.2rem !important;
        right: 8px !important;
        bottom: 8px !important;
        opacity: 0.18 !important;
    }
    .hero-banner {
        padding: 16px !important;
        border-radius: 16px !important;
    }
    .hero-banner h2 {
        font-size: 1.35rem !important;
    }
}

