/**
 * CONSOLIDATED STYLESHEET
 * Compiled from all view style pushes
 * Last Updated: April 18, 2026
 */

/* ========================================
   1. ROOT VARIABLES & TYPOGRAPHY
   ======================================== */
:root {
    /* Color Palette */
    --slate-50: #f8fafc;
    --slate-100: #f1f5f9;
    --slate-200: #e2e8f0;
    --slate-400: #cbd5e1;
    --slate-600: #475569;
    --slate-800: #1e293b;
    --indigo-500: #6366f1;
    --indigo-700: #4f46e5;

    /* Theme Colors */
    --bg-body: #f8fafc;
    --bg-card: #ffffff;
    --bg-main: #f1f5f9;
    --text-main: #1e293b;
    --text-heading: #1e293b;
    --text-body: #334155;
    --text-muted: #64748b;
    --border-color: #e2e8f0;

    /* Other Colors */
    --danger-color: #e11d48;
    --warning-color: #d97706;
    --success-color: #16a34a;
    --danger-light: #ffe4e6;
    --warning-light: #fef3c7;
    --success-light: #f0fdf4;
}

/* Dark Mode Theme */
[data-theme="dark"] {
    --bg-body: #0f172a;
    --bg-card: #1e293b;
    --bg-main: #334155;
    --text-main: #f1f5f9;
    --text-heading: #f8fafc;
    --text-body: #cbd5e1;
    --text-muted: #64748b;
    --border-color: #334155;
}

body {
    font-family: 'Inter', 'Instrument Sans', ui-sans-serif, system-ui, sans-serif;
    background-color: var(--bg-body);
    color: var(--text-main);
    transition: background-color 0.3s ease, color 0.3s ease;
}

/* ========================================
   2. LAYOUT COMPONENTS
   ======================================== */
#wrapper { 
    display: flex; 
    width: 100%; 
    align-items: flex-start; /* PENTING: Menghindari sidebar memanjang mengikuti konten */
}

#sidebar {
    min-width: 260px;
    max-width: 260px;
    background: #1e293b;
    color: #fff;
    transition: all 0.3s ease;
    
    /* Konfigurasi Sticky */
    height: 100vh;
    position: sticky;
    top: 0;
    
    /* Agar menu di dalam sidebar bisa di-scroll secara mandiri jika terlalu panjang */
    overflow-y: auto; 
    z-index: 1000;
    flex-shrink: 0;
}

#sidebar::-webkit-scrollbar {
    width: 5px;
}

#sidebar::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.2);
    border-radius: 5px;
}

#sidebar.toggled {
    margin-left: -260px;
}

#sidebar .sidebar-header {
    padding: 20px;
    background: #1a1d20;
    border-bottom: 1px solid #2c3136;
}

#sidebar ul.components {
    padding: 20px 0;
}

#sidebar ul p {
    padding: 10px;
    font-size: 11px;
    text-transform: uppercase;
    color: #6c757d;
    font-weight: 700;
    margin-bottom: 0;
}

#sidebar ul li a {
    padding: 12px 20px;
    font-size: 14px;
    display: block;
    color: #adb5bd;
    text-decoration: none;
    transition: 0.2s;
}

#sidebar ul li a:hover,
#sidebar ul li.active > a {
    color: #fff;
    background: #0d6efd;
    border-radius: 0 20px 20px 0;
    margin-right: 15px;
}

#sidebar ul li a i {
    margin-right: 10px;
    width: 20px;
    text-align: center;
}

#page-content-wrapper {
    flex: 1;
    min-width: 0;
    width: 100%;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

/* Top Navbar */
.top-navbar {
    background: white;
    border-bottom: 1px solid #dee2e6;
    padding: 10px 20px;
}

@media (max-width: 768px) {
    #sidebar { 
        position: fixed; /* Berubah menjadi fixed di mobile */
        margin-left: -260px; 
    }
    #sidebar.toggled { 
        margin-left: 0; 
    }
}

