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

:root {
    --bs-primary: #6366f1;
    --bs-primary-rgb: 99, 102, 241;
    --bg-gradient: linear-gradient(135deg, #0f172a 0%, #1e1b4b 100%);
    --sidebar-bg: rgba(15, 23, 42, 0.95);
    --glass-bg: rgba(255, 255, 255, 0.03);
    --glass-border: rgba(255, 255, 255, 0.1);
}

body {
    font-family: 'Inter', sans-serif;
    background: var(--bg-gradient);
    min-height: 100vh;
    color: #f8fafc;
    margin: 0;
}

/* Glass UI Elements */
.glass-card {
    background: var(--glass-bg);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border: 1px solid var(--glass-border);
    border-radius: 1.5rem;
}

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

/* Sidebar Styling */
.sidebar {
    width: 280px;
    background: var(--sidebar-bg);
    backdrop-filter: blur(20px);
    border-right: 1px solid var(--glass-border);
    display: flex;
    flex-direction: column;
    padding: 2rem 1.25rem;
    position: sticky;
    top: 0;
    height: 100vh;
    transition: all 0.3s ease;
}

.sidebar-logo {
    font-weight: 700;
    font-size: 1.5rem;
    padding-bottom: 1.5rem;
    margin-bottom: 1.5rem;
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
    background: linear-gradient(to right, #fff, var(--bs-primary));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.nav-link {
    color: rgba(255, 255, 255, 0.5) !important;
    padding: 0.8rem 1rem !important;
    border-radius: 0.75rem;
    margin-bottom: 0.25rem;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    font-weight: 500;
    text-decoration: none;
}

.nav-link i {
    font-size: 1.25rem;
    margin-right: 1rem;
    width: 24px;
    text-align: center;
}

.nav-link:hover {
    background: rgba(255, 255, 255, 0.05);
    color: #fff !important;
}

.nav-link.active {
    background: var(--bs-primary);
    color: #fff !important;
    box-shadow: 0 4px 15px rgba(var(--bs-primary-rgb), 0.3);
}

.logout-container {
    margin-top: auto;
    padding-top: 2rem;
}

/* Main Content */
.main-content {
    flex-grow: 1;
    padding: 2.5rem;
    overflow-y: auto;
}

.content-header {
    margin-bottom: 2.5rem;
}

.content-title {
    font-weight: 700;
    letter-spacing: -0.02em;
}

/* Stats Card */
.stat-card {
    background: var(--glass-bg);
    border: 1px solid var(--glass-border);
    border-radius: 1.25rem;
    padding: 1.5rem;
    height: 100%;
}

/* Login Page Overrides */
.login-centered {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 100vh;
}

/* Shared Components */
.form-floating > .form-control {
    background-color: rgba(255, 255, 255, 0.05);
    border: 1px solid var(--glass-border);
    color: #fff;
    border-radius: 0.75rem;
}

.form-floating > .form-control:focus {
    background-color: rgba(255, 255, 255, 0.08);
    border-color: var(--bs-primary);
    box-shadow: 0 0 0 0.25rem rgba(var(--bs-primary-rgb), 0.25);
    color: #fff;
}

.form-floating > label {
    color: rgba(255, 255, 255, 0.5);
}

.btn-primary {
    background-color: var(--bs-primary);
    border: none;
    padding: 0.8rem;
    font-weight: 600;
    border-radius: 0.75rem;
    transition: all 0.3s ease;
}

.btn-primary:hover {
    background-color: #4f46e5;
    transform: translateY(-2px);
    box-shadow: 0 10px 15px -3px rgba(99, 102, 241, 0.4);
}

.error-alert {
    background: rgba(239, 68, 68, 0.1);
    border: 1px solid rgba(239, 68, 68, 0.2);
    color: #fca5a5;
    border-radius: 0.75rem;
}

/* ─── Premium Form Styles ─── */
.form-section {
    background: rgba(255,255,255,0.03);
    backdrop-filter: blur(12px);
    border: 1px solid rgba(255,255,255,0.08);
    border-radius: 1.25rem;
    padding: 2rem;
    margin-bottom: 1.5rem;
    position: relative;
    overflow: hidden;
    transition: border-color 0.3s ease, box-shadow 0.3s ease;
}
.form-section:hover {
    border-color: rgba(99,102,241,0.3);
    box-shadow: 0 0 30px rgba(99,102,241,0.06);
}
.form-section::before {
    content: '';
    position: absolute;
    top: 0; left: 0;
    width: 4px; height: 100%;
    background: linear-gradient(180deg, #6366f1, #a855f7);
    border-radius: 4px 0 0 4px;
}
.form-section-title {
    font-weight: 700;
    font-size: 1.05rem;
    margin-bottom: 1.25rem;
    display: flex;
    align-items: center;
    gap: 0.6rem;
    color: #e2e8f0;
}
.form-section-title i {
    font-size: 1.2rem;
    color: #6366f1;
    background: rgba(99,102,241,0.15);
    padding: 0.4rem;
    border-radius: 0.5rem;
}

/* Glass Form Controls */
.form-control, .form-select {
    background-color: rgba(255,255,255,0.05) !important;
    border: 1px solid rgba(255,255,255,0.1) !important;
    color: #f1f5f9 !important;
    border-radius: 0.75rem !important;
    padding: 0.7rem 1rem;
    transition: all 0.25s ease;
}
.form-control:focus, .form-select:focus {
    background-color: rgba(255,255,255,0.08) !important;
    border-color: #6366f1 !important;
    box-shadow: 0 0 0 3px rgba(99,102,241,0.2) !important;
    color: #fff !important;
}
.form-control::placeholder { color: rgba(255,255,255,0.3) !important; }
.form-label {
    font-size: 0.82rem;
    font-weight: 600;
    color: rgba(255,255,255,0.55);
    text-transform: uppercase;
    letter-spacing: 0.04em;
    margin-bottom: 0.4rem;
}

/* Premium Switches */
.form-check.form-switch {
    background: rgba(255,255,255,0.03);
    border: 1px solid rgba(255,255,255,0.07);
    border-radius: 0.75rem;
    padding: 0.85rem 1rem 0.85rem 3.2rem;
    margin-bottom: 0.5rem;
    transition: all 0.2s ease;
}
.form-check.form-switch:hover {
    background: rgba(255,255,255,0.06);
    border-color: rgba(99,102,241,0.25);
}
.form-check-input:checked {
    background-color: #6366f1 !important;
    border-color: #6366f1 !important;
}
.form-check-label { color: rgba(255,255,255,0.7) !important; font-weight: 500; }

/* Upload Zone */
.upload-zone {
    border: 2px dashed rgba(255,255,255,0.12);
    border-radius: 1rem;
    padding: 2rem;
    text-align: center;
    cursor: pointer;
    transition: all 0.3s ease;
    background: rgba(255,255,255,0.02);
}
.upload-zone:hover, .upload-zone.dragover {
    border-color: #6366f1;
    background: rgba(99,102,241,0.06);
}
.upload-zone i { font-size: 2.5rem; color: #6366f1; margin-bottom: 0.75rem; }
.upload-zone p { color: rgba(255,255,255,0.45); margin: 0; font-size: 0.85rem; }
.upload-preview { max-height: 200px; border-radius: 0.75rem; object-fit: cover; width: 100%; }

/* Sticky Action Bar */
.action-bar {
    position: sticky;
    top: 0;
    z-index: 100;
    background: rgba(15,23,42,0.85);
    backdrop-filter: blur(12px);
    border: 1px solid rgba(255,255,255,0.06);
    border-radius: 1rem;
    padding: 1rem 1.5rem;
    margin-bottom: 1.5rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

/* Animated badge for status */
.status-badge {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    padding: 0.35rem 0.85rem;
    border-radius: 2rem;
    font-size: 0.78rem;
    font-weight: 600;
}
.status-badge.active { background: rgba(34,197,94,0.15); color: #4ade80; }
.status-badge.passive { background: rgba(239,68,68,0.15); color: #f87171; }
.status-badge .dot {
    width: 7px; height: 7px;
    border-radius: 50%;
    animation: pulse 2s infinite;
}
.status-badge.active .dot { background: #4ade80; }
.status-badge.passive .dot { background: #f87171; }
@keyframes pulse {
    0%,100% { opacity: 1; }
    50% { opacity: 0.4; }
}

@media (max-width: 992px) {
    .sidebar {
        width: 85px;
        padding: 2rem 0.75rem;
        align-items: center;
    }
    .sidebar .nav-link span, .sidebar-logo span {
        display: none;
    }
    .nav-link i {
        margin-right: 0;
    }
}
