/* Gallery Haus Market Analysis - Black Salmon Design System */

:root {
    /* Primary Colors - Black Salmon Brand */
    --primary-blue: #1863DC;
    --primary-blue-light: #4A8FE7;
    --primary-blue-dark: #0D4DB8;

    /* Secondary Colors */
    --secondary-salmon: #FA8072;
    --secondary-salmon-light: #FFB3A7;
    --secondary-salmon-dark: #E5604D;

    /* Accent Colors */
    --accent-teal: #14B8A6;
    --accent-teal-light: #2DD4BF;
    --accent-teal-dark: #0F766E;

    /* Neutral Palette */
    --slate-50: #F8FAFC;
    --slate-100: #F4F4F4;
    --slate-200: #E2E8F0;
    --slate-300: #CBD5E1;
    --slate-400: #94A3B8;
    --slate-500: #64748B;
    --slate-600: #475569;
    --slate-700: #334155;
    --slate-800: #212121;
    --slate-900: #0F172A;

    /* Semantic Colors */
    --success: #10B981;
    --warning: #F59E0B;
    --error: #EF4444;
    --info: #3B82F6;

    /* Shadows */
    --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
    --shadow: 0 1px 3px 0 rgba(0, 0, 0, 0.1), 0 1px 2px -1px rgba(0, 0, 0, 0.1);
    --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -2px rgba(0, 0, 0, 0.1);
    --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -4px rgba(0, 0, 0, 0.1);
    --shadow-xl: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 8px 10px -6px rgba(0, 0, 0, 0.1);

    /* Transitions */
    --transition-fast: all 0.15s ease;
    --transition: all 0.3s ease;
    --transition-slow: all 0.5s ease;

    /* Border Radius */
    --radius-sm: 0.375rem;
    --radius: 0.5rem;
    --radius-md: 0.75rem;
    --radius-lg: 1rem;
    --radius-xl: 1.5rem;
    --radius-full: 9999px;
}

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

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    background: #FFFFFF;
    color: var(--slate-800);
    line-height: 1.8;
    font-size: 14px;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

/* Sticky Top Navigation */
.top-nav {
    background: #000000;
    color: #FFFFFF;
    padding: 1.25rem 0;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
    position: sticky;
    top: 0;
    z-index: 2000;
    border-bottom: none;
}

.top-nav .container {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.top-nav-logo img {
    height: 36px;
    width: auto;
    filter: brightness(0) invert(1);
}

.top-nav-links {
    display: flex;
    gap: 2.5rem;
    align-items: center;
}

.top-nav-links a {
    color: #FFFFFF;
    text-decoration: none;
    font-weight: 600;
    font-size: 0.85rem;
    letter-spacing: 0.05em;
    text-transform: uppercase;
    transition: var(--transition-fast);
    padding: 0.5rem 0;
}

.top-nav-links a:hover {
    color: var(--primary-blue);
    opacity: 0.9;
}

/* Header */
.header {
    background: #FFFFFF;
    color: var(--slate-800);
    padding: 3rem 0 2rem 0;
    box-shadow: 0 1px 3px rgba(0,0,0,0.1);
    border-bottom: 1px solid var(--slate-200);
}

.header h1 {
    font-size: 2.5rem;
    font-weight: 700;
    margin-bottom: 0.75rem;
    display: flex;
    align-items: center;
    gap: 1rem;
    letter-spacing: -0.025em;
    color: var(--slate-800);
}

.header .subtitle {
    font-size: 1.1rem;
    opacity: 0.85;
    font-weight: 400;
    color: var(--slate-600);
}

.badge-salmon {
    background: linear-gradient(135deg, var(--secondary-salmon) 0%, var(--secondary-salmon-dark) 100%);
    color: white;
    padding: 0.5rem 1rem;
    border-radius: var(--radius-full);
    font-size: 0.9rem;
    font-weight: 600;
    display: inline-block;
    box-shadow: 0 4px 12px rgba(250, 128, 114, 0.4);
}

/* Navigation */
.nav-breadcrumb {
    background: white;
    padding: 1rem;
    box-shadow: var(--shadow);
    margin-bottom: 2rem;
    border-radius: var(--radius-md);
    border-left: 4px solid var(--accent-teal);
}

.nav-breadcrumb a {
    color: var(--primary-blue);
    text-decoration: none;
    font-weight: 500;
    transition: var(--transition-fast);
}

.nav-breadcrumb a:hover {
    color: var(--accent-teal);
    text-decoration: underline;
}

/* Tiles Grid */
.tiles-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 2.5rem;
    padding: 3rem 0;
    margin-top: 2rem;
}

