/* 
  STUDYTOUR - Aesthetic 2026 
  Global UI/UX Overhaul CSS
*/

@import url('https://fonts.googleapis.com/css2?family=Plus+Jakarta+Sans:wght@400;500;600;700;800&display=swap');

:root {
    --brand-primary: #6366f1; /* Indigo */
    --brand-secondary: #a855f7; /* Purple */
    --brand-accent: #ec4899; /* Pink */
    
    --bg-main: #FAF9F6; /* Putih Gading (Off-white/Ivory hangat) */
    --sidebar-glass: rgba(37, 99, 235, 0.95); /* Biru Profesional (Blue 600) */
    --sidebar-text: #eff6ff; /* Blue 50 */
    --sidebar-text-hover: #ffffff; /* Putih bersih */
    
    --card-glass-bg: rgba(255, 255, 255, 0.7);
    --card-glass-border: rgba(255, 255, 255, 0.5);
    --card-shadow: 0 8px 32px 0 rgba(31, 38, 135, 0.05);
    
    --gradient-vibrant: linear-gradient(135deg, var(--brand-primary), var(--brand-secondary));
    --gradient-hero: linear-gradient(135deg, #4f46e5 0%, #7c3aed 100%);
    
    --font-heading: 'Plus Jakarta Sans', sans-serif;
}

body {
    background-color: var(--bg-main) !important;
    background-image: none; /* Menghilangkan gradasi gelap/abu-abu sebelumnya */
    font-family: 'Inter', sans-serif;
}

h1, h2, h3, h4, h5, h6, .fw-bold {
    font-family: var(--font-heading);
    letter-spacing: -0.02em;
}

/* Sidebar Overrides (Biru Profesional) */
.sidebar {
    background: var(--sidebar-glass) !important;
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border-right: 1px solid rgba(255,255,255,0.1);
    box-shadow: 4px 0 25px rgba(37, 99, 235, 0.2) !important;
}

/* Mengembalikan warna teks judul ke putih */
.sidebar h4.text-white {
    color: #ffffff !important; 
}
.sidebar .small.text-uppercase {
    color: #93c5fd !important; /* Blue 300 */
}

.sidebar .nav-link {
    color: var(--sidebar-text) !important;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1) !important;
    border-radius: 12px !important;
}

.sidebar .nav-link:hover {
    color: var(--sidebar-text-hover) !important;
    background: rgba(255, 255, 255, 0.08) !important;
    transform: translateX(8px) !important;
}

.sidebar .nav-link.active {
    background: #ffffff !important; /* Latar putih untuk kontras dengan sidebar biru */
    color: #2563eb !important; /* Teks biru agar sesuai dengan sidebar */
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1) !important;
    transform: translateX(8px) !important;
    font-weight: 700 !important;
}

/* Memperjelas Garis Pembatas (Separator) di Sidebar */
.sidebar hr {
    border-color: rgba(255, 255, 255, 0.2) !important;
    opacity: 1 !important;
    margin: 20px 0 !important;
}

/* Mengembalikan warna merah pada tombol Logout */
.sidebar .nav-link.text-danger {
    color: #fca5a5 !important; /* Merah muda (Red 300) agar terlihat di atas biru */
}
.sidebar .nav-link.text-danger:hover {
    color: #ffffff !important;
    background: rgba(239, 68, 68, 0.8) !important; /* Merah solid saat disentuh */
}

/* Card Overrides (Glassmorphism Light) */
.card-custom {
    background: var(--card-glass-bg) !important;
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border: 1px solid var(--card-glass-border) !important;
    box-shadow: var(--card-shadow) !important;
    border-radius: 20px !important;
}

/* KPI Card Vibrant Gradients (Warna Meriah & Teks Kontras) */
.kpi-card {
    border-radius: 24px !important;
    padding: 24px !important;
    color: #FFFFFF !important;
    position: relative;
    overflow: hidden;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    border: 1px solid rgba(255, 255, 255, 0.25) !important;
}
.kpi-card * {
    color: #FFFFFF !important;
}
.kpi-card .text-white-50 {
    color: rgba(255, 255, 255, 0.8) !important;
}
.kpi-card:hover {
    transform: translateY(-5px) scale(1.02);
}

