/* Google Fonts */
@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700&family=Playfair+Display:wght@700&display=swap');

:root {
    /* DARK MODE (Native) */
    --bg-body: #0f172a;        /* Slate 900 */
    --bg-card: #1e293b;        /* Slate 800 */
    --bg-sidebar: #1e293b;
    --bg-navbar: rgba(30, 41, 59, 0.8);
    --bg-input: rgba(15, 23, 42, 0.6);

    --text-primary: #f8fafc;   /* Slate 50 */
    --text-secondary: #94a3b8; /* Slate 400 */
    --text-muted: #64748b;     /* Slate 500 */

    --border-color: rgba(212, 175, 55, 0.2);
    --glass-border: rgba(255, 255, 255, 0.08);

    --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.1);
    --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.3);
    --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.5);

    --gold-primary: #d4af37;
    --gold-hover: #bfa130;
    --gold-light: #f3e5ab;
    --gold-accent: linear-gradient(135deg, #d4af37 0%, #aa8c2c 100%);
    
    --shadow-gold: 0 4px 14px 0 rgba(212, 175, 55, 0.3);
}

/* No Light Mode Overrides needed here */

body {
    font-family: 'Inter', sans-serif;
    background-color: var(--bg-body);
    color: var(--text-primary);
    line-height: 1.6;
    margin: 0;
    padding: 0;
    overflow-x: hidden;
    transition: background-color 0.3s ease, color 0.3s ease;
}

h1,
h2,
h3,
h4,
h5,
h6 {
    font-family: 'Inter', sans-serif;
    /* Keep Inter for UI, maybe Playfair for special headers? */
    color: var(--text-primary);
    margin-top: 0;
}

a {
    color: var(--gold-primary);
    text-decoration: none;
    transition: color 0.2s ease;
}

a:hover {
    color: var(--gold-light);
}

/* Layout Containers */
/* Layout Containers */
.page-content {
    display: flex;
    min-height: 100vh;
    flex-grow: 1;
    position: relative;
    background: radial-gradient(circle at top right, var(--bg-sidebar), var(--bg-body));
}

.content-wrapper {
    flex: 1;
    display: flex;
    flex-direction: column;
    width: 100%;
    overflow: hidden;
}

/* Mobile Sidebar Logic moved to end of file for priority */


/* Sidebar Toggler Icons (Gold) */
.sidebar-mobile-toggler {
    background-color: #0f172a;
    border-bottom: 1px solid var(--gold-primary);
    display: flex;
    /* Ensure flex properties are maintained */
    justify-content: space-between;
    align-items: center;
    padding: 0.5rem 1rem;
}

.sidebar-mobile-toggler a,
.sidebar-mobile-toggler i {
    color: var(--gold-primary) !important;
}

.sidebar-mobile-toggler a:hover {
    color: #fff !important;
    text-shadow: 0 0 8px var(--gold-primary);
}

/* Navbar / Header */
.navbar {
    background: var(--bg-navbar) !important; /* Force Premium Dark */
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border-bottom: 1px solid var(--gold-primary) !important;
    box-shadow: var(--shadow-md);
}

/* Sidebar */
.sidebar {
    background: var(--bg-sidebar);
    border-right: 1px solid var(--border-color);
    backdrop-filter: blur(10px);
}

.sidebar-content {
    color: var(--text-secondary);
}

.nav-sidebar .nav-item-header {
    color: var(--gold-primary);
    /* Gold header for sections */
    text-transform: uppercase;
    font-size: 0.75rem;
    letter-spacing: 0.05em;
    margin-top: 1rem;
}

.nav-sidebar .nav-link {
    color: var(--text-secondary);
    transition: all 0.3s ease;
    border-left: 3px solid transparent;
}

/* Sidebar Mobile Toggler (Top Bar inside sidebar) */
.sidebar-mobile-toggler {
    background-color: var(--bg-body);
    color: #fff;
    border-bottom: 1px solid var(--glass-border);
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.5rem 1rem;
}

.sidebar-mobile-toggler a {
    color: var(--gold-primary) !important;
    /* Gold icons */
    transition: all 0.2s ease;
}

.sidebar-mobile-toggler a:hover {
    color: #fff !important;
    text-shadow: 0 0 5px var(--gold-primary);
}

