/* Admin Panel Styles */
:root {
    /* Primary Colors */
    --primary-color: #4361ee;
    --primary-hover: #3a56d4;
    --secondary-color: #3a0ca3;
    --accent-color: #4cc9f0;
    
    /* Status Colors */
    --success-color: #2ecc71;
    --info-color: #00b4d8;
    --warning-color: #ff9e00;
    --danger-color: #e63946;
    
    /* Grayscale */
    --light-color: #f8f9fa;
    --light-gray: #e9ecef;
    --medium-gray: #6c757d;
    --dark-color: #212529;
    
    /* Backgrounds */
    --body-bg: #f5f7fa;
    --card-bg: #ffffff;
    
    /* Borders */
    --border-color: #dee2e6;
    
    /* Sidebar */
    --sidebar-bg: #2c3e50;
    --sidebar-text: #e9ecef;
    --sidebar-hover: #34495e;
    --sidebar-active: #4361ee;
    
    /* Header */
    --header-bg: #ffffff;
    --header-text: #212529;
    
    /* Buttons */
    --btn-text: #ffffff;
    
    /* Shadows */
    --shadow-sm: 0 0.125rem 0.25rem rgba(0, 0, 0, 0.075);
    --shadow: 0 0.5rem 1rem rgba(0, 0, 0, 0.15);
    --shadow-lg: 0 1rem 3rem rgba(0, 0, 0, 0.175);
    
    /* Sizing */
    --sidebar-width: 250px;
    --header-height: 60px;
    --border-radius: 0.375rem;
    --transition: all 0.2s ease-in-out;
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    background-color: var(--body-bg);
    color: var(--dark-color);
    line-height: 1.6;
    overflow-x: hidden;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

/* Wrapper */
.wrapper {
    display: flex;
    min-height: 100vh;
    width: 100%;
    align-items: stretch;
}

/* Sidebar */
#sidebar {
    min-width: var(--sidebar-width);
    max-width: var(--sidebar-width);
    height: 100vh;
    background: var(--sidebar-bg);
    color: var(--sidebar-text);
    transition: var(--transition);
    position: fixed;
    left: 0;
    top: 0;
    z-index: 1000;
    display: flex;
    flex-direction: column;
    box-shadow: var(--shadow);
    overflow-y: auto;
}

#sidebar.collapsed {
    margin-left: calc(-1 * var(--sidebar-width));
    box-shadow: none;
}

#sidebar .sidebar-header {
    padding: 1.25rem 1.5rem;
    background: rgba(0, 0, 0, 0.1);
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
    min-height: var(--header-height);
}

#sidebar .sidebar-header h3 {
    color: white;
    font-weight: 700;
    font-size: 1.25rem;
    margin: 0;
    line-height: 1.2;
}

#sidebar .sidebar-header small {
    display: block;
    font-size: 0.75rem;
    opacity: 0.8;
    margin-top: 0.25rem;
}

.sidebar-logo {
    width: 36px;
    height: 36px;
    border-radius: 8px;
    margin-right: 0.75rem;
    object-fit: cover;
}

#sidebar .sidebar-header h3 {
    font-size: 1.5rem;
    color: #fff;
    margin: 0;
    line-height: 1.2;
}

#sidebar .sidebar-header .btn {
    color: rgba(255, 255, 255, 0.7);
    padding: 0.25rem 0.5rem;
    font-size: 1.25rem;
}

#sidebar .sidebar-header .btn:hover {
    color: #fff;
}

/* Sidebar Search */
.sidebar-search {
    padding: 15px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}

.sidebar-search .input-group {
    background: rgba(255, 255, 255, 0.1);
    border-radius: 4px;
    overflow: hidden;
}

.sidebar-search .form-control {
    background: transparent;
    border: none;
    color: #fff;
    padding: 0.5rem 0.75rem;
}

.sidebar-search .form-control::placeholder {
    color: rgba(255, 255, 255, 0.5);
}

.sidebar-search .input-group-text {
    background: transparent;
    border: none;
    color: rgba(255, 255, 255, 0.5);
    padding: 0.5rem 0.75rem;
}

/* Sidebar Menu */
.sidebar-menu {
    flex: 1;
    overflow-y: auto;
    padding: 15px 0;
}

#sidebar ul.components {
    padding: 0;
    margin: 0;
}

#sidebar ul li {
    position: relative;
}

