/* Root Variables for Theming */
:root {
    --primary-color: #4e73df;
    --secondary-color: #858796;
    --success-color: #1cc88a;
    --info-color: #36b9cc;
    --warning-color: #f6c23e;
    --danger-color: #e74a3b;
    --dark-color: #5a5c69;
    --light-bg: #f8f9fc;
    --sidebar-bg: #222e3c;
    --sidebar-hover: #314256;
    --sidebar-text: rgba(255, 255, 255, 0.8);
    --card-bg: #ffffff;
    --text-color: #5a5c69;
    --border-color: #e3e6f0;
}

/* Dark Mode Variables */
[data-bs-theme="dark"] {
    --primary-color: #375a7f;
    --light-bg: #121212;
    --card-bg: #1e1e1e;
    --text-color: #e0e0e0;
    --border-color: #333333;
    --sidebar-bg: #0d1117;
    --sidebar-hover: #161b22;
}

body {
    font-family: 'Nunito', 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    background-color: var(--light-bg);
    color: var(--text-color);
    overflow-x: hidden;
}

/* Gradient Button */
.gradient-btn {
    background: linear-gradient(135deg, var(--primary-color) 0%, #2e59d9 100%);
    border: none;
    transition: transform 0.2s, box-shadow 0.2s;
}

.gradient-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(78, 115, 223, 0.4);
}

/* Login Page specific */
.login-body {
    background: linear-gradient(135deg, #f6f8fd 0%, #e9eef9 100%);
    position: relative;
}

.login-body::before {
    content: '';
    position: absolute;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background: radial-gradient(circle, rgba(78, 115, 223, 0.1) 0%, transparent 60%);
    z-index: -1;
    animation: rotate 30s linear infinite;
}

@keyframes rotate {
    from { transform: rotate(0deg); }
    to { transform: rotate(360deg); }
}

.login-card {
    border-radius: 1rem;
    overflow: hidden;
    transition: all 0.3s ease;
}

/* Loader */
.loader-container {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(255, 255, 255, 0.9);
    z-index: 9999;
    display: flex;
    justify-content: center;
    align-items: center;
}

[data-bs-theme="dark"] .loader-container {
    background-color: rgba(18, 18, 18, 0.9);
}

/* Dashboard Layout */
#wrapper {
    display: flex;
    width: 100%;
}

/* Sidebar */
#sidebar {
    width: 250px;
    min-height: 100vh;
    background-color: var(--sidebar-bg);
    color: var(--sidebar-text);
    transition: all 0.3s;
    z-index: 1000;
}

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

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

#sidebar ul li a {
    padding: 12px 20px;
    display: block;
    color: var(--sidebar-text);
    text-decoration: none;
    transition: 0.2s;
    font-weight: 500;
}

#sidebar ul li a i {
    width: 25px;
    text-align: center;
    margin-right: 10px;
}

#sidebar ul li a:hover,
#sidebar ul li.active > a {
    color: #fff;
    background: var(--sidebar-hover);
    border-left: 4px solid var(--primary-color);
}

/* Content Area */
#content {
    width: calc(100% - 250px);
    min-height: 100vh;
    transition: all 0.3s;
}

/* Top Navbar */
.top-navbar {
    background: var(--card-bg);
    box-shadow: 0 0.15rem 1.75rem 0 rgba(58, 59, 69, 0.15);
    padding: 0.5rem 1rem;
    z-index: 999;
}

[data-bs-theme="dark"] .top-navbar {
    box-shadow: 0 0.15rem 1.75rem 0 rgba(0, 0, 0, 0.5);
    border-bottom: 1px solid var(--border-color);
}

/* Cards */
.card {
    background-color: var(--card-bg);
    border: 1px solid var(--border-color);
    border-radius: 0.5rem;
    box-shadow: 0 0.15rem 1.75rem 0 rgba(58, 59, 69, 0.05);
}

.dashboard-card {
    transition: transform 0.2s;
    border-left: 4px solid var(--primary-color);
}

.dashboard-card:hover {
    transform: translateY(-5px);
}

.card-icon {
    font-size: 2.5rem;
    opacity: 0.3;
}

/* Tables */
.table {
    color: var(--text-color);
}

.table-responsive {
    border-radius: 0.5rem;
}

/* Utilities */
.glass-effect {
    background: rgba(255, 255, 255, 0.9);
    backdrop-filter: blur(10px);
}

[data-bs-theme="dark"] .glass-effect {
    background: rgba(30, 30, 30, 0.9);
}

/* Responsive */
@media (max-width: 768px) {
    #sidebar {
        margin-left: -250px;
        position: fixed;
        height: 100%;
    }
    #sidebar.active {
        margin-left: 0;
    }
    #content {
        width: 100%;
    }
}