/* Ensure sidebar content visibility */
.sidebar-content {
    background: var(--bg-sidebar);
}

/* Navbar Toggle Button (Hamburguer) */
.navbar-toggler {
    display: inline-block;
    /* Horizonatal alignment */
    color: var(--gold-primary) !important;
    border: 1px solid var(--gold-primary) !important;
    padding: 0.5rem;
    margin-right: 0.5rem;
}

.navbar-toggler:focus {
    outline: none;
    box-shadow: 0 0 0 2px rgba(212, 175, 55, 0.3);
}

.nav-sidebar .nav-link:hover,
.nav-sidebar .nav-link.active {
    background-color: rgba(212, 175, 55, 0.1);
    border-left-color: var(--gold-primary);
}

.nav-sidebar .nav-link i {
    color: inherit;
    margin-right: 0.8rem;
}

/* Cards & Content */
.card {
    background: var(--bg-card);
    border: 1px solid var(--glass-border);
    border-radius: 16px;
    /* More rounded */
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.2);
    margin-bottom: 2rem;
    overflow: hidden;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.card:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.4), 0 0 15px rgba(212, 175, 55, 0.1);
    border-color: rgba(212, 175, 55, 0.3);
}

.card-header {
    background: transparent;
    /* Subtle lightness */
    border-bottom: 1px solid var(--glass-border);
    padding: 1.5rem;
}

/* Override Bootstrap colors for Dark Theme Harmony */
.bg-info {
    background-color: rgba(14, 165, 233, 0.2) !important;
    color: #38bdf8 !important;
    border: 1px solid rgba(14, 165, 233, 0.3);
}

.bg-success {
    background-color: rgba(16, 185, 129, 0.2) !important;
    color: #34d399 !important;
    border: 1px solid rgba(16, 185, 129, 0.3);
}

.bg-primary {
    background-color: rgba(212, 175, 55, 0.2) !important;
    color: var(--gold-primary) !important;
    border: 1px solid rgba(212, 175, 55, 0.3);
}

.bg-warning {
    background-color: rgba(245, 158, 11, 0.2) !important;
    color: #fbbf24 !important;
    border: 1px solid rgba(245, 158, 11, 0.3);
}

.card-title {
    font-size: 1.2rem;
    font-weight: 700;
    color: var(--text-primary);
    font-family: 'Playfair Display', serif;
    /* Premium font for titles */
}

.card-body {
    padding: 1.5rem;
    color: var(--text-secondary);
}

