/* Custom Styles for Hall Booking App */
:root {
    /* Primary brand colors */
    --primary-color: #0d47a1;
    /* Deep Blue - Main Sidebar */
    --primary-light: #5472d3;
    --primary-dark: #002171;

    /* Semantic Colors */
    --success-color: #1cc88a;
    --info-color: #17a2b8;
    --warning-color: #f6c23e;
    --danger-color: #e74a3b;
    --secondary-color: #858796;

    /* Layout Colors */
    --dark-color: #2e384d;
    --light-color: #f8f9fc;
    --card-bg: #ffffff;
    --text-muted: #6c757d;
}

body {
    font-family: 'Nunito', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
    background-color: #f8f9fc;
}

/* Sidebar overrides (White Theme) */
/* Sidebar overrides (Dark Theme) */
.sidebar {
    background: var(--primary-color) !important;
    background: linear-gradient(180deg, var(--primary-color) 0%, var(--primary-dark) 100%) !important;
    color: #ffffff;
    border-right: none;
}

.sidebar .brand {
    color: #ffffff;
    font-weight: 800;
    padding: 1.5rem 1rem;
    text-align: center;
    font-size: 1.2rem;
    letter-spacing: 0.05rem;
    text-transform: uppercase;
}

.sidebar a {
    color: rgba(255, 255, 255, 0.8);
    font-weight: 500;
}

.sidebar a:hover,
.sidebar a.active {
    color: #ffffff;
    background-color: rgba(255, 255, 255, 0.1);
    border-left-color: #fff;
    font-weight: 700;
}

/* Dashboard Cards */
.card-stats {
    border: none;
    border-radius: 0.35rem;
    box-shadow: 0 0.15rem 1.75rem 0 rgba(58, 59, 69, 0.15);
    transition: transform 0.2s;
    background: #fff;
}

.card-stats:hover {
    transform: translateY(-5px);
}

.card-stats .text-xs {
    font-size: .7rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: .05rem;
}

.card-stats .h5 {
    font-size: 1.5rem;
    font-weight: 700;
    margin-bottom: 0;
    color: var(--dark-color);
}

.icon-circle {
    height: 3rem;
    width: 3rem;
    border-radius: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* Timeline */
.timeline {
    position: relative;
    padding: 0;
    list-style: none;
}

.timeline:before {
    content: '';
    position: absolute;
    top: 0;
    bottom: 0;
    left: 10px;
    width: 2px;
    background: #e3e6f0;
    margin-left: -1.5px;
}

.timeline-item {
    position: relative;
    margin-bottom: 1.5rem;
}

.timeline-marker {
    position: absolute;
    left: 0;
    width: 20px;
    height: 20px;
    border-radius: 50%;
    background-color: #fff;
    border: 3px solid #4e73df;
    z-index: 1;
}

.timeline-content {
    margin-left: 35px;
}

.timeline-title {
    font-weight: 700;
    font-size: 0.9rem;
    color: var(--dark-color);
}

.timeline-time {
    font-size: 0.75rem;
    color: var(--secondary-color);
}

/* Cards */
.card-header {
    background-color: #f8f9fc;
    border-bottom: 1px solid #e3e6f0;
}

/* Status Badges */
.badge-pending {
    background-color: #f6c23e;
    /* Warning yellow */
    color: #fff;
}

.badge-approved {
    background-color: #1cc88a;
    /* Success green */
    color: #fff;
}

.badge-rejected {
    background-color: #e74a3b;
    /* Danger red */
    color: #fff;
}

.badge-cancelled {
    background-color: #858796;
    /* Gray */
    color: #fff;
}

/* Custom Brand Styles */
.bg-deep-blue {
    background-color: var(--primary-color) !important;
}

.text-gold {
    color: var(--warning-color) !important;
}

.btn-primary-custom {
    background-color: var(--primary-color) !important;
    color: white !important;
    border: none;
    padding: 10px 25px;
    border-radius: 5px;
    transition: all 0.3s;
    font-weight: 600;
    display: inline-block;
}

.btn-primary-custom:hover {
    filter: brightness(0.9);
    transform: translateY(-2px);
    color: #fff !important;
}

.btn-primary-custom.btn-lg {
    padding: 12px 35px;
    font-size: 1.25rem;
}

/* Landing Page Hero Fixes */
.hero-section {
    padding: 80px 0;
    background-color: #fff;
}

/* User Dashboard & Sidebar Extras */
.user-sidebar {
    width: 260px;
    background-color: var(--primary-color);
    color: #fff;
    position: fixed;
    top: 0;
    bottom: 0;
    left: 0;
    z-index: 100;
    padding-top: 0;
}

.user-sidebar .nav-link {
    color: rgba(255, 255, 255, 0.9);
    padding: 12px 20px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
    font-size: 1.05rem;
}

.user-sidebar .nav-link:hover,
.user-sidebar .nav-link.active {
    background-color: var(--primary-light);
    color: #fff;
    border-left: 4px solid #fff;
}

.user-main-content {
    margin-left: 260px;
    padding: 20px;
}

.user-topbar {
    background-color: #fff;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
    height: 60px;
    margin-bottom: 25px;
    display: flex;
    align-items: center;
    justify-content: flex-end;
    padding: 0 30px;
}

/* Header & Public Nav */
.main-header {
    background: white;
    /* Box shadow removed for clean look, border-bottom used instead */
}

.logo-section img {
    /* Height handled inline or here */
    object-fit: contain;
}

.logo-text h1 {
    font-size: 1.5rem;
    font-weight: 800;
    margin: 0;
    line-height: 1.2;
    text-transform: uppercase;
}

.logo-text p {
    font-size: 0.9rem;
    color: #666;
    margin: 0;
    font-weight: 600;
}

.x-small {
    font-size: 0.75rem;
}

.navbar-custom {
    padding: 0;
    background: var(--primary-color);
    background: linear-gradient(90deg, var(--primary-color) 0%, var(--primary-dark) 100%);
}

.navbar-custom .nav-link {
    color: rgba(255, 255, 255, 0.9) !important;
    padding: 15px 20px !important;
    font-size: 1.1rem;
}

.navbar-custom .nav-link:hover {
    background-color: rgba(255, 255, 255, 0.1);
    color: #fff !important;
}

/* Admin Layout Sidebar & Topbar */
:root {
    --sidebar-width: 220px;
}

.sidebar {
    height: 100vh;
    width: var(--sidebar-width);
    position: fixed;
    top: 0;
    left: 0;
    z-index: 1000;
    padding-top: 0;
}

.sidebar a {
    padding: 15px 25px;
    text-decoration: none;
    font-size: 0.9rem;
    display: flex;
    align-items: center;
    border-left: 4px solid transparent;
    transition: all 0.2s;
    color: rgba(255, 255, 255, 0.7);
}

.topbar {
    background: var(--primary-color);
    background: linear-gradient(90deg, var(--primary-color) 0%, var(--primary-dark) 100%);
    height: 60px;
    margin-left: var(--sidebar-width);
    width: calc(100% - var(--sidebar-width));
    position: fixed;
    top: 0;
    z-index: 999;
    padding: 0 30px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    transition: margin 0.3s, width 0.3s;
    box-shadow: 0 0.15rem 1.75rem 0 rgba(58, 59, 69, 0.15);
}

.content-wrapper {
    margin-top: 70px;
}

.main-content {
    margin-left: var(--sidebar-width);
    padding: 25px;
    transition: margin 0.3s;
}

/* Global Table Sticky Headers */
.table-responsive {
    max-height: 80vh;
    overflow-y: auto;
}

.table thead th {
    position: sticky;
    top: 0;
    background-color: #f8f9fc;
    z-index: 1;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.1);
    color: var(--dark-color);
    font-weight: 700;
    border-top: none;
}

