/* Visual Data Science - Airbnb Dashboard Styles */
/* Matching the visual identity from Profile/Model notebooks */

:root {
    /* Colors */
    --bg-color: #fdfdfc;
    --text-color: #333;
    --text-muted: #666;
    --border-color: #ddd;
    --panel-bg: #fff;

    /* Accent colors */
    --green: #68A357;
    --green-light: #8BC57A;
    --blue: #3385bc;
    --red: #d95f4c;
    --orange: #e8a838;

    /* Spacing */
    --spacing-sm: 8px;
    --spacing-md: 16px;
    --spacing-lg: 24px;

    /* Typography */
    --font-mono: "Menlo", "Monaco", "Courier New", monospace;
    --font-sans: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
}

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

body {
    font-family: var(--font-sans);
    background-color: var(--bg-color);
    color: var(--text-color);
    line-height: 1.5;
}

/* Dashboard Layout */
.dashboard {
    max-width: 1600px;
    margin: 0 auto;
    padding: var(--spacing-md);
}

/* Header */
.header {
    text-align: center;
    margin-bottom: var(--spacing-lg);
    padding-bottom: var(--spacing-md);
    border-bottom: 1px solid var(--border-color);
}

.header h1 {
    font-family: var(--font-mono);
    font-size: 1.8rem;
    font-weight: 600;
    margin-bottom: var(--spacing-sm);
    color: var(--text-color);
}

.header .subtitle {
    font-size: 0.95rem;
    color: var(--text-muted);
    margin-bottom: var(--spacing-md);
}

/* Filters */
.filters {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    align-items: center;
    gap: var(--spacing-lg);
    margin-top: var(--spacing-md);
}

.filter-group {
    display: flex;
    align-items: center;
    gap: var(--spacing-sm);
}

.filter-group label {
    font-family: var(--font-mono);
    font-size: 0.85rem;
    font-weight: 500;
    color: var(--text-muted);
}

.filter-group select {
    font-family: var(--font-mono);
    font-size: 0.85rem;
    padding: 6px 12px;
    border: 1px solid var(--border-color);
    border-radius: 4px;
    background: var(--panel-bg);
    cursor: pointer;
}

.checkbox-group,
.radio-group {
    display: flex;
    gap: var(--spacing-md);
}

.checkbox-label,
.radio-label {
    display: flex;
    align-items: center;
    gap: 4px;
    cursor: pointer;
    font-size: 0.85rem;
}

.checkbox-label input,
.radio-label input {
    cursor: pointer;
    accent-color: var(--green);
}

.reset-btn {
    font-family: var(--font-mono);
    font-size: 0.8rem;
    padding: 6px 12px;
    border: 1px solid var(--border-color);
    border-radius: 4px;
    background: var(--panel-bg);
    cursor: pointer;
    transition: background 0.2s;
}

.reset-btn:hover {
    background: var(--bg-color);
    border-color: var(--text-muted);
}

/* Main Grid */
.grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    grid-template-rows: auto auto;
    gap: var(--spacing-md);
}

/* Panels */
.panel {
    background: var(--panel-bg);
    border: 1px solid var(--border-color);
    border-radius: 4px;
    padding: var(--spacing-md);
    min-height: 400px;
}

.panel h2 {
    font-family: var(--font-mono);
    font-size: 1rem;
    font-weight: 600;
    margin-bottom: var(--spacing-md);
    color: var(--text-color);
    padding-bottom: var(--spacing-sm);
    border-bottom: 1px solid var(--border-color);
}

/* Map specific */
#map-container {
    height: 350px;
    border-radius: 4px;
    overflow: hidden;
}

.legend {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: var(--spacing-sm);
    margin-top: var(--spacing-sm);
    font-family: var(--font-mono);
    font-size: 0.75rem;
    color: var(--text-muted);
}

.legend-gradient {
    width: 150px;
    height: 12px;
    border-radius: 2px;
}

/* Chart containers */
#city-chart,
#room-chart,
#scatter-chart {
    height: 350px;
    width: 100%;
}

