/* SafeScape Professional Theme - PhD-level Data Visualization */
/* Colorblind-proof Design System */

:root {
    /* City of Minneapolis Government Color Palette - Clean & Professional */
    --primary-color: #003865;     /* Navy Blue - Primary brand color */
    --secondary-color: #005696;    /* Medium Blue - Links and accents */
    --accent-color: #0077C0;       /* Bright Blue - Interactive elements */
    --success-color: #008542;     /* Green - Success states */
    --warning-color: #FFA500;     /* Orange - Warnings (accessible) */
    --danger-color: #C41E3A;      /* Red - Errors/alerts */
    --info-color: #0096D6;        /* Light Blue - Information */
    
    /* Background colors - Clean white with minimal grays */
    --bg-primary: #FFFFFF;        /* Pure white background */
    --bg-secondary: #F7F7F7;      /* Very light gray for sections */
    --bg-tertiary: #EFEFEF;       /* Light gray for cards */
    
    /* Text colors - High contrast for accessibility */
    --text-primary: #212121;      /* Near black for body text */
    --text-secondary: #424242;    /* Dark gray for secondary text */
    --text-muted: #666666;        /* Medium gray for muted text */
    --text-light: #FFFFFF;        /* White for dark backgrounds */
    
    /* Gray scale - Government standard */
    --gray-100: #F7F7F7;
    --gray-200: #EFEFEF;
    --gray-300: #E0E0E0;
    --gray-400: #CCCCCC;
    --gray-500: #999999;
    --gray-600: #666666;
    --gray-700: #424242;
    --gray-800: #333333;
    --gray-900: #212121;
    
    /* Shadows - Subtle for professional appearance */
    --shadow-xs: 0 1px 2px rgba(0, 0, 0, 0.05);
    --shadow-light: 0 2px 4px rgba(0, 0, 0, 0.08);
    --shadow-medium: 0 4px 8px rgba(0, 0, 0, 0.12);
    --shadow-heavy: 0 8px 16px rgba(0, 0, 0, 0.15);
    --shadow-color: 0 2px 8px rgba(0, 56, 101, 0.25);
    
    /* Layout Variables */
    --border-radius: 6px;
    --border-radius-lg: 12px;
    --transition: all 0.3s ease;
}

/* Global Body Styles - Clean Government White Background */
body {
    background-color: #FFFFFF !important;
    color: var(--text-primary);
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Helvetica Neue', Arial, sans-serif;
    line-height: 1.6;
    font-size: 16px;
}

/* Professional Typography */
h1, h2, h3, h4, h5, h6 {
    color: var(--secondary-color);
    font-weight: 700;
    margin-bottom: 1rem;
}

h1 { font-size: 2.5rem; font-weight: 900; }
h2 { font-size: 2rem; font-weight: 800; }
h3 { font-size: 1.75rem; font-weight: 700; }
h4 { font-size: 1.5rem; }
h5 { font-size: 1.25rem; }
h6 { font-size: 1rem; }

.text-primary { color: var(--primary-color) !important; }
.text-secondary { color: var(--secondary-color) !important; }
.text-accent { color: var(--accent-color) !important; }
.text-success { color: var(--success-color) !important; }
.text-warning { color: var(--warning-color) !important; }
.text-danger { color: var(--danger-color) !important; }
.text-info { color: var(--info-color) !important; }
.text-muted { color: var(--text-muted) !important; }

.bg-primary { background-color: var(--primary-color) !important; }
.bg-secondary { background-color: var(--secondary-color) !important; }
.bg-light { background-color: var(--bg-secondary) !important; }
.bg-gray-100 { background-color: var(--gray-100) !important; }

