﻿/* Unified sidebar and navbar styles with improved structure */
:root {
    --sidebar-width: 250px;
    --navbar-height: 60px;
    --primary-color: #45aaf2;
    --primary-dark-color: #3867d6;
}

/* Layout wrapper to coordinate sidebar and content */
.layout-wrapper {
    display: flex;
    min-height: 100vh;
    width: 100%;
}

/* Sidebar styling */
.sidebar {
    height: 100vh;
    width: var(--sidebar-width);
    position: fixed;
    z-index: 1031;
    top: 0;
    left: 0;
    background-color: var(--primary-color);
    overflow-x: hidden;
    padding-top: 0; /* Remove navbar padding */
    transition: transform 0.3s ease;
    box-shadow: 0 0 10px rgba(0,0,0,0.1);
}

.dark-mode .sidebar {
    background-color: var(--primary-dark-color);
    box-shadow: 0 0 10px rgba(0,0,0,0.3);
}

/* Sidebar header with logo */
.sidebar-brand {
    color: white;
    padding: 15px;
    text-align: center;
    font-size: 24px;
    font-weight: bold;
    height: var(--navbar-height);
    display: flex;
    align-items: center;
    justify-content: center;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

/* Menu items */
.sidebar .nav-link {
    padding: 12px 15px;
    text-decoration: none;
    font-size: 16px;
    color: rgba(255, 255, 255, 0.9);
    display: flex;
    align-items: center;
    transition: 0.3s;
    border-left: 3px solid transparent;
}

    .sidebar .nav-link:hover {
        background-color: rgba(255, 255, 255, 0.1);
        border-left: 3px solid white;
        color: white;
    }

    .sidebar .nav-link i {
        margin-right: 10px;
        width: 20px;
        text-align: center;
        font-size: 18px;
    }

    /* Active menu item */
    .sidebar .nav-link.active {
        background-color: rgba(255, 255, 255, 0.2);
        color: white;
        border-left: 3px solid white;
        font-weight: 500;
    }

/* Menu label styling */
.sidebar .menu-label {
    font-size: 12px;
    font-weight: 600;
    text-transform: uppercase;
    color: rgba(255, 255, 255, 0.7);
    padding: 15px 15px 5px;
    letter-spacing: 0.5px;
    margin-top: 10px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

    /* First menu label should have less top margin */
    .sidebar .menu-label:first-of-type {
        margin-top: 0;
    }

/* Sidebar footer for theme toggle and logout */
.sidebar-footer {
    position: absolute;
    bottom: 0;
    width: 100%;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
}

    .sidebar-footer .nav-link {
        padding: 12px 15px;
        margin-bottom: 0;
    }

/* Top navbar modifications */
.top-navbar {
    position: fixed;
    top: 0;
    right: 0;
    left: var(--sidebar-width); /* Start after sidebar */
    height: var(--navbar-height);
    z-index: 1032; /* Higher than sidebar */
    background-color: var(--primary-color);
    transition: 0.3s;

}

.dark-mode .top-navbar {
    background-color: var(--primary-dark-color);

}

/* Content area */
.content-wrapper {
    flex: 1;
    margin-left: var(--sidebar-width);
    padding-top: var(--navbar-height);
    transition: margin-left 0.3s ease;
    width: calc(100% - var(--sidebar-width));
}

.body-content {
    padding: 20px;
    max-width: 1200px;
    margin: 0 auto;
}

/* Mobile responsive adjustments */
@media (max-width: 768px) {
    .sidebar {
        transform: translateX(-100%);
    }

        .sidebar.active {
            transform: translateX(0);
        }

    .content-wrapper {
        margin-left: 0;
        width: 100%;
    }

    .top-navbar {
        left: 0;
    }

    .container {
        max-width: 100%;
        padding-left: 15px;
        padding-right: 15px;
        width: 100%;
    }

    .row {
        margin-left: 0;
        margin-right: 0;
    }

    /* Ensure all columns have proper padding */
    .col, .col-1, .col-10, .col-11, .col-12, .col-2, .col-3, .col-4,
    .col-5, .col-6, .col-7, .col-8, .col-9, .col-auto, .col-lg, .col-lg-1,
    .col-lg-10, .col-lg-11, .col-lg-12, .col-lg-2, .col-lg-3, .col-lg-4,
    .col-lg-5, .col-lg-6, .col-lg-7, .col-lg-8, .col-lg-9, .col-lg-auto,
    .col-md, .col-md-1, .col-md-10, .col-md-11, .col-md-12, .col-md-2,
    .col-md-3, .col-md-4, .col-md-5, .col-md-6, .col-md-7, .col-md-8,
    .col-md-9, .col-md-auto, .col-sm, .col-sm-1, .col-sm-10, .col-sm-11,
    .col-sm-12, .col-sm-2, .col-sm-3, .col-sm-4, .col-sm-5, .col-sm-6,
    .col-sm-7, .col-sm-8, .col-sm-9, .col-sm-auto, .col-xl, .col-xl-1,
    .col-xl-10, .col-xl-11, .col-xl-12, .col-xl-2, .col-xl-3, .col-xl-4,
    .col-xl-5, .col-xl-6, .col-xl-7, .col-xl-8, .col-xl-9, .col-xl-auto {
        padding-right: 10px;
        padding-left: 10px;
    }
}

/* Sidebar toggle button */
.sidebar-toggle {
    font-size: 20px;
    cursor: pointer;
    padding: 10px;
    background: none;
    border: none;
    color: white;
}

/* Overlay for mobile when sidebar is open */
.sidebar-overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: rgba(0,0,0,0.4);
    z-index: 1030;
}

@media (max-width: 768px) {
    .sidebar-overlay.active {
        display: block;
    }
}

/* Card styling */
.card {
    border-radius: 8px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.05);
    margin-bottom: 20px;
}