#sidebar ul li a {
    padding: 12px 20px;
    font-size: 0.95rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
    color: rgba(255, 255, 255, 0.8);
    text-decoration: none;
    transition: all 0.2s ease;
    border-left: 3px solid transparent;
}

#sidebar ul li a:hover,
#sidebar ul li.active > a {
    background: rgba(255, 255, 255, 0.1);
    color: #fff;
    border-left-color: var(--primary-color);
}

#sidebar ul li.active > a .menu-text,
#sidebar ul li a:hover .menu-text {
    transform: translateX(3px);
}

.menu-item-content {
    display: flex;
    align-items: center;
    transition: transform 0.2s ease;
}

.menu-text {
    margin-left: 12px;
    transition: transform 0.2s ease;
}

#sidebar ul li a i {
    width: 20px;
    text-align: center;
    font-size: 1.1rem;
}

/* Dropdown Menus */
#sidebar ul ul {
    background: rgba(0, 0, 0, 0.15);
    padding: 5px 0;
}

#sidebar ul ul a {
    padding: 8px 20px 8px 50px;
    font-size: 0.9rem !important;
}

#sidebar ul ul a i {
    font-size: 0.6rem;
    margin-right: 8px;
    opacity: 0.7;
}

#sidebar ul ul a:hover,
#sidebar ul ul a.active {
    background: rgba(0, 0, 0, 0.2);
    color: #fff;
    border-left-color: transparent;
}

/* Dropdown Arrows */
.dropdown-arrow {
    transition: transform 0.3s ease;
    font-size: 0.7rem;
    opacity: 0.7;
}

a[aria-expanded="true"] .dropdown-arrow {
    transform: rotate(90deg);
}

/* Badges */
#sidebar .badge {
    font-size: 0.65rem;
    font-weight: 500;
    padding: 0.25em 0.6em;
    line-height: 1.2;
}

/* Sidebar Footer */
.sidebar-footer {
    padding: 15px;
    background: rgba(0, 0, 0, 0.2);
    border-top: 1px solid rgba(255, 255, 255, 0.05);
}

.user-info {
    display: flex;
    align-items: center;
    position: relative;
}

.user-avatar {
    position: relative;
    margin-right: 12px;
}

.user-avatar img {
    width: 40px;
    height: 40px;
    object-fit: cover;
}

.user-status {
    position: absolute;
    bottom: 0;
    right: 0;
    width: 10px;
    height: 10px;
    border-radius: 50%;
    border: 2px solid var(--secondary-color);
}

.user-status.online {
    background: var(--success-color);
}

.user-status.offline {
    background: var(--secondary);
}

.user-status.away {
    background: var(--warning);
}

.user-details h6 {
    color: #fff;
    margin: 0;
    font-size: 0.95rem;
}

.user-details small {
    font-size: 0.75rem;
    color: rgba(255, 255, 255, 0.6);
    display: block;
    margin-top: 2px;
}

/* Mobile Overlay */
.sidebar-overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.5);
    z-index: 999;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.sidebar-overlay.active {
    display: block;
    opacity: 1;
}

/* Collapsed State */
#sidebar.collapsed {
    margin-left: calc(-1 * var(--sidebar-width));
}

#content.collapsed {
    margin-left: 0;
}

/* Content */
/* Main Content */
#content {
    width: 100%;
    min-height: 100vh;
    margin-left: var(--sidebar-width);
    transition: var(--transition);
    position: relative;
    background-color: var(--body-bg);
    display: flex;
    flex-direction: column;
}

#content.collapsed {
    margin-left: 0;
    width: 100%;
}

/* Responsive Adjustments */
@media (max-width: 991.98px) {
    #sidebar {
        margin-left: calc(-1 * var(--sidebar-width));
        z-index: 1000;
        box-shadow: var(--shadow-lg);
    }
    
    #sidebar.active {
        margin-left: 0;
    }
    
    #content {
        margin-left: 0;
        width: 100%;
    }
    
    #content.collapsed {
        margin-left: 0;
    }
    
    .sidebar-overlay {
        display: block;
        opacity: 0;
        visibility: hidden;
        transition: opacity 0.3s ease, visibility 0.3s ease;
    }
    
    .sidebar-overlay.active {
        opacity: 1;
        visibility: visible;
    }
}

/* Navbar */
.navbar {
    padding: 15px 20px;
    background: #fff;
    border: none;
    border-radius: 0;
    box-shadow: 1px 1px 3px rgba(0, 0, 0, 0.1);
}