/* ========================================
   3. AVATAR & DROPDOWN COMPONENTS
   ======================================== */

.avatar-circle {
    width: 34px;
    height: 34px;
    background-color: var(--indigo-500);
    color: white;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.75rem;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.2s ease;
    box-shadow: 0 0 0 2px white, 0 0 0 4px var(--slate-100);
}

.avatar-circle:hover {
    transform: scale(1.05);
}

.cursor-pointer {
    cursor: pointer;
}

/* Custom Dropdown */
.custom-dropdown {
    border-radius: 12px;
    min-width: 200px;
    padding: 8px;
}

.custom-dropdown .dropdown-item {
    border-radius: 8px;
    transition: all 0.2s;
    color: var(--slate-600);
}

.custom-dropdown .dropdown-item:hover {
    background-color: var(--slate-50);
    color: var(--indigo-500);
}

/* ========================================
   4. CARD COMPONENTS
   ======================================== */

.custom-card {
    border: 1px solid var(--border-color);
    border-radius: 12px;
    background-color: var(--bg-card);
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.02);
}

.custom-card-header {
    background-color: var(--bg-card);
    border-bottom: 1px solid var(--border-color);
    border-radius: 12px 12px 0 0 !important;
}

.custom-card-footer,
.custom-card-footer-theme {
    border-top: 1px solid var(--border-color);
    background-color: var(--bg-card);
    border-radius: 0 0 12px 12px;
}

/* ========================================
   5. TABLE STYLES
   ======================================== */

.custom-table,
.custom-table-theme {
    color: var(--text-main);
    border-color: var(--border-color);
}

.custom-table thead th,
.custom-table-theme thead th {
    background-color: var(--bg-card);
    color: var(--text-muted);
    border-bottom: 2px solid var(--border-color);
    font-size: 0.65rem;
    font-weight: 700;
    text-transform: uppercase;
    padding: 0.5rem 0.75rem;
}

.custom-table tbody td,
.custom-table-theme tbody td {
    padding: 0.6rem 0.75rem;
    border-bottom: 1px solid var(--border-color);
    background-color: var(--bg-card);
    color: var(--text-main);
}

.custom-table tbody tr:hover td,
.custom-table-theme tbody tr:hover td {
    background-color: var(--bg-main);
}

/* ========================================
   6. MODAL COMPONENTS
   ======================================== */

.custom-modal,
.custom-modal-theme {
    background-color: var(--bg-card);
    border-radius: 16px;
    border: none;
}

.btn-close-custom {
    background: transparent;
    border: none;
    color: var(--text-muted);
    font-size: 1.25rem;
    transition: 0.2s;
    padding: 0;
    line-height: 1;
}

.btn-close-custom:hover {
    color: var(--text-main);
    transform: scale(1.1);
}

/* ========================================
   7. BUTTON STYLES
   ======================================== */

.btn-custom-outline,
.btn-custom-outline-theme {
    color: var(--text-main);
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: 6px;
    font-weight: 500;
    transition: all 0.2s;
}

.btn-custom-outline:hover,
.btn-custom-outline-theme:hover {
    background: var(--bg-main);
    border-color: var(--text-muted);
    color: var(--indigo-500);
}

/* ========================================
   8. FORM CONTROLS
   ======================================== */

.form-control-theme {
    background-color: var(--bg-main) !important;
    border: 1px solid var(--border-color) !important;
    color: var(--text-main) !important;
}

.form-control-theme:focus {
    border-color: var(--indigo-500) !important;
    background-color: var(--bg-main) !important;
    color: var(--text-main) !important;
    box-shadow: 0 0 0 0.2rem rgba(99, 102, 241, 0.25);
}

/* ========================================
   9. BADGE COMPONENTS
   ======================================== */

.badge-soft {
    display: inline-flex;
    align-items: center;
    padding: 0.25em 0.6em;
    font-size: 0.7rem;
    font-weight: 600;
    border-radius: 4px;
}