.table td,
.table th {
    padding: 1rem 0.75rem;
    vertical-align: middle;
}

/* Responsive Admin Layout */
@media (max-width: 768px) {
    .sidebar {
        width: 0;
        overflow: hidden;
    }

    .main-content,
    .topbar {
        margin-left: 0;
        width: 100%;
    }

    .sidebar.d-block {
        width: var(--sidebar-width);
    }
}

/* DARK MODE OVERRIDES */
[data-bs-theme="dark"] {
    /* Re-map variables for dark mode */
    --primary-color: #375a7f;
    /* Muted Blue */
    --primary-light: #4c6f93;
    --dark-color: #f8f9fc;
    /* Flip dark text to light */
    --light-color: #2c3034;
    /* Flip light bg to dark */
    --card-bg: #212529;
    /* Dark card bg */
    --text-muted: #adb5bd;
}

[data-bs-theme="dark"] body {
    background-color: #1a1d20;
    color: #e9ecef;
}

/* Cards int Dark Mode */
[data-bs-theme="dark"] .card,
[data-bs-theme="dark"] .card-stats,
[data-bs-theme="dark"] .card-header,
[data-bs-theme="dark"] .main-header,
[data-bs-theme="dark"] .user-topbar {
    background-color: var(--card-bg);
    color: #e9ecef;
    border-color: #373b3e;
}

[data-bs-theme="dark"] .card-stats .h5,
[data-bs-theme="dark"] .card-stats .text-xs {
    color: #e9ecef;
}

[data-bs-theme="dark"] .timeline:before {
    background: #373b3e;
}

[data-bs-theme="dark"] .timeline-marker {
    background-color: #212529;
    border-color: #375a7f;
}

[data-bs-theme="dark"] .timeline-title {
    color: #e9ecef;
}

/* Tables */
[data-bs-theme="dark"] .table {
    color: #e9ecef;
    border-color: #373b3e;
}

[data-bs-theme="dark"] .table thead th {
    background-color: #2c3034;
    color: #e9ecef;
    border-color: #373b3e;
}

/* Inputs */
[data-bs-theme="dark"] .form-control,
[data-bs-theme="dark"] .form-select {
    background-color: #2c3034;
    border-color: #373b3e;
    color: #e9ecef;
}

[data-bs-theme="dark"] .form-control:focus,
[data-bs-theme="dark"] .form-select:focus {
    background-color: #32383e;
    border-color: #5a7293;
    color: #fff;
}

/* Sidebar & Navbar updates for dark mode compatibility */
[data-bs-theme="dark"] .topbar {
    background: #212529;
    /* Darker topbar for admin */
    border-bottom: 1px solid #373b3e;
}

[data-bs-theme="dark"] .footer {
    background-color: #212529;
    color: #adb5bd;
    border-top-color: #375a7f;
}

[data-bs-theme="dark"] .logo-text h1 {
    color: #e9ecef;
}

[data-bs-theme="dark"] .logo-text p {
    color: #adb5bd;
}

[data-bs-theme="dark"] a {
    color: #6ea8fe;
}

[data-bs-theme="dark"] a:hover {
    color: #8bb9fe;
}


/* Mobile Responsive Sidebar */
@media (max-width: 768px) {
    .user-sidebar {
        transform: translateX(-100%);
        transition: transform 0.3s ease-in-out;
        width: 260px !important;
        /* Ensure generic width matches */
    }

    .user-sidebar.active {
        transform: translateX(0);
        box-shadow: 0 0 15px rgba(0, 0, 0, 0.2);
    }

    .user-main-content {
        margin-left: 0 !important;
        width: 100%;
    }

    .table-responsive {
        border: 0;
    }
}