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

:root {
    --bg-main: #000000;
    --bg-card: rgba(17, 24, 39, 0.7);
    --accent-blue: #0071E3;
    --accent-purple: #BF5AF2;
    --text-primary: #FFFFFF;
    --text-secondary: #A1A1A6;
    --border-glass: rgba(255, 255, 255, 0.1);
    --glass-blur: blur(24px);
    --sidebar-width: 280px;
    --transition-smooth: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    --card-shadow: 0 8px 32px 0 rgba(0, 0, 0, 0.37);
}

[data-theme="light"] {
    --bg-main: #F5F5F7;
    --bg-card: rgba(255, 255, 255, 0.8);
    --text-primary: #1D1D1F;
    --text-secondary: #86868B;
    --border-glass: rgba(0, 0, 0, 0.08);
    --card-shadow: 0 8px 32px 0 rgba(31, 38, 135, 0.1);
    --sidebar-bg: #FFFFFF;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: 'Inter', sans-serif;
}

body {
    background-color: var(--bg-main);
    background-image: 
        radial-gradient(circle at 0% 0%, var(--accent-blue-faded, rgba(59, 130, 246, 0.05)) 0%, transparent 50%),
        radial-gradient(circle at 100% 100%, var(--accent-purple-faded, rgba(168, 85, 247, 0.05)) 0%, transparent 50%);
    color: var(--text-primary);
    min-height: 100vh;
    overflow-x: hidden;
}

/* Glassmorphism Classes */
.glass {
    background: var(--bg-card);
    backdrop-filter: var(--glass-blur);
    -webkit-backdrop-filter: var(--glass-blur);
    border: 1px solid var(--border-glass);
    border-radius: 16px;
}

.glass-hover:hover {
    background: rgba(255, 255, 255, 0.08);
    border-color: rgba(255, 255, 255, 0.2);
}

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

/* Sidebar */
aside.sidebar {
    width: var(--sidebar-width);
    height: 100vh;
    position: fixed;
    left: 0;
    top: 0;
    padding: 2rem 1.5rem;
    z-index: 100;
    background: var(--sidebar-bg);
    border-right: 1px solid var(--border-glass);
}

.logo-container {
    padding-bottom: 2rem;
    margin-bottom: 1rem;
    border-bottom: 1px solid var(--border-glass);
}

.logo-text {
    font-family: 'Outfit', sans-serif;
    font-weight: 700;
    font-size: 1.5rem;
    background: linear-gradient(to right, var(--accent-blue), var(--accent-purple));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    letter-spacing: -0.5px;
}

nav.menu {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.menu-item {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 0.85rem 1rem;
    border-radius: 12px;
    color: var(--text-secondary);
    text-decoration: none;
    transition: var(--transition-smooth);
}

.menu-item:hover, .menu-item.active {
    color: var(--text-primary);
    background: rgba(59, 130, 246, 0.1);
    transform: translateX(5px);
}

.menu-item i {
    font-size: 1.25rem;
}

/* Main Content */
main.content {
    flex: 1;
    margin-left: var(--sidebar-width);
    padding: 2rem;
}

header.top-bar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 2.5rem;
    padding: 1.5rem 2.5rem;
    border-radius: 20px;
    position: relative;
    z-index: 500;
}

.page-title h1 {
    font-size: 1.875rem;
    font-weight: 700;
    color: var(--text-primary);
}

.page-title p {
    color: var(--text-secondary);
    font-size: 0.875rem;
    margin-top: 0.25rem;
}

/* Dashboard Widgets */
.grid-stats {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
    gap: 1.5rem;
    margin-bottom: 2rem;
}

.stat-card {
    padding: 1.5rem;
}

.stat-card .label {
    color: var(--text-secondary);
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    margin-bottom: 0.5rem;
}

.stat-card .value {
    font-size: 2rem;
    font-weight: 700;
}

.stat-card .trend {
    font-size: 0.75rem;
    margin-top: 0.5rem;
}

.trend.up { color: #10b981; }
.trend.down { color: #ef4444; }

/* Map View */
.map-container {
    height: 500px;
    width: 100%;
    margin-bottom: 2rem;
    overflow: hidden;
    position: relative;
}

/* Buttons */
.btn-primary {
    background: linear-gradient(135deg, var(--accent-blue), var(--accent-purple));
    color: white;
    border: none;
    padding: 0.75rem 1.5rem;
    border-radius: 10px;
    font-weight: 600;
    cursor: pointer;
    transition: var(--transition-smooth);
}

.btn-primary:hover {
    opacity: 0.9;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(59, 130, 246, 0.3);
}

/* Chat Pop-up */
.chat-popup {
    position: fixed;
    bottom: 2rem;
    right: 2rem;
    width: 350px;
    height: 450px;
    display: flex;
    flex-direction: column;
    z-index: 1000;
}

.chat-header {
    padding: 1rem;
    background: rgba(255, 255, 255, 0.05);
    border-bottom: 1px solid var(--border-glass);
}

.chat-messages {
    flex: 1;
    overflow-y: auto;
    padding: 1rem;
}

.chat-input {
    padding: 1rem;
    border-top: 1px solid var(--border-glass);
}

/* Responsive */
@media (max-width: 1024px) {
    aside.sidebar {
        width: 80px;
        padding: 1.5rem 1rem;
    }
    .logo-text, .menu-item span {
        display: none;
    }
    main.content {
        margin-left: 80px;
    }
}
