:root {
    /* Corporate Light Theme (Default) */
    --primary-color: #2563eb;
    --secondary-color: #475569;
    --accent-color: #f59e0b;
    --danger-color: #ef4444;
    --success-color: #22c55e;
    
    --background-color: #f8fafc;
    --surface-color: #ffffff;
    
    --text-primary: #1e293b;
    --text-secondary: #64748b;
    
    --border-color: #e2e8f0;
    
    --glass-bg: rgba(255, 255, 255, 0.9);
    --glass-border: rgba(255, 255, 255, 0.2);
    
    --shadow-sm: 0 1px 2px 0 rgb(0 0 0 / 0.05);
    --shadow-md: 0 4px 6px -1px rgb(0 0 0 / 0.1), 0 2px 4px -2px rgb(0 0 0 / 0.1);
    --shadow-lg: 0 10px 15px -3px rgb(0 0 0 / 0.1), 0 4px 6px -4px rgb(0 0 0 / 0.1);
    
    --font-family: 'Inter', 'Outfit', system-ui, -apple-system, sans-serif;
}

body.dark-mode {
    --primary-color: #3b82f6;
    --secondary-color: #94a3b8;
    --background-color: #0f172a;
    --surface-color: #1e293b;
    --text-primary: #f8fafc;
    --text-secondary: #94a3b8;
    --border-color: #334155;
    --glass-bg: rgba(30, 41, 59, 0.85);
    --glass-border: rgba(255, 255, 255, 0.1);
    --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.3);
    --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.3), 0 2px 4px -2px rgba(0, 0, 0, 0.2);
}

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

body {
    font-family: var(--font-family);
    background-color: var(--background-color);
    color: var(--text-primary);
    line-height: 1.5;
    height: 100vh;
    overflow: hidden; /* For map app feel */
}

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

.sidebar {
    width: 400px;
    background-color: var(--surface-color);
    border-right: 1px solid var(--border-color);
    display: flex;
    flex-direction: column;
    z-index: 1000;
    transition: transform 0.3s ease;
}

.map-container {
    flex: 1;
    position: relative;
    z-index: 1;
}

/* Header */
.header {
    padding: 1.5rem;
    border-bottom: 1px solid var(--border-color);
    background: linear-gradient(135deg, #1e40af 0%, #2563eb 100%);
    color: white;
    position: relative;
}

body.dark-mode .header {
    background: linear-gradient(135deg, #0f172a 0%, #1e293b 100%);
    border-bottom: 1px solid #334155;
}

.logo {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--primary-color);
    display: flex;
    align-items: center;
    gap: 0.5rem;
    height: 50px;
}

.logo span {
    color: var(--text-primary);
}

/* Navigation */
.nav-tabs {
    display: flex;
    padding: 0 1.5rem;
    gap: 1rem;
    border-bottom: 1px solid var(--border-color);
    background: var(--surface-color);
}

.nav-item {
    padding: 1rem 0;
    color: var(--text-secondary);
    cursor: pointer;
    font-weight: 500;
    position: relative;
    text-decoration: none;
}

.nav-item.active {
    color: var(--primary-color);
}

.nav-item.active::after {
    content: '';
    position: absolute;
    bottom: -1px;
    left: 0;
    width: 100%;
    height: 2px;
    background-color: var(--primary-color);
}

/* Issue List */
.issue-list {
    flex: 1;
    overflow-y: auto;
    padding: 1rem;
}

.issue-card {
    background-color: var(--surface-color);
    border: 1px solid var(--border-color);
    border-radius: 0.75rem;
    padding: 1rem;
    margin-bottom: 1rem;
    cursor: pointer;
    transition: all 0.2s ease;
}

.issue-card:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
    border-color: var(--primary-color);
}

.issue-header {
    display: flex;
    justify-content: space-between;
    align-items: start;
    margin-bottom: 0.5rem;
}

