@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700&display=swap');

:root {
    /* Color Palette - Modern Glassmorphism & Dark Mode */
    --primary-color: #6366f1; /* Indigo */
    --primary-light: #818cf8;
    --primary-hover: #4f46e5;
    
    --accent-color: #10b981; /* Emerald */
    --accent-light: #34d399;
    
    --bg-main: #0f172a; /* Deep Dark Slate */
    
    /* Glassmorphism Variables */
    --glass-bg: rgba(30, 41, 59, 0.6);
    --glass-border: rgba(255, 255, 255, 0.1);
    --glass-highlight: rgba(255, 255, 255, 0.05);
    
    --bg-white: var(--glass-bg); /* Override for cards */
    --bg-light: var(--bg-main);
    
    --text-main: #f8fafc;
    --text-muted: #94a3b8;
    
    --border-color: rgba(255, 255, 255, 0.1);
    
    --danger: #ef4444;
    --success: #10b981;
    
    /* Typography */
    --font-heading: 'Inter', sans-serif;
    --font-body: 'Inter', sans-serif;
    
    /* Shadows & Radii */
    --shadow-sm: 0 4px 15px rgba(0, 0, 0, 0.1);
    --shadow-md: 0 8px 32px 0 rgba(0, 0, 0, 0.37);
    --shadow-lg: 0 12px 40px 0 rgba(0, 0, 0, 0.5);
    --radius-sm: 8px;
    --radius-md: 16px;
    --radius-lg: 24px;
    
    /* Backwards compatibility for old variables */
    --primary-deep-navy: var(--text-main);
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: var(--font-body);
    background-color: var(--bg-main);
    background-image: 
        radial-gradient(at 0% 0%, rgba(99, 102, 241, 0.15) 0px, transparent 50%),
        radial-gradient(at 100% 100%, rgba(16, 185, 129, 0.1) 0px, transparent 50%);
    background-attachment: fixed;
    color: var(--text-main);
    line-height: 1.6;
}

/* Custom Scrollbar */
::-webkit-scrollbar {
    width: 6px;
    height: 6px;
}

::-webkit-scrollbar-track {
    background: transparent;
}

::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.1);
    border-radius: 10px;
}

::-webkit-scrollbar-thumb:hover {
    background: rgba(255, 255, 255, 0.2);
}

/* Sidebar specific scrollbar hiding/styling if needed */
.sidebar-nav::-webkit-scrollbar {
    width: 4px;
}

h1, h2, h3, h4, h5, h6 {
    font-family: var(--font-heading);
    color: var(--text-main);
    margin-bottom: 0.5rem;
    font-weight: 700;
}

a {
    color: var(--primary-light);
    text-decoration: none;
    transition: color 0.3s ease;
}

a:hover {
    color: var(--accent-light);
}

/* Utilities */
.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
}

.text-center { text-align: center; }
.mt-1 { margin-top: 1rem; }
.mt-2 { margin-top: 2rem; }
.mb-1 { margin-bottom: 1rem; }
.mb-2 { margin-bottom: 2rem; }

/* Buttons */
.btn {
    display: inline-block;
    padding: 10px 20px;
    font-family: var(--font-body);
    font-weight: 600;
    border: none;
    border-radius: var(--radius-sm);
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    text-align: center;
    text-decoration: none;
}

.btn-primary {
    background: linear-gradient(135deg, var(--primary-color) 0%, var(--primary-hover) 100%);
    color: #fff;
    box-shadow: 0 4px 15px rgba(99, 102, 241, 0.3);
}

.btn-primary:hover {
    transform: translateY(-2px) scale(1.02);
    box-shadow: 0 6px 20px rgba(99, 102, 241, 0.5);
    color: #fff;
}

.btn-accent {
    background: linear-gradient(135deg, var(--accent-color) 0%, #059669 100%);
    color: #fff;
    box-shadow: 0 4px 15px rgba(16, 185, 129, 0.3);
}

.btn-accent:hover {
    transform: translateY(-2px) scale(1.02);
    box-shadow: 0 6px 20px rgba(16, 185, 129, 0.5);
    color: #fff;
}

/* Forms */
.form-group {
    margin-bottom: 1.5rem;
}

.form-label {
    display: block;
    margin-bottom: 0.5rem;
    font-weight: 500;
    color: var(--text-muted);
}

.form-control {
    width: 100%;
    max-width: 100%;
    box-sizing: border-box;
    padding: 12px 15px;
    font-family: var(--font-body);
    border: 1px solid var(--border-color);
    background: rgba(15, 23, 42, 0.5);
    color: var(--text-main);
    border-radius: var(--radius-sm);
    transition: all 0.3s ease;
}

.form-control:focus {
    outline: none;
    border-color: var(--primary-color);
    background: rgba(15, 23, 42, 0.8);
    box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.2);
}

::placeholder {
    color: rgba(255,255,255,0.3);
}

/* Alerts */
.alert {
    padding: 15px;
    border-radius: var(--radius-sm);
    margin-bottom: 20px;
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
}