.kpi-card.card-indigo {
    background: linear-gradient(135deg, #3730A3 0%, #6366F1 100%) !important;
    box-shadow: 0 15px 30px -5px rgba(99, 102, 241, 0.4) !important;
}
.kpi-card.card-emerald {
    background: linear-gradient(135deg, #047857 0%, #10B981 100%) !important;
    box-shadow: 0 15px 30px -5px rgba(16, 185, 129, 0.4) !important;
}
.kpi-card.card-amber {
    background: linear-gradient(135deg, #B45309 0%, #F59E0B 100%) !important;
    box-shadow: 0 15px 30px -5px rgba(245, 158, 11, 0.4) !important;
}
.kpi-card.card-rose {
    background: linear-gradient(135deg, #BE123C 0%, #F43F5E 100%) !important;
    box-shadow: 0 15px 30px -5px rgba(244, 63, 94, 0.4) !important;
}

.modal-content {
    background: #ffffff !important; /* Modal solid untuk mencegah bug stacking context */
    border-radius: 20px !important;
    border: 1px solid var(--card-glass-border) !important;
    box-shadow: 0 10px 40px rgba(0,0,0,0.1) !important;
}

/* Buttons */
.btn-primary {
    background: var(--gradient-vibrant) !important;
    border: none !important;
    box-shadow: 0 4px 15px rgba(99, 102, 241, 0.3) !important;
    transition: all 0.3s ease !important;
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(99, 102, 241, 0.5) !important;
}

/* Custom 2026 Classes */
.text-gradient {
    background: var(--gradient-vibrant);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.hero-header {
    background: var(--gradient-hero);
    border-radius: 24px;
    padding: 40px;
    color: white;
    box-shadow: 0 20px 40px rgba(79, 70, 229, 0.25);
    position: relative;
    z-index: 10;
    margin-bottom: 40px;
    overflow: hidden;
}

.hero-header::before {
    content: '';
    position: absolute;
    top: -50%;
    right: -20%;
    width: 60%;
    height: 200%;
    background: radial-gradient(circle, rgba(255,255,255,0.15) 0%, rgba(255,255,255,0) 70%);
    transform: rotate(30deg);
    pointer-events: none;
}

.kpi-card-2026 {
    background: white;
    border-radius: 24px;
    padding: 30px;
    position: relative;
    overflow: hidden;
    transition: all 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    border: 1px solid rgba(0,0,0,0.02);
    box-shadow: 0 10px 30px rgba(0,0,0,0.03);
    z-index: 1;
}

.kpi-card-2026:hover {
    transform: translateY(-10px);
    box-shadow: 0 20px 40px rgba(0,0,0,0.08);
}

.kpi-card-2026::after {
    content: '';
    position: absolute;
    top: 0;
    right: 0;
    width: 150px;
    height: 150px;
    border-radius: 50%;
    filter: blur(40px);
    z-index: -1;
    opacity: 0.15;
}

.kpi-card-primary::after { background: var(--brand-primary); }
.kpi-card-success::after { background: #10b981; }
.kpi-card-warning::after { background: #f59e0b; }

.kpi-icon-wrapper {
    width: 60px;
    height: 60px;
    border-radius: 18px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 28px;
}

.kpi-primary-icon { background: rgba(99, 102, 241, 0.1); color: var(--brand-primary); }
.kpi-success-icon { background: rgba(16, 185, 129, 0.1); color: #10b981; }
.kpi-warning-icon { background: rgba(245, 158, 11, 0.1); color: #f59e0b; }

/* Table Overrides */
.table-modern {
    background: transparent !important;
    border-collapse: separate;
    border-spacing: 0 6px; /* Memberi jarak antar baris */
}
.table-modern thead th {
    background-color: #4f46e5 !important; /* Warna selaras dengan Hero Header */
    border-bottom: none !important;
    color: #ffffff !important;
    font-weight: 700;
    text-transform: uppercase;
    font-size: 0.8rem;
    letter-spacing: 1px;
    padding: 16px;
    text-align: center; /* Rata tengah */
    border-radius: 8px; /* Tepi membulat agar terlihat seperti 'pills' modern */
    box-shadow: 0 4px 6px -1px rgba(79, 70, 229, 0.2);
}
.table-modern tbody tr {
    transition: all 0.3s ease;
    border-radius: 12px;
}
/* Zebra striping: Genap (Biru/Ungu sangat pudar), Ganjil (Putih) */
.table-modern tbody tr:nth-child(even) td {
    background-color: rgba(79, 70, 229, 0.03) !important;
}
.table-modern tbody tr:nth-child(odd) td {
    background-color: #ffffff !important;
}
/* Hover effect: Sedikit terangkat dengan bayangan warna hero */
.table-modern tbody tr:hover td {
    background-color: rgba(79, 70, 229, 0.06) !important;
}
.table-modern tbody tr:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 15px rgba(79, 70, 229, 0.08);
}
.table-modern tbody td {
    padding: 16px;
    vertical-align: middle;
    border-bottom: none !important;
    border-top: none !important;
}
/* Rounded corners untuk ujung kiri-kanan setiap baris */
.table-modern tbody td:first-child {
    border-top-left-radius: 12px;
    border-bottom-left-radius: 12px;
}
.table-modern tbody td:last-child {
    border-top-right-radius: 12px;
    border-bottom-right-radius: 12px;
}

/* Scrollbar sleek */
::-webkit-scrollbar {
    width: 8px;
    height: 8px;
}
::-webkit-scrollbar-track {
    background: transparent;
}
::-webkit-scrollbar-thumb {
    background: #cbd5e1;
    border-radius: 10px;
}
::-webkit-scrollbar-thumb:hover {
    background: #94a3b8;
}

/* ==========================================================================
   STUDYTOUR 2026 WORLD-CLASS MOBILE-FIRST UI/UX SYSTEM
   ========================================================================== */

/* Touch Target Ergonomics */
.btn, .nav-link, .form-control, .form-select, .seat-card-diagram, .room-card-box {
    min-height: 44px;
}
.btn-icon-touch {
    min-width: 44px;
    min-height: 44px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 12px;
}

/* Mobile Adaptive Table -> Card Stack Transformation */
@media (max-width: 767.98px) {
    .table-mobile-cards {
        display: block !important;
        border: none !important;
    }
    .table-mobile-cards thead {
        display: none !important;
    }
    .table-mobile-cards tbody {
        display: block !important;
    }
    .table-mobile-cards tbody tr {
        display: block !important;
        background: #ffffff !important;
        border-radius: 16px !important;
        padding: 16px !important;
        margin-bottom: 14px !important;
        box-shadow: 0 4px 15px rgba(0,0,0,0.05) !important;
        border: 1px solid #e2e8f0 !important;
    }
    .table-mobile-cards tbody td {
        display: flex !important;
        justify-content: space-between !important;
        align-items: center !important;
        padding: 8px 0 !important;
        border-bottom: 1px dashed #f1f5f9 !important;
        text-align: right !important;
        font-size: 0.9rem !important;
    }
    .table-mobile-cards tbody td:last-child {
        border-bottom: none !important;
        padding-top: 12px !important;
        justify-content: flex-end !important;
    }
    .table-mobile-cards tbody td::before {
        content: attr(data-label);
        font-weight: 700;
        text-transform: uppercase;
        font-size: 0.75rem;
        letter-spacing: 0.5px;
        color: #64748b;
        text-align: left;
        padding-right: 12px;
    }
    .table-mobile-cards tbody td .btn-group,
    .table-mobile-cards tbody td .mobile-action-buttons {
        width: 100%;
        display: flex;
        gap: 8px;
        justify-content: flex-end;
    }
}

/* Auto-Scaling Chassis Wrapper for 50-Seat Bus Diagram on Mobile */
.bus-chassis-wrapper {
    width: 100%;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    padding: 10px 0;
}
@media (max-width: 576px) {
    .bus-chassis-diagram {
        max-width: 100% !important;
        padding: 16px 10px 20px !important;
        border-width: 3px !important;
        border-radius: 28px 28px 18px 18px !important;
    }
    .seat-card-diagram {
        min-height: 52px !important;
        padding: 4px 2px !important;
        border-radius: 8px !important;
    }
    .seat-number-title {
        font-size: 0.95rem !important;
    }
    .crew-pill {
        padding: 6px 8px !important;
        font-size: 0.75rem !important;
    }
}

/* Mobile Bottom Sheet Modal Drawer System */
@media (max-width: 767.98px) {
    .modal-bottom-sheet .modal-dialog {
        margin: 0 !important;
        position: fixed !important;
        bottom: 0 !important;
        left: 0 !important;
        right: 0 !important;
        max-width: 100% !important;
        width: 100% !important;
        transform: translateY(100%);
        transition: transform 0.3s cubic-bezier(0.16, 1, 0.3, 1) !important;
    }
    .modal-bottom-sheet.show .modal-dialog {
        transform: translateY(0) !important;
    }
    .modal-bottom-sheet .modal-content {
        border-bottom-left-radius: 0 !important;
        border-bottom-right-radius: 0 !important;
        border-top-left-radius: 28px !important;
        border-top-right-radius: 28px !important;
        border: none !important;
        box-shadow: 0 -10px 40px rgba(0,0,0,0.2) !important;
        padding-bottom: env(safe-area-inset-bottom);
    }
    .modal-bottom-sheet .modal-header {
        position: relative;
        padding-top: 24px;
    }
    .modal-bottom-sheet .modal-header::before {
        content: '';
        position: absolute;
        top: 10px;
        left: 50%;
        transform: translateX(-50%);
        width: 40px;
        height: 4px;
        background: #cbd5e1;
        border-radius: 4px;
    }
}

/* Sticky Gender Filter Pill Bar (Hotel Suite Allocation) */
.sticky-gender-filter {
    position: sticky;
    top: 0;
    z-index: 1020;
    background: rgba(248, 250, 252, 0.9);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    padding: 12px 0;
    margin-bottom: 20px;
    border-bottom: 1px solid rgba(226, 232, 240, 0.8);
}
.gender-pill-btn {
    border-radius: 50px;
    padding: 10px 24px;
    font-weight: 700;
    font-size: 0.9rem;
    transition: all 0.25s ease;
    box-shadow: 0 4px 12px rgba(0,0,0,0.05);
}
.gender-pill-btn.active-putra {
    background: linear-gradient(135deg, #1E3A8A, #3B82F6) !important;
    color: white !important;
    box-shadow: 0 6px 18px rgba(59, 130, 246, 0.4) !important;
}
.gender-pill-btn.active-putri {
    background: linear-gradient(135deg, #831843, #EC4899) !important;
    color: white !important;
    box-shadow: 0 6px 18px rgba(236, 72, 153, 0.4) !important;
}

/* World-Class Typography & Tabular Numeric Alignment */
.font-monospace, table td, h2, h3, h4, h5, h6, .badge, .kpi-card h2, .kpi-card h3 {
    font-variant-numeric: tabular-nums !important;
    letter-spacing: -0.02em;
}

/* Floating Bulk Action Bar (World-Class Admin UX) */
#bulkActionBar {
    position: fixed;
    bottom: 24px;
    left: 50%;
    transform: translateX(-50%) translateY(120px);
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
    z-index: 1080;
    background: rgba(15, 23, 42, 0.95);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 50px;
    padding: 12px 28px;
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.3);
    transition: all 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
}
#bulkActionBar.show {
    opacity: 1;
    visibility: visible;
    pointer-events: auto;
    transform: translateX(-50%) translateY(0);
}

/* Glowing Pulse Animation for Active Bus Seat / Room Selection */
.pulse-my-seat, .pulse-my-room {
    animation: glowPulse 2s infinite;
}
@keyframes glowPulse {
    0% { box-shadow: 0 0 0 0 rgba(79, 70, 229, 0.7); }
    70% { box-shadow: 0 0 0 12px rgba(79, 70, 229, 0); }
    100% { box-shadow: 0 0 0 0 rgba(79, 70, 229, 0); }
}