.tile {
    background: white;
    border-radius: var(--radius-md);
    padding: 2rem;
    box-shadow: 0 1px 3px rgba(0,0,0,0.08);
    transition: var(--transition);
    cursor: pointer;
    text-decoration: none;
    color: inherit;
    display: flex;
    flex-direction: column;
    position: relative;
    overflow: visible;
    border: 1px solid var(--slate-200);
}

.tile::before {
    display: none;
}

.tile:hover {
    transform: translateY(-4px);
    box-shadow: 0 4px 12px rgba(24, 99, 220, 0.15);
    border-color: var(--primary-blue);
}

.tile-icon {
    font-size: 3rem;
    margin-bottom: 1rem;
    filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.1));
}

.tile-title {
    font-size: 1.5rem;
    font-weight: 700;
    margin-bottom: 0.5rem;
    color: var(--slate-900);
    letter-spacing: -0.025em;
}

.tile-description {
    color: var(--slate-600);
    margin-bottom: 1rem;
    flex-grow: 1;
    line-height: 1.7;
}

.tile-stat {
    font-size: 2rem;
    font-weight: 700;
    color: var(--primary-blue);
    margin-top: 1rem;
}

.tile-label {
    font-size: 0.9rem;
    color: var(--slate-500);
    text-transform: uppercase;
    letter-spacing: 0.05em;
    font-weight: 600;
}

/* Stats Cards */
.stats-row {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 2rem;
    margin-bottom: 3rem;
    margin-top: 3rem;
}

.stat-card {
    background: white;
    padding: 2rem 1.5rem;
    border-radius: var(--radius-md);
    box-shadow: 0 1px 3px rgba(0,0,0,0.08);
    text-align: center;
    transition: var(--transition);
    border: 1px solid var(--slate-200);
    position: relative;
    overflow: visible;
}

.stat-card::before {
    display: none;
}

.stat-card:hover {
    transform: translateY(-3px);
    box-shadow: 0 4px 12px rgba(24, 99, 220, 0.12);
    border-color: var(--primary-blue);
}

.stat-value {
    font-size: 2.5rem;
    font-weight: 700;
    color: var(--primary-blue);
    margin-bottom: 0.5rem;
}

.stat-label {
    color: var(--slate-600);
    font-size: 0.9rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    font-weight: 600;
}

/* Maps */
#map {
    width: 100%;
    height: 600px;
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-md);
    margin: 2rem 0;
    border: 1px solid var(--slate-200);
}

.map-container {
    background: white;
    padding: 2rem;
    border-radius: var(--radius-xl);
    box-shadow: var(--shadow-md);
    margin-bottom: 2rem;
    border: 1px solid var(--slate-200);
}

.map-controls {
    display: flex;
    gap: 1rem;
    margin-bottom: 1rem;
    flex-wrap: wrap;
}

.map-controls button,
.map-controls select {
    padding: 0.75rem 1.5rem;
    border: none;
    border-radius: var(--radius-md);
    background: var(--primary-blue);
    color: white;
    font-weight: 600;
    cursor: pointer;
    transition: var(--transition-fast);
    font-size: 0.95rem;
}

.map-controls button:hover {
    background: var(--accent-teal);
    transform: translateY(-2px);
    box-shadow: 0 6px 16px rgba(20, 184, 166, 0.4);
}

.map-controls select {
    background: white;
    color: var(--slate-800);
    border: 2px solid var(--primary-blue);
}

.map-controls select:hover {
    border-color: var(--accent-teal);
    background: var(--slate-50);
}

/* Tables */
.table-container {
    background: white;
    padding: 2.5rem;
    border-radius: var(--radius-md);
    box-shadow: 0 1px 3px rgba(0,0,0,0.08);
    margin-bottom: 3rem;
    overflow-x: auto;
    border: 1px solid var(--slate-200);
}

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