.alert-danger {
    background-color: rgba(239, 68, 68, 0.2);
    color: #fca5a5;
    border: 1px solid #ef4444;
}

.alert-success {
    background-color: rgba(16, 185, 129, 0.2);
    color: #6ee7b7;
    border: 1px solid #10b981;
}

/* Dashboard Layout */
.app-wrapper {
    display: flex;
    min-height: 100vh;
}

/* Floating Glassmorphism Sidebar */
.sidebar {
    width: 250px;
    background: var(--glass-bg);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border: 1px solid var(--glass-border);
    border-radius: var(--radius-md);
    display: flex;
    flex-direction: column;
    margin: 20px;
    height: calc(100vh - 40px);
    box-shadow: var(--shadow-md);
    overflow: hidden;
}

.sidebar-header {
    padding: 20px;
    border-bottom: 1px solid var(--glass-border);
    text-align: center;
}

.sidebar-header h2 {
    color: var(--text-main);
    font-size: 20px;
    margin: 0;
    text-shadow: 0 0 10px rgba(255, 255, 255, 0.2);
}

.sidebar-nav {
    flex: 1;
    padding: 20px 15px;
    overflow-y: auto;
}

.sidebar-nav ul {
    list-style: none;
}

.sidebar-nav li a {
    display: block;
    padding: 12px 15px;
    color: var(--text-muted);
    transition: all 0.3s ease;
    border-radius: var(--radius-sm);
    margin-bottom: 5px;
    border: 1px solid transparent;
}

.sidebar-nav li a:hover {
    background: var(--glass-highlight);
    color: var(--text-main);
    border-color: var(--glass-border);
    transform: translateX(5px);
}

.sidebar-nav li a.active {
    background: rgba(99, 102, 241, 0.15);
    color: var(--primary-light);
    border: 1px solid rgba(99, 102, 241, 0.3);
    font-weight: 600;
}

.main-content {
    flex: 1;
    display: flex;
    flex-direction: column;
}

.topbar {
    background-color: transparent;
    padding: 30px 30px 20px;
    display: flex;
    justify-content: flex-end;
    align-items: center;
}

.topbar-right span {
    font-weight: 600;
}

.content-area {
    padding: 0 30px 30px;
    flex: 1;
    overflow-y: auto;
}

/* Glassmorphism Cards */
.card, .login-card {
    background: var(--glass-bg);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border: 1px solid var(--glass-border);
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-sm);
    padding: 25px;
    margin-bottom: 25px;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.login-container {
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 100vh;
    padding: 20px;
}

.login-card {
    width: 100%;
    max-width: 450px;
    margin-bottom: 0;
    box-shadow: var(--shadow-lg);
}

.login-header {
    text-align: center;
    margin-bottom: 30px;
}

.login-header h1 {
    font-size: 24px;
    margin-bottom: 5px;
    background: linear-gradient(135deg, #fff 0%, var(--primary-light) 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.login-header p {
    color: var(--text-muted);
    font-size: 14px;
}

.card:hover {
    transform: translateY(-3px);
    box-shadow: var(--shadow-md);
    border-color: rgba(255, 255, 255, 0.2);
}

.card-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
    padding-bottom: 15px;
    border-bottom: 1px solid var(--glass-border);
}

.card-header h1, .card-header h3 {
    margin-bottom: 0;
}

/* Tables */
.table-responsive {
    overflow-x: auto;
}

.table {
    width: 100%;
    border-collapse: collapse;
}

.table th, .table td {
    padding: 14px 15px;
    text-align: left !important;
    border-bottom: 1px solid var(--glass-border);
}

.table th {
    font-family: var(--font-heading);
    color: var(--text-main);
    background-color: rgba(255, 255, 255, 0.05);
    font-weight: 600;
}

.table tr:hover td {
    background-color: rgba(255, 255, 255, 0.02);
}

/* Mobile Responsiveness */
.menu-toggle {
    display: none;
    background: none;
    border: none;
    color: var(--text-main);
    font-size: 24px;
    cursor: pointer;
}

@media (max-width: 768px) {
    .app-wrapper {
        flex-direction: column;
    }
    
    .sidebar {
        position: fixed;
        left: -300px;
        top: 0;
        bottom: 0;
        margin: 0;
        height: 100vh;
        border-radius: 0;
        z-index: 1000;
        transition: left 0.3s cubic-bezier(0.4, 0, 0.2, 1);
        box-shadow: var(--shadow-lg);
    }
    
    .sidebar.active {
        left: 0;
    }
    
    .sidebar-overlay {
        display: none;
        position: fixed;
        top: 0;
        left: 0;
        right: 0;
        bottom: 0;
        background: rgba(0,0,0,0.6);
        backdrop-filter: blur(4px);
        z-index: 999;
    }
    
    .sidebar-overlay.active {
        display: block;
    }
    
    .menu-toggle {
        display: block;
    }
    
    .topbar {
        justify-content: space-between;
        padding: 20px;
    }
    
    div[style*="grid-template-columns"] {
        grid-template-columns: 1fr !important;
    }
    
    .content-area {
        padding: 15px;
    }
}
