html, body {
    height: 100%;
    margin: 0;
    background-color: #f7f9fc;
}

#main-container {
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

#login-container {
    min-height: 65vh; /* Full viewport height for login page */
}

#logo-container {
    color: white;
    background-color: black;
    min-height: 35vh; /* Full viewport height for login page */
}

/* Ensure footer stays at bottom */
.main-content-wrapper {
    flex: 1;
    display: flex;
    flex-direction: column;
}

.content-area {
    flex: 1;
}

/* Active navigation link styling */
.navbar-nav .nav-link.active {
    color: #ffc107 !important; /* Bootstrap warning color */
    font-weight: 600;
    /* border-bottom: 2px solid #ffc107; */
    background-color: rgba(255, 193, 7, 0.1);
    border-radius: 4px 4px 0 0;
}

/* Hover effect for non-active nav links */
.navbar-nav .nav-link:not(.active):hover {
    color: #ffc107 !important;
    transition: color 0.3s ease;
}

/* Sidebar Styles */
.page-wrapper {
    display: flex;
    width: 100%;
    align-items: stretch;
}

#sidebar {
    min-width: 200px;
    max-width: 200px;
    position: fixed;
    height: 100%;
    background: #343a40;
    color: #fff;
    transition: all 0.3s;
}

#sidebar.active {
    min-width: 200px;
    max-width: 200px;
    text-align: left;
}

#sidebar .sidebar-header {
    padding: 20px;
    background: #212529;
    text-align: center;
    margin-bottom: 0;
    position: relative;
}

#sidebar .sidebar-header::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 15px;
    right: 15px;
    height: 1px;
    background-color: #495057;
    border: none;
}

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

#sidebar ul p {
    color: #fff;
    padding: 10px;
}

#sidebar ul li a {
    padding: 15px 20px;
    font-size: 1.1em;
    color: #adb5bd;
    text-decoration: none;
    
}

#sidebar ul li a:hover {
    color: #ffc107;
    background: #495057;
}

#sidebar ul li.active > a, a[aria-expanded="true"] {
    color: #fff;
    background: #ffc107;
}

#sidebar ul li a i {
    font-size: 1.2em;
    width: 20px;
}

#sidebar ul.CTAs a {
    font-size: 1.1em !important;
    border-radius: 5px;
    margin-bottom: 5px;
    padding: 15px 20px;
    color: #adb5bd;
    text-decoration: none;
}

#sidebar ul.CTAs a:hover {
    color: #ffc107;
    background: #495057;
}

#sidebar ul.CTAs a i {
    font-size: 1.2em;
    width: 20px;
}

#sidebar.active ul.CTAs a span {
    display: inline;
}

#content {
    width: 100%;
    padding: 0;
    padding-left: 200px; /* Increase padding to match sidebar width */
    min-height: 100vh;
    transition: all 0.3s;
    display: flex;
    flex-direction: column;
}

#content .container-fluid {
    padding-left: 0px;
    padding-right: 0px;
}

.main-content {
    flex: 1 0 auto;
}

footer {
    width: 100%;
}

/* Bottom Nav for Mobile */
.nav-bottom {
    display: none;
    position: fixed;
    bottom: 0;
    width: 100%;
    height: 65px; /* Increased height */
    box-shadow: 0 0 3px rgba(0, 0, 0, 0.2);
    background-color: #343a40;
    display: flex;
    overflow-x: auto;
    z-index: 1030;
}

.nav-bottom .nav-link {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    flex-grow: 1;
    min-width: 50px;
    white-space: nowrap;
    color: #adb5bd;
    font-size: 1.5rem; /* Increased icon size */
    -webkit-tap-highlight-color: transparent;
    transition: background-color 0.1s ease-in-out;
}

.nav-bottom .nav-link:hover {
    color: #ffc107;
}

.nav-bottom .nav-link.active {
    color: #ffc107;
}

@media (max-width: 768px) {
    #sidebar {
        display: none;
    }
    #content {
        width: 100%;
        padding-left: 0; /* Reset padding for mobile */
        padding-bottom: 60px; /* Reduced padding - just enough to clear bottom nav */
    }
    .nav-bottom {
        display: flex;
    }
    /* Ensure footer has proper spacing on mobile */
    footer {
        margin-bottom: 10px; /* Minimal margin */
    }
}

@media (min-width: 769px) {
    .nav-bottom {
        display: none;
    }
    
    /* Desktop sidebar layout with CTAs at bottom */
    #sidebar {
        display: flex;
        flex-direction: column;
    }
    
    #sidebar ul.components {
        flex-grow: 1; /* Takes up available space */
    }
    
    #sidebar ul.CTAs {
        margin-top: auto; /* Push to bottom */
        padding: 20px 0;
        position: relative; /* Enable absolute positioning for ::before */
    }

    #sidebar ul.CTAs::before {
        content: '';
        position: absolute;
        top: 0;
        left: 15px;
        right: 15px;
        height: 1px;
        background-color: #495057;
        border: none;
    }
}

/* Dashboard Styles */
.stats-card {
    transition: none; /* Removed transform animation */
    border: none;
    box-shadow: 0 2px 8px rgba(0,0,0,0.08);
}

.minimal-card {
    border: none;
    box-shadow: 0 2px 8px rgba(0,0,0,0.08);
    border-radius: 12px;
}

.chart-container {
    position: relative;
    height: 250px;
}

.period-stats {
    background: #ffffff; /* Changed to white background */
}

.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 1rem;
}

/* Fixed position alerts/notifications */
.alert.position-fixed {
    top: 20px;
    right: 20px;
    z-index: 9999;
    min-width: 300px;
    max-width: 400px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    border: none;
    border-radius: 8px;
}

/* For mobile devices, center the alerts */
@media (max-width: 768px) {
    .alert.position-fixed {
        top: 20px;
        left: 50%;
        right: auto;
        transform: translateX(-50%);
        min-width: 280px;
        max-width: 90vw;
    }
}

/* Autocomplete Styles */
.autocomplete-container {
    position: relative;
    width: 100%;
}

.autocomplete-dropdown {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    z-index: 1050;
    background: white;
    border: 1px solid #dee2e6;
    border-radius: 0 0 0.375rem 0.375rem;
    box-shadow: 0 0.125rem 0.25rem rgba(0, 0, 0, 0.075);
    max-height: 200px;
    overflow-y: auto;
    display: none;
}

.autocomplete-dropdown.show {
    display: block;
}

.autocomplete-item {
    padding: 0.5rem 0.75rem;
    cursor: pointer;
    border-bottom: 1px solid #f8f9fa;
    transition: background-color 0.15s ease-in-out;
}

.autocomplete-item:hover,
.autocomplete-item.active {
    background-color: #f8f9fa;
    color: #495057;
}

.autocomplete-item:last-child {
    border-bottom: none;
}

.autocomplete-item.active {
    background-color: #e9ecef;
    font-weight: 500;
}