table.dataTable thead th {
    background: var(--primary-blue);
    color: white;
    padding: 1rem;
    font-weight: 600;
    text-transform: uppercase;
    font-size: 0.85rem;
    letter-spacing: 0.05em;
}

table.dataTable tbody td {
    padding: 1rem;
    border-bottom: 1px solid var(--slate-200);
    color: var(--slate-700);
}

table.dataTable tbody tr:hover {
    background: var(--slate-50);
}

table.dataTable tbody tr:nth-child(even) {
    background: var(--slate-50);
}

table.dataTable tbody tr:nth-child(even):hover {
    background: var(--slate-100);
}

/* Charts */
.chart-container {
    background: white;
    padding: 2.5rem;
    border-radius: var(--radius-md);
    box-shadow: 0 1px 3px rgba(0,0,0,0.08);
    margin-bottom: 3rem;
    height: 400px;
    position: relative;
    border: 1px solid var(--slate-200);
}

.chart-title {
    font-size: 1.5rem;
    font-weight: 700;
    margin-bottom: 1.5rem;
    color: var(--slate-900);
    letter-spacing: -0.025em;
}

/* Heatmap */
.heatmap-legend {
    background: white;
    padding: 1rem;
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-lg);
    position: absolute;
    bottom: 2rem;
    right: 2rem;
    z-index: 1000;
    border: 1px solid var(--slate-200);
}

.heatmap-legend h4 {
    margin-bottom: 0.5rem;
    font-size: 0.9rem;
    color: var(--slate-900);
    font-weight: 600;
}

.legend-gradient {
    width: 200px;
    height: 20px;
    background: linear-gradient(90deg,
        var(--accent-teal) 0%,
        var(--secondary-salmon) 100%);
    border-radius: var(--radius-sm);
}

.legend-labels {
    display: flex;
    justify-content: space-between;
    margin-top: 0.25rem;
    font-size: 0.75rem;
    color: var(--slate-600);
}

/* Cohort Grid */
.cohort-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 1.5rem;
    margin: 2rem 0;
}

.cohort-card {
    background: white;
    padding: 1.5rem;
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow);
    transition: var(--transition);
    border: 1px solid var(--slate-200);
}

.cohort-card:hover {
    transform: translateY(-4px);
    box-shadow: var(--shadow-lg);
    border-color: var(--accent-teal);
}

.cohort-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1rem;
    padding-bottom: 0.5rem;
    border-bottom: 2px solid var(--accent-teal);
}

.cohort-name {
    font-weight: 700;
    font-size: 1.1rem;
    color: var(--slate-900);
}

.cohort-badge {
    background: linear-gradient(135deg, var(--accent-teal) 0%, var(--accent-teal-dark) 100%);
    color: white;
    padding: 0.25rem 0.75rem;
    border-radius: var(--radius-full);
    font-size: 0.85rem;
    font-weight: 600;
}

.cohort-stats {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1rem;
}

.cohort-stat {
    text-align: center;
}

.cohort-stat-value {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--primary-blue);
}

.cohort-stat-label {
    font-size: 0.8rem;
    color: var(--slate-600);
    text-transform: uppercase;
    font-weight: 600;
}

/* Buttons */
.btn-primary {
    background: var(--primary-blue);
    color: white;
    padding: 0.75rem 2rem;
    border: none;
    border-radius: var(--radius-sm);
    font-weight: 600;
    cursor: pointer;
    transition: var(--transition-fast);
    text-decoration: none;
    display: inline-block;
    box-shadow: 0 2px 4px rgba(24, 99, 220, 0.2);
    font-size: 1rem;
}

.btn-primary:hover {
    background: var(--primary-blue-dark);
    transform: translateY(-1px);
    box-shadow: 0 4px 8px rgba(24, 99, 220, 0.3);
}

.btn-secondary {
    background: white;
    color: var(--primary-blue);
    padding: 0.75rem 1.5rem;
    border: 2px solid var(--primary-blue);
    border-radius: var(--radius-md);
    font-weight: 600;
    cursor: pointer;
    transition: var(--transition-fast);
    text-decoration: none;
    display: inline-block;
}