.navbar-btn {
    box-shadow: none;
    outline: none !important;
    border: none;
}

/* Cards */
.card {
    border: none;
    border-radius: 10px;
    box-shadow: 0 0.125rem 0.25rem rgba(0, 0, 0, 0.075);
    margin-bottom: 20px;
    transition: transform 0.3s;
}

.card:hover {
    transform: translateY(-5px);
}

.card-header {
    background-color: #fff;
    border-bottom: 1px solid rgba(0, 0, 0, 0.05);
    padding: 15px 20px;
    border-top-left-radius: 10px !important;
    border-top-right-radius: 10px !important;
}

/* Buttons */
.btn {
    border-radius: 5px;
    padding: 8px 15px;
    font-weight: 500;
    transition: all 0.3s;
}

.btn-primary {
    background-color: var(--primary-color);
    border-color: var(--primary-color);
}

.btn-primary:hover {
    background-color: #2980b9;
    border-color: #2980b9;
}

/* Tables */
.table {
    margin-bottom: 0;
}

.table thead th {
    border-top: none;
    border-bottom: 1px solid #e9ecef;
    font-weight: 600;
    text-transform: uppercase;
    font-size: 0.75rem;
    letter-spacing: 0.5px;
}

/* Badges */
.badge {
    padding: 5px 10px;
    font-weight: 500;
    border-radius: 4px;
}

/* Responsive */
@media (max-width: 768px) {
    #sidebar {
        margin-left: calc(-1 * var(--sidebar-width));
    }
    #sidebar.active {
        margin-left: 0;
    }
    #content {
        width: 100%;
        margin-left: 0;
    }
    #content.active {
        margin-left: var(--sidebar-width);
    }
}

/* Custom Scrollbar */
::-webkit-scrollbar {
    width: 5px;
    height: 5px;
}

::-webkit-scrollbar-track {
    background: #f1f1f1;
}

::-webkit-scrollbar-thumb {
    background: #888;
    border-radius: 5px;
}

::-webkit-scrollbar-thumb:hover {
    background: #555;
}

/* Login Page */
.login-container {
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 100vh;
    background-color: #f5f6fa;
}

.login-card {
    width: 100%;
    max-width: 400px;
    padding: 30px;
    border-radius: 10px;
    box-shadow: 0 0.5rem 1rem rgba(0, 0, 0, 0.15);
    background-color: #fff;
}

.login-logo {
    text-align: center;
    margin-bottom: 30px;
}

.login-logo img {
    max-height: 60px;
}

/* Forms */
.form-control:focus {
    border-color: var(--primary-color);
    box-shadow: 0 0 0 0.2rem rgba(52, 152, 219, 0.25);
}

/* Custom file input */
.custom-file-label::after {
    content: "Browse";
}

/* Image preview */
.image-preview {
    margin-top: 15px;
    text-align: center;
}

.image-preview img {
    max-width: 100%;
    max-height: 200px;
    border-radius: 5px;
}

/* Dashboard Stats */
.stats-card {
    border-left: 4px solid;
    transition: all 0.3s;
}

.stats-card.primary {
    border-left-color: var(--primary-color);
}

.stats-card.success {
    border-left-color: var(--success-color);
}

.stats-card.warning {
    border-left-color: var(--warning-color);
}

.stats-card.danger {
    border-left-color: var(--danger-color);
}

/* Activity Feed */
.activity-item {
    position: relative;
    padding-left: 30px;
    padding-bottom: 20px;
    border-left: 2px solid #e9ecef;
    margin-left: 15px;
}

.activity-item:last-child {
    padding-bottom: 0;
}

.activity-item::before {
    content: '';
    position: absolute;
    width: 12px;
    height: 12px;
    border-radius: 50%;
    left: -7px;
    background-color: var(--primary-color);
    top: 0;
}

.activity-item .activity-time {
    font-size: 0.8rem;
    color: #6c757d;
}

/* Custom Tabs */
.nav-tabs .nav-link {
    border: none;
    color: #6c757d;
    font-weight: 500;
    padding: 10px 20px;
}

.nav-tabs .nav-link.active {
    color: var(--primary-color);
    border-bottom: 2px solid var(--primary-color);
    background: transparent;
}

/* Custom Checkbox */
.custom-control-input:checked ~ .custom-control-label::before {
    background-color: var(--primary-color);
    border-color: var(--primary-color);
}