/* Badge Variants */
.badge-soft-primary {
    background-color: #eef2ff;
    color: #6366f1;
    border: 1px solid #c7d2fe;
}

.badge-soft-secondary,
.badge-soft-secondary-theme {
    background: var(--slate-50);
    color: #475569;
    border: 1px solid var(--slate-200);
}

.badge-soft-warning {
    background-color: var(--warning-light);
    color: var(--warning-color);
}

.badge-soft-success {
    background-color: var(--success-light);
    color: var(--success-color);
}

.badge-soft-danger {
    background-color: var(--danger-light);
    color: var(--danger-color);
}

/* Dark Mode Badge Overrides */
[data-theme="dark"] .badge-soft-secondary-theme {
    background-color: #334155;
    color: #cbd5e1;
}

[data-theme="dark"] .badge-soft-danger {
    background-color: rgba(225, 29, 72, 0.15);
    color: #f43f5e;
    border: 1px solid rgba(225, 29, 72, 0.2);
}

[data-theme="dark"] .badge-soft-warning {
    background-color: rgba(217, 119, 6, 0.15);
    color: #fbbf24;
    border: 1px solid rgba(217, 119, 6, 0.2);
}

[data-theme="dark"] .badge-soft-success {
    background-color: rgba(22, 163, 74, 0.15);
    color: #4ade80;
    border: 1px solid rgba(22, 163, 74, 0.2);
}

/* ========================================
   9A. SCORE PILL COMPONENTS
   ======================================== */