.btn-secondary:hover {
    background: var(--primary-blue);
    color: white;
    transform: translateY(-2px);
    box-shadow: var(--shadow-lg);
}

/* Footer */
.footer {
    background: #000000;
    color: #FFFFFF;
    padding: 3rem 0 2rem 0;
    margin-top: 5rem;
    border-top: none;
}

.footer-content {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 3rem;
    margin-bottom: 2rem;
}

.footer-section h4 {
    color: #FFFFFF;
    font-size: 0.85rem;
    font-weight: 700;
    margin-bottom: 1.25rem;
    text-transform: uppercase;
    letter-spacing: 0.1em;
}

.footer-section ul {
    list-style: none;
    padding: 0;
    margin: 0;
}

.footer-section ul li {
    margin-bottom: 0.75rem;
}

.footer-section ul li a {
    color: rgba(255, 255, 255, 0.7);
    text-decoration: none;
    font-size: 0.9rem;
    transition: var(--transition-fast);
}

.footer-section ul li a:hover {
    color: #FFFFFF;
}

.footer-social {
    display: flex;
    gap: 1rem;
    margin-top: 1rem;
}

.footer-social a {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 50%;
    color: white;
    text-decoration: none;
    transition: var(--transition-fast);
}

.footer-social a:hover {
    background: var(--primary-blue);
    transform: translateY(-2px);
}

.footer-bottom {
    text-align: center;
    padding-top: 2rem;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    color: rgba(255, 255, 255, 0.6);
    font-size: 0.85rem;
}

.footer-bottom p {
    margin: 0.5rem 0;
    line-height: 1.6;
}

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

::-webkit-scrollbar-track {
    background: var(--slate-100);
    border-radius: var(--radius-full);
}

::-webkit-scrollbar-thumb {
    background: linear-gradient(135deg, var(--primary-blue) 0%, var(--accent-teal) 100%);
    border-radius: var(--radius-full);
}

::-webkit-scrollbar-thumb:hover {
    background: linear-gradient(135deg, var(--accent-teal) 0%, var(--secondary-salmon) 100%);
}

/* Loading Animation */
.loading {
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 3rem;
}

.spinner {
    border: 4px solid var(--slate-200);
    border-top: 4px solid var(--accent-teal);
    border-radius: 50%;
    width: 50px;
    height: 50px;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* Info Window Styling */
.info-window {
    max-width: 300px;
}

.info-window h3 {
    color: var(--primary-blue);
    margin-bottom: 0.5rem;
    font-size: 1.2rem;
    font-weight: 700;
}

.info-window .type {
    background: var(--slate-100);
    padding: 0.25rem 0.5rem;
    border-radius: var(--radius-sm);
    font-size: 0.85rem;
    display: inline-block;
    margin-bottom: 0.5rem;
    color: var(--slate-700);
    font-weight: 600;
}

.info-window .rating {
    color: var(--warning);
    font-weight: 600;
}

.info-window .distance {
    color: var(--slate-600);
    font-size: 0.9rem;
}

/* Responsive Design */
@media (max-width: 768px) {
    .top-nav-links {
        gap: 1.5rem;
    }

    .top-nav-links a {
        font-size: 0.75rem;
    }

    .header h1 {
        font-size: 1.8rem;
    }

    .tiles-grid {
        grid-template-columns: 1fr;
    }

    .stats-row {
        grid-template-columns: 1fr;
    }

    #map {
        height: 400px;
    }

    .map-controls {
        flex-direction: column;
    }

    .cohort-grid {
        grid-template-columns: 1fr;
    }

    .footer-content {
        grid-template-columns: 1fr 1fr;
        gap: 2rem;
    }
}

@media (max-width: 480px) {
    .top-nav .container {
        flex-direction: column;
        gap: 1rem;
    }

    .top-nav-links {
        gap: 1rem;
        flex-wrap: wrap;
        justify-content: center;
    }

    .footer-content {
        grid-template-columns: 1fr;
    }
}

/* Accessibility */
@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
}

/* Focus states for accessibility */
a:focus,
button:focus,
select:focus {
    outline: 3px solid var(--accent-teal);
    outline-offset: 2px;
}