.card-header {
    background-color: var(--primary-color);
    color: white;
    border-radius: 8px 8px 0 0 !important;
    font-weight: 500;
}

.dark-mode .card-header {
    background-color: var(--primary-dark-color);
}

/* Button styling */
.btn-primary {
    background-color: var(--primary-color);
    border-color: var(--primary-color);
}

    .btn-primary:hover {
        background-color: #3498db;
        border-color: #2980b9;
    }

.dark-mode .btn-primary {
    background-color: var(--primary-dark-color);
    border-color: #2c5bba;
}

    .dark-mode .btn-primary:hover {
        background-color: #2c5bba;
        border-color: #21489f;
    }

/* Login layout specific styles */
.login-layout {
    padding-left: 0 !important;
    padding-top: 0 !important;
}

.login-navbar {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    height: var(--navbar-height);
    z-index: 1030;
    background-color: var(--primary-color);
    box-shadow: 0 0 10px rgba(0,0,0,0.1);
}

.dark-mode .login-navbar {
    background-color: var(--primary-dark-color);
}

.login-container {
    display: flex;
    flex-direction: column;
    min-height: 100vh;
    padding-top: var(--navbar-height);
}

.login-content {
    flex: 1;
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 20px;
}

.login-form-container {
    width: 100%;
    max-width: 580px;
    background-color: #ffffff;
    border-radius: 8px;
    box-shadow: 0 2px 15px rgba(0,0,0,0.1);
    overflow: hidden;
}

.dark-mode .login-form-container {
    background-color: #343a40;
    box-shadow: 0 2px 15px rgba(0,0,0,0.3);
}

.login-form-header {
    background-color: var(--primary-color);
    color: white;
    padding: 15px;
    text-align: center;
    font-size: 24px;
    font-weight: 500;
}

.dark-mode .login-form-header {
    background-color: var(--primary-dark-color);
}

.login-form-body {
    padding: 20px;
}

.login-footer {
    text-align: center;
    padding: 15px;
    background-color: #f8f9fa;
    border-top: 1px solid #e9ecef;
}

.dark-mode .login-footer {
    background-color: #212529;
    border-top: 1px solid #343a40;
    color: #f8f9fa;
}