.score-pill {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 26px;
    height: 26px;
    border-radius: 50%;
    font-weight: 700;
    font-size: 0.75rem;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.score-danger {
    background-color: #e11d48;
    color: white;
}

.score-warning {
    background-color: #f59e0b;
    color: white;
}

.score-success {
    background-color: #10b981;
    color: white;
}

/* Pulse Animation for High Score */
.pulse-soft {
    animation: pulse-soft 2s infinite;
}

@keyframes pulse-soft {
    0% {
        box-shadow: 0 0 0 0 rgba(225, 29, 72, 0.4);
    }
    70% {
        box-shadow: 0 0 0 6px rgba(225, 29, 72, 0);
    }
    100% {
        box-shadow: 0 0 0 0 rgba(225, 29, 72, 0);
    }
}

/* ========================================
   9B. PAGINATION COMPONENTS
   ======================================== */
/* ========================================
   PAGINATION LARAVEL NATIVE FIX
   ======================================== */
/* 1. Paksa UL untuk menjadi Flexbox (Berjejer ke samping) */
.pagination-wrapper-theme .pagination {
    display: flex !important;
    flex-wrap: wrap !important;
    padding-left: 0 !important;
    list-style: none !important;
    margin-bottom: 0 !important;
    gap: 4px !important; /* Jarak antar tombol */
}

/* 2. Paksa LI (List Item) agar tidak tersembunyi */
.pagination-wrapper-theme .page-item {
    display: block !important;
    margin: 0 !important;
    padding: 0 !important;
}

/* 3. Bentuk Tombol Halaman */
.pagination-wrapper-theme .page-link {
    position: relative !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    min-width: 32px !important;
    height: 32px !important;
    padding: 0 0.5rem !important;
    font-size: 0.8rem !important;
    font-weight: 600 !important;
    color: var(--text-main) !important;
    background-color: var(--bg-card) !important;
    border: 1px solid var(--border-color) !important;
    border-radius: 6px !important; /* Membuat kotak tombol sedikit membulat */
    text-decoration: none !important;
    transition: all 0.2s ease !important;
}

/* 4. Warna Saat Tombol Diarahkan (Hover) */
.pagination-wrapper-theme .page-link:hover {
    background-color: var(--bg-main) !important;
    color: var(--indigo-500) !important;
    border-color: var(--indigo-500) !important;
}

/* 5. Warna Saat Halaman Aktif (Misal: Sedang di Halaman 1) */
.pagination-wrapper-theme .page-item.active .page-link {
    z-index: 3 !important;
    color: #ffffff !important;
    background-color: var(--indigo-500) !important;
    border-color: var(--indigo-500) !important;
}

/* 6. Warna Saat Tombol Dinonaktifkan (Misal: Tombol Previous di Halaman 1) */
.pagination-wrapper-theme .page-item.disabled .page-link {
    color: var(--text-muted) !important;
    pointer-events: none !important;
    background-color: transparent !important;
    border-color: var(--border-color) !important;
    opacity: 0.5 !important;
}

/* 7. Perbaikan Teks "Showing..." agar sejajar dengan tombol */
.pagination-wrapper-theme .text-muted {
    color: var(--text-muted) !important;
    font-size: 0.8rem !important;
    margin-bottom: 0 !important;
}

.pagination-wrapper-theme .d-sm-flex {
    align-items: center !important;
}

/* State Active & Hover untuk Dark Mode */
[data-theme="dark"] .pagination-wrapper-theme .page-item.active .page-link {
    background-color: var(--indigo-500);
    border-color: var(--indigo-500);
    color: #ffffff !important;
}

[data-theme="dark"] .pagination-wrapper-theme .page-item.disabled .page-link {
    background-color: var(--bg-main);
    color: var(--text-muted);
    border-color: var(--border-color);
}

[data-theme="dark"] .pagination-wrapper-theme .page-link:hover:not(.disabled) {
    background-color: var(--bg-main);
    color: var(--indigo-500);
}

/* Memastikan Flexbox Laravel tidak terganggu */
.pagination-wrapper-theme nav p {
    margin-bottom: 0; /* Menghilangkan margin pada teks */
}

/* ========================================
   10. TYPOGRAPHY & TEXT UTILITIES
   ======================================== */

/* Font Sizes */
.fs-8 {
    font-size: 0.8125rem !important;
}

.fs-9 {
    font-size: 0.7rem !important;
}

.fs-10 {
    font-size: 0.65rem !important;
}

.text-xs {
    font-size: 0.65rem !important;
}

/* Text Colors */
.text-heading-theme {
    color: var(--text-heading) !important;
}

.text-body-theme {
    color: var(--text-main) !important;
    opacity: 0.9;
}

.text-muted-theme {
    color: var(--text-muted) !important;
}

.text-indigo {
    color: var(--indigo-500) !important;
}

.text-slate-800 {
    color: var(--text-main) !important;
}

/* Text Alignment */
.text-justify {
    text-align: justify;
    text-justify: inter-word;
}

.tracking-wider {
    letter-spacing: 0.05em;
}

/* ========================================
   11. BACKGROUND & BORDER UTILITIES
   ======================================== */

.bg-card-theme {
    background-color: var(--bg-card) !important;
}

.bg-report-theme {
    background-color: var(--bg-body) !important;
}

.bg-slate-50 {
    background-color: var(--slate-50);
}

.border-theme {
    border-color: var(--border-color) !important;
    border-bottom-color: var(--border-color) !important;
}

.border-bottom-theme {
    border-bottom: 1px solid var(--border-color) !important;
}

.border-bottom-indigo {
    border-bottom: 1px solid #c7d2fe !important;
}

.border-indigo-theme {
    border: 1px solid #c7d2fe !important;
}

[data-theme="dark"] .border-bottom-indigo {
    border-bottom: 1px solid #334155 !important;
}

[data-theme="dark"] .border-indigo-theme {
    border: 1px solid #334155 !important;
}

/* ========================================
   12. AI CONTENT STYLES
   ======================================== */

.ai-content p,
.ai-content li {
    margin-bottom: 0.8rem;
    line-height: 1.5;
    font-size: 0.9125rem;
    color: var(--text-main);
    opacity: 0.85;
}

.ai-content strong {
    color: var(--text-main);
    font-weight: 700;
}

[data-theme="dark"] .ai-content p,
[data-theme="dark"] .ai-content li {
    color: #cbd5e1;
}

[data-theme="dark"] .ai-content strong {
    color: #fff;
}

/* ========================================
   13. INTERACTIVE ELEMENTS
   ======================================== */

.hover-indigo:hover {
    color: var(--indigo-500) !important;
}

/* Login Page Specific */
.login-card {
    width: 100%;
    max-width: 400px;
    border: none;
    border-radius: 15px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.5);
}

