/* ==========================================================================
   SEPTALABS VIRTUAL TOUR - PREMIUM BACKEND OVERRIDE (HIGH-CLASS MODERN)
   v2 — BUG-FIXED: Tidak ada transform hover pada card (konflik modal z-index),
        overflow: visible untuk dropdown, topbar tanpa backdrop-filter stacking context
   ========================================================================== */

/* Import Google Fonts (Outfit & Inter) */
@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700&family=Outfit:wght@300;400;500;600;700&display=swap');

/* === BASE === */
body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif !important;
    background-color: #f4f6f9 !important;
    color: #2c3e50 !important;
    letter-spacing: -0.015em;
}

h1, h2, h3, h4, h5, h6, .h1, .h2, .h3, .h4, .h5, .h6, .sidebar-brand-text {
    font-family: 'Outfit', sans-serif !important;
    font-weight: 600 !important;
    letter-spacing: -0.025em;
}

/* =========================================================
   SIDEBAR
   ========================================================= */
#wrapper #content-wrapper {
    background-color: #f8f9fa !important;
}

.bg-gradient-primary {
    background-color: #0f172a !important;
    background-image: linear-gradient(180deg, #1e293b 10%, #0f172a 100%) !important;
    background-size: cover !important;
    border-right: 1px solid rgba(255, 255, 255, 0.05);
}

.sidebar .nav-item .nav-link {
    font-weight: 500;
    transition: background 0.2s ease, padding-left 0.2s ease;
    border-radius: 8px;
    margin: 2px 12px;
    padding: 10px 16px !important;
    width: auto !important;
}

.sidebar .nav-item .nav-link:hover {
    background: rgba(255, 255, 255, 0.1);
    /* NO transform — avoid creating stacking context in sidebar */
}

.sidebar .sidebar-brand {
    padding: 2rem 1rem !important;
    font-size: 1.15rem !important;
    text-transform: none !important;
    letter-spacing: -0.02em !important;
}

/* =========================================================
   TOPBAR — CRITICAL: No backdrop-filter to avoid stacking context
   backdrop-filter creates a new stacking context which traps modals
   Use box-shadow instead for the frosted glass effect
   ========================================================= */
.topbar {
    background: rgba(255, 255, 255, 0.97) !important;
    /* backdrop-filter intentionally REMOVED — it creates a stacking context
       that traps Bootstrap modals (z-index:1050) behind the topbar */
    border-bottom: 1px solid rgba(0,0,0,0.07) !important;
    box-shadow: 0 2px 12px rgba(0,0,0,0.06) !important;
    position: sticky;
    top: 0;
    z-index: 999 !important; /* below Bootstrap modal (z-index: 1050) */
}

/* =========================================================
   CARDS — CRITICAL: No overflow:hidden (breaks dropdowns/tooltips)
   and NO transform on hover (breaks modal stacking context)
   ========================================================= */
.card {
    border: none !important;
    border-radius: 14px !important;
    /* overflow: visible — allows dropdowns/selects to escape card boundaries */
    overflow: visible !important;
    box-shadow: 0 2px 12px rgba(0, 0, 0, 0.05), 0 1px 3px rgba(0,0,0,0.04) !important;
    transition: box-shadow 0.25s ease;
    background: #ffffff !important;
}

/* Hover: shadow only — NO transform (transform creates stacking context
   that can push cards above Bootstrap modal backdrop z-index:1040) */
.card:hover {
    box-shadow: 0 8px 28px rgba(0, 0, 0, 0.08), 0 2px 8px rgba(0,0,0,0.05) !important;
    /* transform: intentionally REMOVED */
}

/* Card body needs overflow visible so inner dropdowns work */
.card-body {
    padding: 1.25rem 1.5rem !important;
    overflow: visible !important;
}

.card-header {
    background-color: transparent !important;
    border-bottom: 1px solid rgba(0, 0, 0, 0.05) !important;
    padding: 1rem 1.5rem !important;
    overflow: visible !important;
}

.card-header h6 {
    font-size: 1rem;
    color: #1e293b !important;
}

/* =========================================================
   MODALS — Ensure proper z-index layering
   ========================================================= */
.modal {
    z-index: 1050 !important;
}
.modal-backdrop {
    z-index: 1040 !important;
}
.modal-dialog {
    /* Ensure modal dialog is above all card transforms */
    position: relative;
    z-index: auto;
}
.modal-content {
    border-radius: 14px !important;
    border: none !important;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.15), 0 4px 16px rgba(0,0,0,0.1) !important;
}
.modal-header {
    border-bottom: 1px solid rgba(0,0,0,0.07) !important;
    padding: 1.25rem 1.5rem !important;
    border-radius: 14px 14px 0 0 !important;
}
.modal-footer {
    border-top: 1px solid rgba(0,0,0,0.07) !important;
    padding: 1rem 1.5rem !important;
    border-radius: 0 0 14px 14px !important;
}