/* D3 chart styles */
.axis text {
    font-family: var(--font-mono);
    font-size: 11px;
    fill: var(--text-muted);
}

.axis path,
.axis line {
    stroke: var(--border-color);
}

.axis-label {
    font-family: var(--font-mono);
    font-size: 12px;
    fill: var(--text-muted);
}

/* Bar chart */
.bar {
    cursor: pointer;
}

.bar:hover {
    opacity: 0.8;
}

.bar.selected {
    stroke: var(--text-color);
    stroke-width: 2px;
}

.bar.dimmed {
    opacity: 0.2;
}

/* City labels */
.city-label {
    font-family: var(--font-mono);
    font-size: 11px;
    fill: var(--text-color);
}

/* Price labels */
.price-label {
    font-family: var(--font-mono);
    font-size: 10px;
    fill: var(--text-muted);
}

/* Room type chart */
.bar-weekdays {
    fill: var(--blue);
}

.bar-weekends {
    fill: var(--orange);
}

.premium-label {
    font-family: var(--font-mono);
    font-size: 10px;
    fill: var(--text-muted);
}

/* Chart legend */
.chart-legend {
    display: flex;
    justify-content: center;
    gap: var(--spacing-lg);
    margin-top: var(--spacing-sm);
    font-family: var(--font-mono);
    font-size: 0.75rem;
}

.legend-item {
    display: flex;
    align-items: center;
    gap: 4px;
}

.legend-color {
    width: 12px;
    height: 12px;
    border-radius: 2px;
}

/* Hexbin styles */
.hexagon {
    stroke: #fff;
    stroke-width: 0.5px;
    cursor: pointer;
}

.hexagon:hover {
    stroke: #333;
    stroke-width: 1.5px;
}

/* Scatter plot */
.scatter-point {
    /* No transition for performance with large datasets */
}

.scatter-point.dimmed {
    opacity: 0.1;
}

/* Brush */
.brush .selection {
    fill: var(--blue);
    fill-opacity: 0.2;
    stroke: var(--blue);
    stroke-width: 1px;
}

/* Tooltip */
.tooltip {
    position: fixed;
    pointer-events: none;
    background: rgba(255, 255, 255, 0.95);
    border: 1px solid var(--border-color);
    border-radius: 4px;
    padding: 8px 12px;
    font-family: var(--font-mono);
    font-size: 0.8rem;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    z-index: 1000;
    opacity: 0;
    transition: opacity 0.15s;
}

.tooltip.visible {
    opacity: 1;
}

.tooltip-title {
    font-weight: 600;
    margin-bottom: 4px;
}

.tooltip-row {
    display: flex;
    justify-content: space-between;
    gap: 16px;
}

.tooltip-label {
    color: var(--text-muted);
}

.tooltip-value {
    font-weight: 500;
}

/* Footer */
.footer {
    text-align: center;
    margin-top: var(--spacing-lg);
    padding-top: var(--spacing-md);
    border-top: 1px solid var(--border-color);
    font-size: 0.85rem;
    color: var(--text-muted);
}

.footer a {
    color: var(--blue);
    text-decoration: none;
}

.footer a:hover {
    text-decoration: underline;
}

/* Leaflet customizations */
.leaflet-container {
    font-family: var(--font-sans);
}

.leaflet-control-zoom a {
    font-family: var(--font-mono);
}

/* Responsive */
@media (max-width: 1200px) {
    .grid {
        grid-template-columns: 1fr;
    }

    .filters {
        flex-direction: column;
        gap: var(--spacing-md);
    }
}

/* Loading state */
.loading {
    display: flex;
    justify-content: center;
    align-items: center;
    height: 100%;
    color: var(--text-muted);
    font-family: var(--font-mono);
}

/* No data state */
.no-data {
    display: flex;
    justify-content: center;
    align-items: center;
    height: 100%;
    color: var(--text-muted);
    font-family: var(--font-mono);
    font-style: italic;
}