/* Custom Switch */
.custom-switch .custom-control-input:checked ~ .custom-control-label::before {
    background-color: var(--primary-color);
    border-color: var(--primary-color);
}

/* Alert */
.alert {
    border: none;
    border-radius: 5px;
    padding: 12px 20px;
}

.alert-dismissible .btn-close {
    padding: 0.75rem 1rem;
}

/* Pagination */
.pagination .page-link {
    color: var(--primary-color);
}

.pagination .page-item.active .page-link {
    background-color: var(--primary-color);
    border-color: var(--primary-color);
}

/* Custom Select */
.custom-select:focus {
    border-color: var(--primary-color);
    box-shadow: 0 0 0 0.2rem rgba(52, 152, 219, 0.25);
}

/* Custom File Input */
.custom-file-input:focus ~ .custom-file-label {
    border-color: var(--primary-color);
    box-shadow: 0 0 0 0.2rem rgba(52, 152, 219, 0.25);
}

.custom-file-label::after {
    background-color: #e9ecef;
    border-left: 1px solid #ced4da;
    color: #495057;
}

/* Toast Notifications */
.toast {
    border: none;
    border-radius: 5px;
    box-shadow: 0 0.5rem 1rem rgba(0, 0, 0, 0.15);
}

.toast-header {
    border-bottom: none;
    background-color: #fff;
    border-top-left-radius: 5px;
    border-top-right-radius: 5px;
}

.toast-body {
    padding: 1rem;
}

/* Tooltips */
.tooltip-inner {
    background-color: var(--dark-color);
    padding: 5px 10px;
    font-size: 0.8rem;
}

.bs-tooltip-auto[data-popper-placement^=top] .tooltip-arrow::before, 
.bs-tooltip-top .tooltip-arrow::before {
    border-top-color: var(--dark-color);
}

/* Popovers */
.popover {
    border: none;
    border-radius: 5px;
    box-shadow: 0 0.5rem 1rem rgba(0, 0, 0, 0.15);
}

.popover-header {
    background-color: #f8f9fa;
    border-bottom: 1px solid #e9ecef;
    font-weight: 600;
}

/* Custom Range */
.custom-range:focus::-webkit-slider-thumb {
    box-shadow: 0 0 0 1px #fff, 0 0 0 0.2rem rgba(52, 152, 219, 0.25);
}

.custom-range:focus::-moz-range-thumb {
    box-shadow: 0 0 0 1px #fff, 0 0 0 0.2rem rgba(52, 152, 219, 0.25);
}

.custom-range:focus::-ms-thumb {
    box-shadow: 0 0 0 1px #fff, 0 0 0 0.2rem rgba(52, 152, 219, 0.25);
}

/* Custom Checkbox and Radio */
.custom-control-input:focus ~ .custom-control-label::before {
    box-shadow: 0 0 0 0.2rem rgba(52, 152, 219, 0.25);
}

.custom-control-input:checked ~ .custom-control-label::before {
    background-color: var(--primary-color);
    border-color: var(--primary-color);
}

/* Custom Switch */
.custom-switch .custom-control-input:checked ~ .custom-control-label::before {
    background-color: var(--primary-color);
    border-color: var(--primary-color);
}

/* Spinners */
.spinner-border {
    width: 1.5rem;
    height: 1.5rem;
    border-width: 0.2em;
}

/* Close Button */
.close {
    color: #6c757d;
    text-shadow: none;
    opacity: 0.7;
    transition: all 0.3s;
}

.close:hover {
    color: #343a40;
    opacity: 1;
}

/* Text Colors */
.text-primary {
    color: var(--primary-color) !important;
}

.text-secondary {
    color: var(--secondary-color) !important;
}

.text-success {
    color: var(--success-color) !important;
}

.text-info {
    color: var(--info-color) !important;
}

.text-warning {
    color: var(--warning-color) !important;
}

.text-danger {
    color: var(--danger-color) !important;
}

/* Background Colors */
.bg-primary {
    background-color: var(--primary-color) !important;
}

.bg-secondary {
    background-color: var(--secondary-color) !important;
}

.bg-success {
    background-color: var(--success-color) !important;
}

.bg-info {
    background-color: var(--info-color) !important;
}

.bg-warning {
    background-color: var(--warning-color) !important;
}

.bg-danger {
    background-color: var(--danger-color) !important;
}
