/* ========================
   CSS Variables (Themes)
   ======================== */
:root {
    /* Light Mode (Default without data-theme attribute) */
    --bg-gradient: linear-gradient(135deg, #f8f9fa 0%, #e9ecef 100%);
    --text-main: #2b2d42;
    --text-muted: rgba(43, 45, 66, 0.7);
    --glass-bg: rgba(255, 255, 255, 0.85);
    --glass-border: rgba(0, 0, 0, 0.08);
    --glass-hover: rgba(255, 255, 255, 1);
    --table-border: rgba(43, 45, 66, 0.1);
    --table-hover: rgba(255, 255, 255, 0.8);
    --icon-gradient: linear-gradient(135deg, #d90429, #2b2d42);
    --box-shadow: 0 4px 15px rgba(0, 0, 0, 0.05);
    --btn-glass: rgba(255, 255, 255, 0.9);
    --sidebar-icon: #d90429;
    --input-bg: rgba(255, 255, 255, 0.95);
    --input-border: rgba(43, 45, 66, 0.15);
}

[data-theme="dark"] {
    /* Dark Mode */
    --bg-gradient: linear-gradient(45deg, #1a1a2e, #16213e, #0f3460, #e94560);
    --text-main: #ffffff;
    --text-muted: rgba(255, 255, 255, 0.6);
    --glass-bg: rgba(255, 255, 255, 0.05);
    --glass-border: rgba(255, 255, 255, 0.1);
    --glass-hover: rgba(255, 255, 255, 0.15);
    --table-border: rgba(255, 255, 255, 0.1);
    --table-hover: rgba(255, 255, 255, 0.1);
    --icon-gradient: linear-gradient(135deg, #e94560, #0f3460);
    --box-shadow: 0 4px 30px rgba(0, 0, 0, 0.2);
    --btn-glass: rgba(255, 255, 255, 0.1);
    --sidebar-icon: #e94560;
    --input-bg: rgba(0, 0, 0, 0.2);
    --input-border: rgba(255, 255, 255, 0.2);
}

/* ========================
   Global Styles
   ======================== */
body {
    font-family: 'Poppins', sans-serif;
    background: var(--bg-gradient);
    background-size: 400% 400%;
    animation: gradientBG 15s ease infinite;
    color: var(--text-main);
    min-height: 100vh;
    margin: 0;
    overflow-x: hidden;
    transition: background 0.5s ease, color 0.5s ease;
}

@keyframes gradientBG {
    0% { background-position: 0% 50%; }
    50% { background-position: 100% 50%; }
    100% { background-position: 0% 50%; }
}

/* ========================
   Glassmorphism Elements
   ======================== */
.glass-panel {
    background: var(--glass-bg);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border: 1px solid var(--glass-border);
    border-radius: 24px;
    box-shadow: var(--box-shadow);
    padding: 24px;
    transition: background 0.4s cubic-bezier(0.4, 0, 0.2, 1), border 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

.glass-sidebar {
    height: 95vh;
    position: sticky;
    top: 2.5vh;
}

h1, h2, h3, h4, h5, h6 { font-weight: 600; }
.text-muted-custom { color: var(--text-muted) !important; transition: color 0.3s ease; }

/* Navigation */
.nav-link {
    color: var(--text-main);
    opacity: 0.8;
    border-radius: 10px;
    margin-bottom: 5px;
    transition: all 0.3s ease;
}
.nav-link:hover, .nav-link.active {
    background: var(--glass-hover);
    opacity: 1;
    transform: translateX(5px);
}

/* Tables */
.table {
    color: var(--text-main);
    margin-top: 15px;
}
.table tbody tr {
    transition: background 0.3s;
}
.table tbody tr:hover {
    background: var(--table-hover);
}
.table th, .table td {
    background: transparent !important;
    border-bottom: 1px solid var(--table-border);
    padding: 15px 10px;
    color: var(--text-main);
}
.table thead th {
    color: var(--text-muted);
    font-weight: 500;
    border-bottom: 2px solid var(--table-border);
}

/* Buttons */
.btn-glass {
    background: var(--btn-glass);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border: 1px solid var(--text-muted);
    color: var(--text-main);
    border-radius: 20px; /* iOS pill-like */
    padding: 0.6rem 1.5rem;
    box-shadow: 0 4px 6px rgba(0,0,0,0.05);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    font-weight: 600;
    letter-spacing: 0.3px;
}
.btn-glass:hover {
    background: var(--glass-hover);
    color: var(--text-main);
    transform: scale(1.02);
    box-shadow: 0 6px 12px rgba(0,0,0,0.1);
}
.theme-toggle-btn {
    border-radius: 50%;
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0;
}

/* Stat Cards */
.stat-card {
    display: flex;
    align-items: center;
}
.stat-icon {
    font-size: 2.5rem;
    margin-right: 15px;
    background: var(--icon-gradient);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}
.sidebar-logo {
    font-size: 2rem; 
    color: var(--sidebar-icon);
    transition: color 0.3s ease;
}

/* Mini Icons for lists */
.icon-box {
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 10px;
    background: var(--glass-hover);
    border: 1px solid var(--glass-border);
}

/* Forms */
.form-control, .form-select {
    background: var(--input-bg);
    border: 1px solid var(--input-border);
    color: var(--text-main);
    padding: 0.8rem 1.2rem;
    border-radius: 14px;
    box-shadow: inset 0 2px 4px rgba(0,0,0,0.03);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}
.form-control:focus, .form-select:focus {
    background: var(--input-bg);
    border-color: var(--text-main);
    color: var(--text-main);
    box-shadow: 0 0 0 3px rgba(100, 100, 100, 0.1);
}
.form-control::placeholder {
    color: var(--text-muted);
}