/* =========================================================
   BUTTONS — Sensible sizing, no aggressive padding override
   ========================================================= */
.btn {
    border-radius: 8px !important;
    font-weight: 500 !important;
    font-family: 'Inter', sans-serif !important;
    /* Intentionally no padding override — let btn-sm / btn-lg work correctly */
    transition: all 0.2s ease !important;
    letter-spacing: -0.01em;
}

.btn-primary {
    background-color: #3b82f6 !important;
    border-color: #3b82f6 !important;
    box-shadow: 0 2px 8px rgba(59, 130, 246, 0.25) !important;
}
.btn-primary:hover {
    background-color: #2563eb !important;
    border-color: #2563eb !important;
    box-shadow: 0 4px 12px rgba(59, 130, 246, 0.35) !important;
}

.btn-success {
    background-color: #10b981 !important;
    border-color: #10b981 !important;
    box-shadow: 0 2px 8px rgba(16, 185, 129, 0.25) !important;
}
.btn-success:hover {
    background-color: #059669 !important;
    border-color: #059669 !important;
    box-shadow: 0 4px 12px rgba(16, 185, 129, 0.35) !important;
}

.btn-danger {
    box-shadow: 0 2px 8px rgba(239, 68, 68, 0.25) !important;
}
.btn-danger:hover {
    box-shadow: 0 4px 12px rgba(239, 68, 68, 0.35) !important;
}

.btn-warning {
    box-shadow: 0 2px 8px rgba(245, 158, 11, 0.25) !important;
}
.btn-warning:hover {
    box-shadow: 0 4px 12px rgba(245, 158, 11, 0.35) !important;
}

/* =========================================================
   TABLES
   ========================================================= */
.table {
    color: #475569 !important;
}
.table thead th {
    font-family: 'Outfit', sans-serif !important;
    border-bottom: 2px solid #e2e8f0 !important;
    font-weight: 600;
    text-transform: uppercase;
    font-size: 0.78rem;
    letter-spacing: 0.05em;
    color: #64748b;
    padding: 0.875rem 1rem;
}
.table td {
    padding: 0.875rem 1rem;
    vertical-align: middle !important;
    border-bottom: 1px solid #f1f5f9 !important;
}

/* =========================================================
   FORMS & INPUTS — Corrected to not break bootstrap-select
   ========================================================= */
.form-control {
    border-radius: 8px !important;
    border: 1px solid #cbd5e1 !important;
    /* No padding override — bootstrap-select depends on default padding */
    font-size: 0.95rem;
    transition: border-color 0.2s ease, box-shadow 0.2s ease !important;
    background-color: #f8fafc !important;
    color: #1e293b !important;
}
.form-control:focus {
    background-color: #ffffff !important;
    border-color: #3b82f6 !important;
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.12) !important;
    color: #1e293b !important;
}

/* Bootstrap-select needs proper z-index above other elements */
.bootstrap-select .dropdown-menu {
    z-index: 1051 !important; /* above modal */
    border-radius: 10px !important;
    box-shadow: 0 8px 24px rgba(0,0,0,0.1) !important;
    border: 1px solid #e2e8f0 !important;
}
.bootstrap-select.dropup .dropdown-menu {
    z-index: 1051 !important;
}

/* Selectator dropdown */
.selectator_element + .selectator_container .selectator_dropdown {
    z-index: 1051 !important;
}

/* =========================================================
   DROPDOWNS — Always above everything except modals
   ========================================================= */
.dropdown-menu {
    border-radius: 10px !important;
    border: 1px solid #e2e8f0 !important;
    box-shadow: 0 8px 24px rgba(0,0,0,0.08) !important;
    font-size: 0.9rem;
    /* z-index intentionally left to Bootstrap default (1000) 
       which is below modal backdrop (1040) */
}

/* Topbar dropdown specifically needs z-index below modal */
.topbar .dropdown-menu {
    z-index: 1000 !important;
    border-radius: 12px !important;
    box-shadow: 0 10px 30px rgba(0,0,0,0.1) !important;
}

/* =========================================================
   TOOLTIPS — Must be above modals
   ========================================================= */
.help_t, .tooltip, .tooltipster-base {
    z-index: 3000 !important;
}

/* =========================================================
   RESPONSIVE
   ========================================================= */
@media (max-width: 768px) {
    .card {
        margin-bottom: 1.25rem !important;
    }
    .container-fluid {
        padding-left: 0.75rem !important;
        padding-right: 0.75rem !important;
    }
}