.issue-category {
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    padding: 0.25rem 0.5rem;
    border-radius: 9999px;
    background-color: var(--background-color);
    color: var(--text-secondary);
}

.issue-status {
    width: 10px;
    height: 10px;
    border-radius: 50%;
}

.status-critical { background-color: var(--danger-color); box-shadow: 0 0 0 4px rgba(239, 68, 68, 0.2); }
.status-progress { background-color: var(--accent-color); box-shadow: 0 0 0 4px rgba(245, 158, 11, 0.2); }
.status-fixed { background-color: var(--success-color); box-shadow: 0 0 0 4px rgba(34, 197, 94, 0.2); }

.issue-title {
    font-weight: 600;
    margin-bottom: 0.25rem;
}

.issue-location {
    font-size: 0.875rem;
    color: var(--text-secondary);
    display: flex;
    align-items: center;
    gap: 0.25rem;
}

.issue-meta {
    margin-top: 0.75rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 0.875rem;
    color: var(--text-secondary);
}

.vote-count {
    display: flex;
    align-items: center;
    gap: 0.25rem;
    color: var(--primary-color);
    font-weight: 600;
}

/* Map Controls */
.map-controls {
    position: absolute;
    top: 1rem;
    right: 1rem;
    z-index: 1000;
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.control-btn {
    background: var(--surface-color);
    border: 1px solid var(--border-color);
    padding: 0.75rem;
    border-radius: 0.5rem;
    box-shadow: var(--shadow-md);
    cursor: pointer;
    color: var(--text-primary);
    transition: all 0.2s;
}

.control-btn:hover {
    background: var(--background-color);
}

/* Modal/Popup */
.popup-content {
    font-family: var(--font-family);
}

.popup-image {
    width: 100%;
    height: 150px;
    object-fit: cover;
    border-radius: 0.5rem;
    margin-bottom: 0.5rem;
}

.popup-title {
    font-weight: 700;
    margin-bottom: 0.25rem;
    font-size: 1rem;
}

.popup-desc {
    font-size: 0.875rem;
    color: var(--text-secondary);
    margin-bottom: 0.5rem;
}

.popup-actions {
    display: flex;
    gap: 0.5rem;
    margin-top: 0.5rem;
}

.btn {
    padding: 0.5rem 1rem;
    border-radius: 0.375rem;
    font-size: 0.875rem;
    font-weight: 500;
    cursor: pointer;
    border: none;
    transition: all 0.2s;
}

.btn-primary {
    background-color: var(--primary-color);
    color: white;
}

.btn-primary:hover {
    background-color: #1d4ed8;
}

.btn-outline {
    background-color: transparent;
    border: 1px solid var(--border-color);
    color: var(--text-primary);
}

.btn-outline:hover {
    background-color: var(--background-color);
}

/* Dashboard Specifics */
.dashboard-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 1.5rem;
    padding: 1.5rem;   
    overflow-y: auto;
}

.stat-card {
    background: var(--surface-color);
    padding: 1.5rem;
    border-radius: 1rem;
    border: 1px solid var(--border-color);
    box-shadow: var(--shadow-sm);
}

.stat-value {
    font-size: 2rem;
    font-weight: 700;
    margin: 0.5rem 0;
}

.stat-label {
    color: var(--text-secondary);
    font-size: 0.875rem;
}

.chart-container {
    height: 300px;
    margin-top: 1rem;
    position: relative;
}

/* Responsive */
@media (max-width: 768px) {
    .app-container {
        flex-direction: column;
    }
    
    .sidebar {
        width: 100%;
        height: 50vh;
        order: 2;
        /* Allow the entire sidebar to scroll, not just the list */
        display: block;
        overflow-y: auto;
    }

    .issue-list {
        /* Remove internal scrolling on mobile */
        overflow-y: visible;
        flex: none;
    }
    
    .map-container {
        height: 50vh;
        order: 1;
    }
}
