/* 
 * BBFMS - Theme Stylesheet
 * Incorporating Light/Dark Mode Variables
 */

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

/* Color Variables */
:root {
    --bg-body: #f4f6f9;
    --bg-card: #ffffff;
    --bg-sidebar: #212529;
    --bg-sidebar-hover: #343a40;
    --text-primary: #212529;
    --text-secondary: #6c757d;
    --text-light: #f8f9fa;
    --border-color: #dee2e6;
    
    --primary-red: #d32f2f;
    --primary-red-hover: #b71c1c;
    --accent-red-light: rgba(211, 47, 47, 0.08);
    
    --shadow-sm: 0 .125rem .25rem rgba(0,0,0,.075);
    --shadow-md: 0 .5rem 1rem rgba(0,0,0,.08);
    --shadow-lg: 0 1rem 3rem rgba(0,0,0,.1);
}

/* Dark Mode Variables Override */
body.dark-mode {
    --bg-body: #121212;
    --bg-card: #1e1e1e;
    --bg-sidebar: #1a1a1a;
    --bg-sidebar-hover: #2d2d2d;
    --text-primary: #f8f9fa;
    --text-secondary: #a0a0a0;
    --border-color: #383838;
    
    --accent-red-light: rgba(211, 47, 47, 0.2);
    
    --shadow-sm: 0 .125rem .25rem rgba(0,0,0,.3);
    --shadow-md: 0 .5rem 1rem rgba(0,0,0,.4);
    --shadow-lg: 0 1rem 3rem rgba(0,0,0,.5);
}

/* Base resets */
body {
    font-family: 'Outfit', sans-serif;
    background-color: var(--bg-body);
    color: var(--text-primary);
    transition: background-color 0.3s ease, color 0.3s ease;
    min-height: 100vh;
}

/* Layout Wrapper */
.wrapper {
    display: flex;
    width: 100%;
    align-items: stretch;
}

/* Sidebar Styling */
#sidebar {
    min-width: 260px;
    max-width: 260px;
    background-color: var(--bg-sidebar);
    color: var(--text-light);
    transition: all 0.3s ease;
    box-shadow: var(--shadow-md);
    z-index: 999;
}

#sidebar .sidebar-header {
    padding: 20px;
    background-color: rgba(0, 0, 0, 0.2);
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}

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

#sidebar ul li a {
    padding: 12px 20px;
    font-size: 1.05rem;
    display: block;
    color: rgba(255, 255, 255, 0.7);
    text-decoration: none;
    transition: all 0.3s ease;
    border-left: 4px solid transparent;
}

#sidebar ul li a:hover,
#sidebar ul li.active a {
    color: #fff;
    background-color: var(--bg-sidebar-hover);
    border-left-color: var(--primary-red);
}

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

/* Main Content Area */
#content {
    width: 100%;
    padding: 25px;
    min-height: 100vh;
    transition: all 0.3s;
}

/* Cards */
.card {
    background-color: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    box-shadow: var(--shadow-sm);
    transition: all 0.3s ease;
}

.card:hover {
    box-shadow: var(--shadow-md);
}

.card-header {
    background-color: transparent;
    border-bottom: 1px solid var(--border-color);
    padding: 15px 20px;
    font-weight: 600;
}

/* Buttons Styling */
.btn-primary {
    background-color: var(--primary-red);
    border-color: var(--primary-red);
}

.btn-primary:hover, .btn-primary:focus, .btn-primary:active {
    background-color: var(--primary-red-hover) !important;
    border-color: var(--primary-red-hover) !important;
}

/* Navbar overrides */
.navbar {
    background-color: var(--bg-card) !important;
    border-bottom: 1px solid var(--border-color);
    box-shadow: var(--shadow-sm);
    padding: 15px 20px;
}

/* Notifications Badge Dropdown */
.notification-dropdown {
    width: 320px;
    max-height: 400px;
    overflow-y: auto;
    border-radius: 12px;
    border: 1px solid var(--border-color);
    box-shadow: var(--shadow-md);
}

.notification-item {
    padding: 12px 15px;
    border-bottom: 1px solid var(--border-color);
    transition: background-color 0.2s;
}

.notification-item:hover {
    background-color: var(--accent-red-light);
}

/* Stats Cards */
.stat-card {
    border-left: 5px solid var(--primary-red);
}

/* Custom list items */
.list-group-item {
    background-color: var(--bg-card);
    border-color: var(--border-color);
    color: var(--text-primary);
}

/* Forms controls */
.form-control, .form-select {
    background-color: var(--bg-card);
    border-color: var(--border-color);
    color: var(--text-primary);
}

.form-control:focus, .form-select:focus {
    background-color: var(--bg-card);
    color: var(--text-primary);
    border-color: var(--primary-red);
    box-shadow: 0 0 0 0.25rem rgba(211, 47, 47, 0.25);
}

/* Dark mode inputs tweak */
body.dark-mode .form-control:disabled, 
body.dark-mode .form-select:disabled {
    background-color: #2b2b2b;
    color: #888;
}

/* Mobile responsive toggles */
@media (max-width: 768px) {
    #sidebar {
        margin-left: -260px;
    }
    #sidebar.active {
        margin-left: 0;
    }
    #content {
        padding: 15px;
    }
}

/* Loading Spinner Overlay */
#loading-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    z-index: 9999;
    display: flex;
    justify-content: center;
    align-items: center;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.3s ease;
}

#loading-overlay.active {
    opacity: 1;
    pointer-events: all;
}

/* Custom theme indicators */
.text-red {
    color: var(--primary-red) !important;
}

.bg-red {
    background-color: var(--primary-red) !important;
}