/* Buttons */
.btn {
    border-radius: 8px;
    font-weight: 500;
    padding: 0.6rem 1.2rem;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.btn-primary {
    background: var(--gold-accent);
    border: none;
    color: #fff;
    box-shadow: var(--shadow-gold);
}

.btn-primary:hover {
    background: linear-gradient(135deg, #bfa130 0%, #997b26 100%);
    box-shadow: 0 6px 20px rgba(212, 175, 55, 0.4);
    transform: translateY(-1px);
}

.btn-gold {
    background: var(--gold-accent);
    border: none;
    color: #fff;
    box-shadow: var(--shadow-gold);
    transition: all 0.3s ease;
}

.btn-gold:hover {
    background: linear-gradient(135deg, #bfa130 0%, #997b26 100%);
    box-shadow: 0 6px 20px rgba(212, 175, 55, 0.4);
    transform: translateY(-2px);
}

.bg-dark-glass {
    background: rgba(30, 41, 59, 0.7);
    backdrop-filter: blur(10px);
}

.border-glass {
    border: 1px solid var(--glass-border);
}

.border-bottom-glass {
    border-bottom: 1px solid var(--glass-border);
}

.bg-primary-10 {
    background-color: rgba(212, 175, 55, 0.1);
}

.bg-success-10 {
    background-color: rgba(16, 185, 129, 0.1);
}

.bg-warning-10 {
    background-color: rgba(245, 158, 11, 0.1);
}

.icon-2x {
    font-size: 2rem;
}


.btn-outline-light {
    border-color: rgba(255, 255, 255, 0.2);
    color: var(--text-primary);
}

.btn-outline-light:hover {
    background: rgba(255, 255, 255, 0.05);
    border-color: rgba(255, 255, 255, 0.4);
}

/* Forms */
.form-control {
    background-color: var(--bg-input);
    border: 1px solid var(--border-color);
    color: var(--text-primary);
    border-radius: 8px;
}

.form-control:focus {
    background-color: var(--bg-card);
    border-color: var(--gold-primary);
    box-shadow: 0 0 0 2px rgba(212, 175, 55, 0.2);
    color: var(--text-primary);
}

/* Tables */
.table {
    color: var(--text-secondary);
}

.table th {
    color: var(--text-primary);
    border-color: var(--glass-border);
    font-weight: 600;
}

.table td {
    border-color: var(--glass-border);
}

.table-hover tbody tr:hover {
    background-color: rgba(255, 255, 255, 0.02);
}

/* Alerts */
.alert {
    border: none;
    border-radius: 8px;
    color: #fff;
}

.alert-success {
    background-color: rgba(16, 185, 129, 0.2);
    border: 1px solid rgba(16, 185, 129, 0.4);
    color: #34d399;
}

.alert-warning {
    background: rgba(245, 158, 11, 0.2);
    border: 1px solid rgba(245, 158, 11, 0.4);
    color: #fbbf24;
}

/* Responsive Utilities */
@media (max-width: 768px) {
    /* .sidebar rule removed to avoid conflict with Robust Logic */

    .content-wrapper {
        padding-left: 0;
    }


    /* Full width on mobile */
    .content {
        padding: 10px !important;
    }

    .page-header-light {
        padding-left: 10px !important;
        padding-right: 10px !important;
    }

    .card {
        margin-bottom: 1rem;
        border-radius: 12px;
        /* Slightly less round on mobile to save space? or keep consistent */
    }

    .card-body {
        padding: 1rem;
        /* Reduce padding inside cards */
    }

    /* Reduce side margins for grid */
    .container-fluid,
    .container {
        padding-left: 5px;
        padding-right: 5px;
    }
}

/* Tables */
.table {
    background-color: var(--bg-card);
    color: var(--text-secondary);
}

.table th {
    background-color: rgba(15, 23, 42, 0.5);
    color: var(--text-primary);
    border-bottom: 2px solid var(--border-color);
}

.table td {
    border-top: 1px solid var(--glass-border);
}

.table-hover tbody tr:hover {
    background-color: rgba(212, 175, 55, 0.05);
}

.table-striped tbody tr:nth-of-type(odd) {
    background-color: rgba(255, 255, 255, 0.02);
}

/* Modals */
.modal-content {
    background-color: var(--bg-card);
    border: 1px solid var(--border-color);
    box-shadow: var(--shadow-gold);
}

.modal-header {
    border-bottom: 1px solid var(--glass-border);
}

.modal-title {
    color: var(--text-primary);
}

.modal-footer {
    border-top: 1px solid var(--glass-border);
}

.close {
    color: var(--text-secondary);
    text-shadow: none;
    opacity: 0.8;
}

.close:hover {
    color: var(--gold-primary);
    opacity: 1;
}

/* Breadcrumbs (Header Dropdown Style) */
.breadcrumb {
    background-color: var(--bg-card) !important;
    /* Match dropdown bg */
    border: 1px solid var(--gold-primary) !important;
    /* Gold border */
    padding: 0.75rem 1.25rem !important;
    margin-bottom: 1rem !important;
    border-radius: 0.5rem;
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.5);
    /* Match dropdown shadow */

    /* Single line layout */
    display: flex;
    flex-wrap: nowrap !important;
    overflow-x: auto;
    white-space: nowrap;
    -webkit-overflow-scrolling: touch;
}

/* Hide scrollbar for breadcrumb */
.breadcrumb::-webkit-scrollbar {
    height: 0px;
    background: transparent;
}

.breadcrumb-item {
    font-size: 0.9rem;
    color: var(--text-muted) !important;
    /* Muted white */
    font-weight: 500;
}

.breadcrumb-item a {
    color: var(--text-primary) !important;
    /* White links */
    font-weight: 500;
    transition: all 0.2s ease;
}

.breadcrumb-item a:hover {
    color: var(--gold-primary) !important;
    /* Gold hover */
    text-decoration: none;
    text-shadow: 0 0 5px rgba(212, 175, 55, 0.5);
}

.breadcrumb-item+.breadcrumb-item::before {
    color: var(--gold-primary) !important;
    content: "/" !important;
    padding-right: 0.5rem;
    opacity: 0.5;
}

.breadcrumb-item.active {
    color: var(--gold-primary) !important;
    /* Active item gold */
    font-weight: 700;
}

/* Premium Typography */
.premium-overline {
    text-transform: uppercase;
    font-size: 0.75rem;
    /* font-size-xs */
    color: var(--text-muted);
    letter-spacing: 2px;
    display: block;
    margin-bottom: 0.25rem;
}

.premium-title {
    font-family: 'Playfair Display', serif;
    font-weight: 700;
    color: var(--text-primary);
    font-size: 1.75rem;
    /* Default mobile size */
    line-height: 1.2;
    margin-bottom: 0.25rem;
}

@media (min-width: 768px) {
    .premium-title {
        font-size: 2.5rem;
        /* Desktop size */
    }
}

.premium-subtitle {
    color: var(--gold-primary);
    font-size: 1rem;
    font-weight: 500;
    margin-top: 0;
}

/* Card Interactions */
.card-hover-lift {
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

/* Disable lift on mobile to prevent z-index/transform issues on touch */
@media (min-width: 992px) {
    .card-hover-lift:hover {
        transform: translateY(-5px);
        box-shadow: var(--shadow-gold);
        z-index: 10;
        /* Bring to front on hover */
        position: relative;
    }
}

/* Ensure dropdowns are visible */
.card {
    overflow: visible !important;
    /* Allow dropdowns to spill out */
}

/* Scrollable Tabs for Mobile */
@media (max-width: 768px) {
    .nav-tabs {
        flex-wrap: nowrap;
        overflow-x: auto;
        overflow-y: hidden;
        -webkit-overflow-scrolling: touch;
        border-bottom: 1px solid var(--glass-border);
        padding-bottom: 5px;
    }

    .nav-tabs .nav-link {
        white-space: nowrap;
        font-size: 0.9rem;
    }

    /* Hide scrollbar */
    .nav-tabs::-webkit-scrollbar {
        height: 4px;
        /* Visible but small scrollbar implies scrollability */
    }

    .nav-tabs::-webkit-scrollbar-thumb {
        background: var(--gold-primary);
        border-radius: 4px;
    }
}

/* Old breadcrumb styles removed - see Gold Breadcrumbs above */

/* Dropdowns */
.dropdown-menu {
    background-color: var(--bg-card) !important;
    /* Force dark background */
    border: 1px solid var(--gold-primary);
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.5);
    z-index: 1050;
    /* Ensure high z-index */
    min-width: 12rem;
}

.dropdown-item {
    color: var(--text-primary);
    /* Light text */
    padding: 0.75rem 1rem;
    transition: all 0.2s;
}

.dropdown-item:hover,
.dropdown-item:focus {
    background-color: rgba(212, 175, 55, 0.1);
    color: var(--gold-primary) !important;
}

.dropdown-divider {
    border-top-color: rgba(255, 255, 255, 0.1);
}


.dropdown-item {
    color: var(--text-secondary);
}

.dropdown-item:hover,
.dropdown-item:focus {
    background-color: rgba(212, 175, 55, 0.1);
    color: var(--gold-primary);
}

.dropdown-divider {
    border-top-color: var(--glass-border);
}

/* Pagination */
.page-item .page-link {
    background-color: var(--bg-card);
    border-color: var(--glass-border);
    color: var(--text-secondary);
}

.page-item.active .page-link {
    background-color: var(--gold-primary);
    border-color: var(--gold-primary);
    color: #fff;
}

.page-item.disabled .page-link {
    background-color: transparent;
    border-color: var(--glass-border);
    color: var(--text-muted);
}

/* =========================================
   PREMIUM SIDEBAR (APP2) LOGIC
   ========================================= */

/* General Styles */
.premium-sidebar {
    background-color: var(--bg-sidebar);
    border-right: 1px solid var(--border-color);
    display: flex;
    flex-direction: column;
    width: 17rem;
    min-width: 17rem;
    z-index: 100;
}

.premium-sidebar-mobile-header {
    display: none;
    /* Hidden on desktop */
    padding: 1rem;
    border-bottom: 1px solid var(--gold-primary);
    background-color: var(--bg-body);
    justify-content: space-between;
    align-items: center;
}

.premium-sidebar-content {
    flex: 1;
    overflow-y: auto;
    overflow-x: hidden;
}

/* Mobile Logic */
@media (max-width: 768px) {
    .premium-sidebar {
        position: fixed !important;
        top: 0;
        bottom: 0;
        left: -100% !important;
        /* Hidden */
        height: 100vh;
        z-index: 9999;
        transition: left 0.3s cubic-bezier(0.4, 0, 0.2, 1);
        box-shadow: none;
        width: 85%;
        /* Wider on mobile */
        max-width: 300px;
    }

    .premium-sidebar-mobile-header {
        display: flex;
        /* Visible on mobile */
    }

    /* Open State */
    .sidebar-mobile-main .premium-sidebar {
        left: 0 !important;
        /* Slide In */
        box-shadow: 10px 0 50px rgba(0, 0, 0, 0.5);
    }

    /* Backdrop */
    .sidebar-mobile-main .content-wrapper::before {
        content: '';
        position: fixed;
        top: 0;
        left: 0;
        right: 0;
        bottom: 0;
        background: rgba(0, 0, 0, 0.6);
        z-index: 9000;
        backdrop-filter: blur(3px);
    }
}

/* Scrollbar for sidebar */
.premium-sidebar-content::-webkit-scrollbar {
    width: 4px;
}

.premium-sidebar-content::-webkit-scrollbar-thumb {
    background: var(--bg-card);
}

.premium-sidebar-content:hover::-webkit-scrollbar-thumb {
    background: var(--gold-primary);
}

/* Global Gold Utilities (Migrated from inline styles) */
.text-gold-primary {
    color: var(--gold-primary) !important;
}

.border-gold {
    border-color: var(--gold-primary) !important;
}

/* Ensure badge-flat works with custom colors */
.badge-flat.border-gold {
    background-color: transparent;
    border: 1px solid var(--gold-primary);
    color: var(--gold-primary);
}

/* Match Event Icons (Flyer style) */
.card-icon {
    font-size: 0.8rem;
    margin: 0 2px;
    display: inline-block;
    width: 10px;
    height: 13px;
    border-radius: 2px;
    border: 1px solid rgba(0, 0, 0, 0.2);
    box-shadow: 1px 1px 2px rgba(0, 0, 0, 0.5);
    vertical-align: middle;
}

.card-yellow {
    background-color: #ffeb3b;
}

.card-red {
    background-color: #f44336;
}

/* =========================================
   PREMIUM BREADCRUMB NAVIGATION - COMPACT INLINE
   ========================================= */

.breadcrumb-premium {
    background: transparent;
    border: none;
    margin-top: 0.5rem;
    margin-left: 0.5rem;
    margin-right: 0.9rem;
}

.breadcrumb-premium .breadcrumb {
    background: transparent;
    margin-bottom: 0;
    padding: 0;
    border: none !important;
}

.breadcrumb-premium .breadcrumb-item {
    color: rgba(255, 255, 255, 0.6);
    font-size: 0.85rem;
}

.breadcrumb-premium .breadcrumb-item + .breadcrumb-item::before {
    content: "›";
    color: rgba(212, 175, 55, 0.5);
    font-size: 1rem;
    padding: 0 0.4rem;
}

.breadcrumb-premium .breadcrumb-item.active {
    color: #d4af37;
    font-weight: 500;
}

.breadcrumb-premium .breadcrumb-item a {
    color: rgba(255, 255, 255, 0.7);
    text-decoration: none;
    transition: all 0.2s ease;
}

.breadcrumb-premium .breadcrumb-item a:hover {
    color: #d4af37;
}

.breadcrumb-actions {
    display: flex;
    gap: 0.5rem;
    align-items: center;
}

.breadcrumb-toggle {
    background: transparent;
    border: 1px solid rgba(212, 175, 55, 0.3);
    color: #d4af37;
    padding: 0.25rem 0.5rem;
    border-radius: 4px;
    font-size: 0.85rem;
    transition: all 0.2s ease;
}

.breadcrumb-toggle:hover {
    background: rgba(212, 175, 55, 0.1);
    border-color: rgba(212, 175, 55, 0.5);
    color: #d4af37;
    text-decoration: none;
}

@media (max-width: 767.98px) {
    .breadcrumb-premium {
        display: none;
    }
}