.login-header {
    background-color: #ffffff;
    border-radius: 15px 15px 0 0;
    padding: 30px;
    text-align: center;
    border-bottom: 3px solid #0d6efd;
}

.login-body {
    background-color: #ffffff;
    border-radius: 0 0 15px 15px;
    padding: 30px;
}

.btn-login {
    padding: 12px;
    font-weight: 600;
    transition: 0.3s;
}

.brand-logo {
    font-size: 2.5rem;
    color: #0d6efd;
    margin-bottom: 10px;
}

/* ========================================
   14. RESPONSIVE STYLES
   ======================================== */

@media (max-width: 768px) {
    #sidebar {
        margin-left: -260px;
        position: fixed;
        z-index: 999;
    }

    #sidebar.toggled {
        margin-left: 0;
    }

    .container {
        max-width: 100%;
    }

    .table-responsive {
        font-size: 0.75rem;
    }
}

@media (min-width: 768px) {
    .sidebar {
        position: sticky;
    }
}

/* ========================================
   15. GLOBAL CARD & COMPONENT OVERRIDES
   ======================================== */

.card {
    background-color: var(--bg-card) !important;
    color: var(--text-main);
    border-color: var(--border-color);
}

.navbar {
    background-color: var(--bg-card) !important;
}

.modal-content {
    background-color: var(--bg-card) !important;
    color: var(--text-main);
}

.dropdown-menu {
    background-color: var(--bg-card) !important;
    color: var(--text-main);
}

.dropdown-item {
    color: var(--text-main);
}

.dropdown-item:hover,
.dropdown-item:focus {
    background-color: var(--bg-main);
    color: var(--indigo-500);
}

/* ========================================
   16. UTILITY CLASSES
   ======================================== */

.d-none {
    display: none !important;
}

.d-flex {
    display: flex;
}

.d-inline-flex {
    display: inline-flex;
}

.d-block {
    display: block;
}

.gap-2 {
    gap: 0.5rem;
}

.gap-3 {
    gap: 0.75rem;
}

.gap-4 {
    gap: 1rem;
}

.me-2 {
    margin-right: 0.5rem;
}

.ms-auto {
    margin-left: auto;
}

.mb-0 {
    margin-bottom: 0;
}

.mb-1 {
    margin-bottom: 0.25rem;
}

.mb-2 {
    margin-bottom: 0.5rem;
}

.mb-3 {
    margin-bottom: 0.75rem;
}

.mb-4 {
    margin-bottom: 1rem;
}

.mb-6 {
    margin-bottom: 1.5rem;
}

.py-1 {
    padding-top: 0.25rem;
    padding-bottom: 0.25rem;
}

.py-2 {
    padding-top: 0.5rem;
    padding-bottom: 0.5rem;
}

.px-3 {
    padding-left: 0.75rem;
    padding-right: 0.75rem;
}

/* ========================================
   17. TRANSITIONS & ANIMATIONS
   ======================================== */

.transition-all {
    transition: all 0.2s ease;
}

.transition-colors {
    transition: color 0.2s ease, background-color 0.2s ease;
}

/* ========================================
   18. SCROLLBAR CUSTOMIZATION
   ======================================== */

::-webkit-scrollbar {
    width: 8px;
    height: 8px;
}

::-webkit-scrollbar-track {
    background: transparent;
}

::-webkit-scrollbar-thumb {
    background: var(--slate-200);
    border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
    background: var(--slate-400);
}

[data-theme="dark"]::-webkit-scrollbar-thumb {
    background: var(--slate-600);
}