/* Professional Navigation */
.navbar {
    background-color: #FFFFFF !important;
    border-bottom: 2px solid var(--primary-color);
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.navbar-brand {
    color: var(--primary-color) !important;
    font-weight: 700;
    font-size: 1.5rem;
}

.nav-link {
    color: var(--primary-color) !important;
    font-weight: 500;
    transition: var(--transition);
    padding: 0.5rem 1rem !important;
}

.nav-link:hover {
    color: var(--secondary-color) !important;
    text-decoration: underline;
}

/* Dropdown Menus */
.dropdown-menu {
    border: 1px solid var(--gray-200);
    box-shadow: var(--shadow-medium);
    border-radius: var(--border-radius);
    padding: 0.5rem 0;
}

.dropdown-item {
    color: var(--text-primary);
    font-weight: 400;
    padding: 0.5rem 1.5rem;
    transition: var(--transition);
}

.dropdown-item:hover {
    background-color: var(--bg-secondary);
    color: var(--secondary-color);
}

/* Professional Buttons */
.btn {
    font-weight: 600;
    border-radius: var(--border-radius);
    padding: 0.5rem 1.5rem;
    transition: var(--transition);
    border: none;
    box-shadow: var(--shadow-xs);
}

.btn-primary {
    background-color: var(--primary-color);
    color: white;
    border: 2px solid var(--primary-color);
}

.btn-primary:hover {
    background-color: var(--secondary-color);
    border-color: var(--secondary-color);
    box-shadow: 0 2px 4px rgba(0,0,0,0.2);
}

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

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

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

/* Data Visualization Cards */
.stat-card {
    background: white;
    border-radius: var(--border-radius);
    padding: 1.5rem;
    box-shadow: var(--shadow-light);
    transition: var(--transition);
    position: relative;
    overflow: hidden;
}

.stat-card:hover {
    transform: translateY(-5px);
    box-shadow: var(--shadow-heavy);
}

.stat-value {
    font-size: 3rem;
    font-weight: 700;
    color: var(--primary-color);
    line-height: 1;
}

.stat-label {
    color: var(--text-secondary);
    font-size: 0.875rem;
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-top: 0.5rem;
}

.stat-change {
    font-size: 1.25rem;
    font-weight: 700;
    margin-top: 0.5rem;
}

.stat-change.positive {
    color: var(--success-color);
}

.stat-change.negative {
    color: var(--danger-color);
}

/* Chart Containers */
.chart-container {
    position: relative;
    height: 400px;
    background: white;
    border-radius: var(--border-radius);
    padding: 1rem;
    box-shadow: var(--shadow-light);
}

/* Interactive Elements */
.interactive-card {
    cursor: pointer;
    transition: var(--transition);
    border: 2px solid transparent;
}

.interactive-card:hover {
    border-color: var(--primary-color);
    box-shadow: var(--shadow-color);
}

.interactive-card.highlighted {
    border-color: var(--primary-color);
    box-shadow: 0 2px 8px rgba(0, 56, 101, 0.25);
    background-color: var(--bg-secondary);
}

/* Map Styling */
#map, .map-container {
    height: 500px;
    border-radius: var(--border-radius);
    border: 1px solid var(--gray-200);
    box-shadow: var(--shadow-light);
}

/* Location Cards for Third Spaces */
.location-card {
    background: white;
    border: 2px solid var(--gray-200);
    border-radius: var(--border-radius);
    padding: 1rem;
    margin-bottom: 1rem;
    cursor: pointer;
    transition: var(--transition);
}

.location-card:hover {
    transform: translateY(-3px);
    box-shadow: var(--shadow-medium);
    border-color: var(--primary-color);
}

.location-card.active {
    border-color: var(--primary-color);
    background-color: var(--bg-secondary);
    box-shadow: 0 2px 8px rgba(0, 56, 101, 0.25);
}

/* AI Assistant Interface */
.ai-chat-container {
    background: white;
    border-radius: var(--border-radius-lg);
    box-shadow: var(--shadow-medium);
    overflow: hidden;
}

.chat-history {
    height: 400px;
    overflow-y: auto;
    padding: 1.5rem;
    background: var(--bg-secondary);
}

.chat-message {
    margin-bottom: 1rem;
    padding: 1rem;
    border-radius: var(--border-radius);
    background: white;
    box-shadow: var(--shadow-xs);
}

.chat-message.user {
    background: var(--primary-color);
    color: white;
    margin-left: 20%;
}

.chat-message.ai {
    background: white;
    margin-right: 20%;
}

.chat-input-container {
    padding: 1rem;
    background: white;
    border-top: 1px solid var(--gray-200);
}

/* Data Tables */
.data-table {
    background: white;
    border-radius: var(--border-radius);
    overflow: hidden;
    box-shadow: var(--shadow-light);
}

.data-table th {
    background: var(--bg-secondary);
    color: var(--primary-color);
    font-weight: 600;
    text-transform: uppercase;
    font-size: 0.875rem;
    letter-spacing: 0.5px;
    padding: 1rem;
    border-bottom: 2px solid var(--gray-300);
}

.data-table td {
    padding: 1rem;
    border-bottom: 1px solid var(--gray-200);
    color: var(--text-primary);
}

.data-table tr:hover {
    background: var(--bg-secondary);
}

/* Accessibility Features */
.visually-hidden {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

/* Focus States for Accessibility */
*:focus {
    outline: 2px solid var(--secondary-color);
    outline-offset: 2px;
}

button:focus, a:focus {
    outline: 2px solid var(--secondary-color);
    outline-offset: 2px;
}

/* Loading States */
.spinner {
    border: 4px solid var(--gray-200);
    border-top-color: var(--primary-color);
    border-radius: 50%;
    width: 40px;
    height: 40px;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

/* Responsive Design */
@media (max-width: 768px) {
    h1 { font-size: 2rem; }
    h2 { font-size: 1.75rem; }
    h3 { font-size: 1.5rem; }
    
    .stat-value { font-size: 2rem; }
    
    .chart-container {
        height: 300px;
    }
    
    #map, .map-container {
        height: 400px;
    }
}

/* Print Styles */
@media print {
    .navbar, .btn, .dropdown {
        display: none !important;
    }
    
    .card {
        box-shadow: none !important;
        border: 1px solid #000 !important;
    }
}

/* High Contrast Mode Support */
@media (prefers-contrast: high) {
    :root {
        --primary-color: #004080;
        --secondary-color: #1a2530;
        --accent-color: #b94700;
        --shadow-light: 0 1px 3px rgba(0,0,0,0.2);
        --shadow-medium: 0 2px 6px rgba(0,0,0,0.3);
    }
    
    .card {
        border: 2px solid var(--dark-color);
    }
}