[data-theme="dark"]::-webkit-scrollbar-thumb:hover {
    background: var(--slate-500);
}

/* ========================================
   SILVER BULLET: FIX LARAVEL PAGINATION CONFLICT
   ======================================== */

/* 1. Paksa Container Tampil di Desktop (Menimpa konflik .d-none) */
@media (min-width: 576px) {
    .pagination-wrapper-theme .d-none.d-sm-flex {
        display: flex !important;
        width: 100% !important;
        align-items: center !important;
        justify-content: space-between !important;
        visibility: visible !important;
        opacity: 1 !important;
    }
    
    /* Sembunyikan versi mobile di desktop */
    .pagination-wrapper-theme .d-sm-none {
        display: none !important;
    }
}

/* 2. Paksa Versi Mobile Tampil di HP */
@media (max-width: 575.98px) {
    .pagination-wrapper-theme .d-sm-none {
        display: flex !important;
        width: 100% !important;
        justify-content: space-between !important;
    }
}

/* 3. Paksa Struktur List (UL & LI) Kembali Normal */
.pagination-wrapper-theme ul.pagination {
    display: flex !important;
    flex-wrap: wrap !important;
    margin-bottom: 0 !important;
    padding-left: 0 !important;
    list-style: none !important;
    visibility: visible !important;
}

.pagination-wrapper-theme li.page-item {
    display: block !important;
}

/* 4. Paksa Bentuk Tombol (A & SPAN) */
.pagination-wrapper-theme .page-link {
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    min-width: 32px !important;
    height: 32px !important;
    padding: 0 0.5rem !important;
    font-size: 0.8rem !important;
    font-weight: 600 !important;
    visibility: visible !important;
    
    /* Sinkronisasi Tema Default */
    color: var(--text-main) !important;
    background-color: var(--bg-card) !important;
    border: 1px solid var(--border-color) !important;
    border-radius: 6px !important;
    margin-left: 2px !important;
    margin-right: 2px !important;
    text-decoration: none !important;
}

/* 5. Pewarnaan Khusus Dark Mode */
[data-theme="dark"] .pagination-wrapper-theme .page-item.active .page-link {
    background-color: var(--indigo-500) !important;
    border-color: var(--indigo-500) !important;
    color: #ffffff !important;
}

[data-theme="dark"] .pagination-wrapper-theme .page-link:hover:not(.disabled) {
    background-color: var(--bg-main) !important;
    color: var(--indigo-500) !important;
}

[data-theme="dark"] .pagination-wrapper-theme .page-item.disabled .page-link {
    background-color: transparent !important;
    color: var(--text-muted) !important;
    border-color: var(--border-color) !important;
    opacity: 0.5 !important;
}

/* ========================================
   STYLING LINK BERITA AESTHETIC
   ======================================== */
.news-link-aesthetic {
    text-decoration: none;
    font-weight: 600;
    font-size: 0.8125rem;
    line-height: 1.4;
    display: block;
    transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
    /* Warna default (Mode Terang): Slate Profesional */
    color: var(--slate-800);
}

/* Hover Mode Terang: Indigo */
.news-link-aesthetic:hover {
    color: var(--indigo-500);
    transform: translateX(3px); /* Sedikit geser ke kanan untuk kesan interaktif */
}

/* Mode Gelap: Putih Bersih */
[data-theme="dark"] .news-link-aesthetic {
    color: #ffffff !important;
    text-shadow: 0 0 1px rgba(255, 255, 255, 0.1);
}

/* Hover Mode Gelap: Indigo Terang */
[data-theme="dark"] .news-link-aesthetic:hover {
    color: #818cf8 !important; /* Indigo yang lebih cerah untuk kontras gelap */
}

/* Styling tambahan untuk info tanggal di bawah link */
.news-date-sub {
    font-size: 0.65rem;
    color: var(--text-muted);
    margin-top: 4px;
    display: flex;
    align-items: center;
    gap: 4px;
}
