/* Professional Microclimate Dashboard Theme - style.css */

:root {
    --bg-main: #0f172a;
    --bg-card: #1e293b;
    --border-color: #334155;
    --text-primary: #f8fafc;
    --text-secondary: #94a3b8;
    --accent-color: #38bdf8;
    --accent-hover: #0ea5e9;
    --ist-color: #10b981;
    --plan-color: #ef4444;
    --var-color: #f59e0b;
    --solweig-color: #6366f1;
    --shadow-main: 0 10px 15px -3px rgba(0, 0, 0, 0.3), 0 4px 6px -4px rgba(0, 0, 0, 0.3);
}

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

body {
    font-family: 'Inter', -apple-system, sans-serif;
    background-color: var(--bg-main);
    color: var(--text-primary);
    line-height: 1.5;
    overflow-x: hidden;
    height: 100vh;
}

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

/* Sidebar Styling */
.sidebar {
    width: 360px;
    background-color: #0b0f19;
    border-right: 1px solid var(--border-color);
    padding: 2rem 1.5rem;
    display: flex;
    flex-direction: column;
    gap: 2rem;
    overflow-y: auto;
    flex-shrink: 0;
}

.sidebar-header {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.badge {
    align-self: flex-start;
    background: rgba(56, 189, 248, 0.15);
    color: var(--accent-color);
    font-size: 0.75rem;
    font-weight: 600;
    padding: 0.25rem 0.6rem;
    border-radius: 9999px;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.sidebar-header h1 {
    font-size: 1.6rem;
    font-weight: 700;
    color: var(--text-primary);
    line-height: 1.2;
}

.subtitle {
    font-size: 0.9rem;
    color: var(--text-secondary);
}

/* Control Groups */
.control-group {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.control-group h3 {
    font-size: 0.85rem;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    color: var(--text-secondary);
    font-weight: 600;
}

.scenario-buttons {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.btn-scenario {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    color: var(--text-primary);
    padding: 0.85rem 1rem;
    border-radius: 8px;
    cursor: pointer;
    font-weight: 500;
    font-size: 0.95rem;
    display: flex;
    align-items: center;
    gap: 0.75rem;
    text-align: left;
    transition: all 0.2s ease;
}

.btn-scenario:hover {
    border-color: var(--accent-color);
    background: rgba(56, 189, 248, 0.05);
}

.btn-scenario.active {
    background: rgba(56, 189, 248, 0.1);
    border-color: var(--accent-color);
    box-shadow: inset 0 0 4px rgba(56, 189, 248, 0.2);
}

.dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    display: inline-block;
}

.dot.ist { background-color: var(--ist-color); }
.dot.plan { background-color: var(--plan-color); }
.dot.var { background-color: var(--var-color); }
.dot.solweig { background-color: var(--solweig-color); }

/* Slider Styling */
.time-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.time-badge {
    background-color: var(--accent-color);
    color: #0b0f19;
    font-size: 0.85rem;
    font-weight: 700;
    padding: 0.2rem 0.5rem;
    border-radius: 4px;
}

.slider {
    -webkit-appearance: none;
    width: 100%;
    height: 6px;
    border-radius: 5px;
    background: var(--border-color);
    outline: none;
    margin: 0.5rem 0;
}

.slider::-webkit-slider-thumb {
    -webkit-appearance: none;
    appearance: none;
    width: 18px;
    height: 18px;
    border-radius: 50%;
    background: var(--accent-color);
    cursor: pointer;
    transition: transform 0.1s ease;
}

.slider::-webkit-slider-thumb:hover {
    transform: scale(1.2);
}

.time-labels {
    display: flex;
    justify-content: space-between;
    font-size: 0.75rem;
    color: var(--text-secondary);
}

/* Info Cards */
.info-card {
    background: rgba(15, 23, 42, 0.6);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    padding: 1rem;
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.info-card h3 {
    font-size: 0.8rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--text-secondary);
}

.info-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0.75rem;
}

.info-item {
    display: flex;
    flex-direction: column;
}

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

.info-val {
    font-size: 0.85rem;
    font-weight: 600;
}

.sidebar-footer {
    margin-top: auto;
    font-size: 0.75rem;
    color: var(--text-secondary);
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

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

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

/* Main Content Workspace */
.main-content {
    flex-grow: 1;
    padding: 2rem;
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
    overflow-y: auto;
}

.main-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 1px solid var(--border-color);
    padding-bottom: 1.2rem;
}

.header-title h2 {
    font-size: 1.5rem;
    font-weight: 600;
}

.header-title .description {
    font-size: 0.95rem;
    color: var(--text-secondary);
}

.metrics {
    display: flex;
    gap: 1rem;
}

.metric-card {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    padding: 0.75rem 1.25rem;
    border-radius: 8px;
    display: flex;
    flex-direction: column;
    min-width: 160px;
}

.metric-label {
    font-size: 0.75rem;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.metric-value {
    font-size: 1.4rem;
    font-weight: 700;
    color: var(--accent-color);
}

/* Visual Grid Layout */
.visual-grid {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
    flex-grow: 1;
}

.map-card {
    width: 100%;
    max-width: 600px;
    align-self: center;
}

.chart-card {
    width: 100%;
    min-height: 640px; /* Highly expanded card height to prevent squished curves */
}

.card {
    background-color: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    padding: 1.25rem;
    box-shadow: var(--shadow-main);
    display: flex;
    flex-direction: column;
    gap: 1rem;
    min-height: 0;
}

.card-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
    padding-bottom: 0.75rem;
}

.card-header h3 {
    font-size: 1rem;
    font-weight: 600;
}

/* Map specific styles */
.map-legend {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

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

.legend-bar {
    width: 120px;
    height: 8px;
    border-radius: 4px;
    background: linear-gradient(to right, #3b82f6, #60a5fa, #fbbf24, #ef4444);
}

.canvas-container {
    position: relative;
    flex-grow: 1;
    display: flex;
    justify-content: center;
    align-items: center;
    background-color: rgba(15, 23, 42, 0.4);
    border-radius: 8px;
    border: 1px solid rgba(255, 255, 255, 0.02);
    padding: 1rem;
    overflow: hidden;
}

#heatmap-canvas {
    max-width: 100%;
    max-height: 100%;
    image-rendering: pixelated; /* Crisp pixel scales */
    cursor: crosshair;
}

/* Tooltip container */
.tooltip {
    position: absolute;
    background: rgba(15, 23, 42, 0.9);
    border: 1px solid var(--accent-color);
    border-radius: 6px;
    padding: 0.6rem 0.8rem;
    pointer-events: none;
    font-size: 0.8rem;
    z-index: 10;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.3);
    color: var(--text-primary);
    transition: opacity 0.1s ease;
}

.tooltip.hidden {
    display: none;
    opacity: 0;
}

/* Chart Card layout */
.chart-container {
    position: relative;
    flex-grow: 1;
    height: 550px; /* Enormous, forced height for stretching vertical curves */
    width: 100%;
}

.card-footer {
    font-size: 0.75rem;
    color: var(--text-secondary);
}

.card-footer .note {
    font-style: italic;
}

/* Balance Table Styles */
.table-responsive {
    width: 100%;
    overflow-x: auto;
}

.balance-table {
    width: 100%;
    border-collapse: collapse;
    text-align: left;
    margin: 0.5rem 0;
}

.balance-table th {
    background-color: rgba(15, 23, 42, 0.4);
    color: var(--text-secondary);
    font-size: 0.8rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    padding: 0.85rem 1rem;
    border-bottom: 2px solid var(--border-color);
}

.balance-table td {
    padding: 1rem;
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
    font-size: 0.9rem;
    vertical-align: middle;
}

.balance-table tr:hover {
    background-color: rgba(255, 255, 255, 0.01);
}

.table-desc {
    font-size: 0.75rem;
    color: var(--text-secondary);
    margin-top: 0.25rem;
    font-weight: 400;
    line-height: 1.3;
}

.balance-table strong {
    color: var(--text-primary);
    font-weight: 600;
}

/* Specific Row and Column Styles */
.highlight-row {
    background-color: rgba(56, 189, 248, 0.04);
    border-top: 1.5px solid var(--border-color);
}

.highlight-row td {
    font-weight: 600;
    border-bottom: 2px solid var(--border-color);
}

/* Difference values colors */
.diff-pos {
    color: #ef4444; /* Red for positive heating */
    font-weight: 600;
}

.diff-neg {
    color: #10b981; /* Green for negative heating (cooling effect) */
    font-weight: 600;
}

.diff-neutral {
    color: var(--text-secondary);
    font-weight: 500;
}

/* Scientific Explanation Styles */
.explanation-card {
    background-color: rgba(30, 41, 59, 0.4);
    border-color: rgba(56, 189, 248, 0.15);
}

.explanation-content {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
    padding: 0.5rem 0;
}

.explanation-section h4 {
    color: var(--accent-color);
    font-size: 0.95rem;
    font-weight: 600;
    margin-bottom: 0.5rem;
}

.explanation-section p {
    font-size: 0.88rem;
    color: var(--text-secondary);
    line-height: 1.6;
    margin-bottom: 0.75rem;
}

.explanation-section p strong {
    color: var(--text-primary);
}

/* Checkbox Custom Styling */
.checkbox-container {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    cursor: pointer;
    font-size: 0.95rem;
    font-weight: 500;
    color: var(--text-primary);
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    padding: 0.75rem 1rem;
    border-radius: 8px;
    transition: all 0.2s ease;
}

.checkbox-container:hover {
    border-color: var(--accent-color);
    background: rgba(56, 189, 248, 0.05);
}

.checkbox-container input {
    display: none; /* Hide default browser checkbox */
}

.checkbox-box {
    width: 18px;
    height: 18px;
    border: 2px solid var(--border-color);
    border-radius: 4px;
    display: inline-block;
    position: relative;
    transition: all 0.2s ease;
    flex-shrink: 0;
}

.checkbox-container input:checked + .checkbox-box {
    background-color: var(--accent-color);
    border-color: var(--accent-color);
}

.checkbox-container input:checked + .checkbox-box::after {
    content: '';
    position: absolute;
    left: 5px;
    top: 1px;
    width: 5px;
    height: 10px;
    border: solid #0b0f19;
    border-width: 0 2.5px 2.5px 0;
    transform: rotate(45deg);
}

/* Responsive adjustments */
@media (max-width: 1200px) {
    .visual-grid {
        grid-template-columns: 1fr;
    }
    .app-container {
        flex-direction: column;
        height: auto;
    }
    .sidebar {
        width: 100%;
        height: auto;
    }
}

/* ==========================================================================
   ADDED FOR 5-PAGE MULTI-PAGE RESTRENGTHENING
   ========================================================================== */

/* Navigation Component Styling */
.navigation-group {
    border-bottom: 1px solid var(--border-color);
    padding-bottom: 1.5rem;
}

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

.nav-item {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    color: var(--text-secondary);
    text-decoration: none;
    padding: 0.75rem 1rem;
    border-radius: 8px;
    font-size: 0.95rem;
    font-weight: 500;
    transition: all 0.2s ease;
    border: 1px solid transparent;
}

.nav-item:hover {
    color: var(--text-primary);
    background: rgba(255, 255, 255, 0.03);
    border-color: rgba(255, 255, 255, 0.05);
}

.nav-item.active {
    color: var(--accent-color);
    background: rgba(56, 189, 248, 0.1);
    border-color: rgba(56, 189, 248, 0.2);
    font-weight: 600;
}

.nav-icon {
    font-size: 1.1rem;
}

/* Page 1 (Overview) Custom Styles */
.overview-grid {
    display: grid;
    grid-template-columns: 1.2fr 0.8fr;
    gap: 1.5rem;
}

@media (max-width: 1024px) {
    .overview-grid {
        grid-template-columns: 1fr;
    }
}

.highlights-panel {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.highlight-box {
    background: rgba(30, 41, 59, 0.4);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    padding: 1.25rem;
    display: flex;
    gap: 1rem;
    align-items: flex-start;
}

.highlight-icon {
    font-size: 1.8rem;
    background: rgba(56, 189, 248, 0.1);
    padding: 0.5rem;
    border-radius: 8px;
    color: var(--accent-color);
    line-height: 1;
    display: flex;
    align-items: center;
    justify-content: center;
}

.highlight-text h4 {
    font-size: 1rem;
    font-weight: 600;
    margin-bottom: 0.25rem;
    color: var(--text-primary);
}

.highlight-text p {
    font-size: 0.88rem;
    color: var(--text-secondary);
    line-height: 1.45;
}

/* Page 3 (Planning) Brush Tool Styling */
.brush-container {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 0.5rem;
}

.btn-brush {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    color: var(--text-primary);
    padding: 0.6rem 0.75rem;
    border-radius: 6px;
    cursor: pointer;
    font-size: 0.82rem;
    font-weight: 500;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    transition: all 0.2s ease;
    text-align: left;
}

.btn-brush:hover {
    border-color: var(--accent-color);
    background: rgba(255, 255, 255, 0.02);
}

.btn-brush.active {
    background: rgba(56, 189, 248, 0.12);
    border-color: var(--accent-color);
    font-weight: 600;
}

.brush-color {
    width: 12px;
    height: 12px;
    border-radius: 3px;
    display: inline-block;
    flex-shrink: 0;
}

.brush-color.rasen { background-color: rgba(16, 185, 129, 0.85); border: 1px solid rgba(255,255,255,0.2); }
.brush-color.kunstrasen { background-color: rgba(239, 68, 68, 0.8); border: 1px solid rgba(255,255,255,0.2); }
.brush-color.asphalt { background-color: rgba(100, 116, 139, 0.85); border: 1px solid rgba(255,255,255,0.2); }
.brush-color.gebaeude { background-color: rgba(226, 232, 240, 0.95); border: 1px solid rgba(15, 23, 42, 0.4); }
.brush-color.gruendach { background-color: rgba(101, 163, 13, 0.85); border: 1px solid rgba(255,255,255,0.2); }
.brush-color.baum { background-color: rgba(20, 83, 45, 0.85); border: 1px solid rgba(255,255,255,0.2); }
.brush-color.kork { background-color: rgba(217, 119, 6, 0.85); border: 1px solid rgba(255,255,255,0.2); }

.grid-reset-btn {
    background: rgba(239, 68, 68, 0.08);
    border: 1px solid rgba(239, 68, 68, 0.4);
    color: #fca5a5;
    padding: 0.65rem;
    border-radius: 6px;
    cursor: pointer;
    font-size: 0.85rem;
    font-weight: 600;
    width: 100%;
    transition: all 0.2s ease;
    text-align: center;
    display: inline-block;
    text-decoration: none;
    margin-top: 0.5rem;
}

.grid-reset-btn:hover {
    background: rgba(239, 68, 68, 0.2);
    border-color: #ef4444;
    color: #f8fafc;
}

/* Leaflet map styles */
#leaflet-map {
    width: 100%;
    height: 100%;
    min-height: 520px;
    border-radius: 8px;
    border: 1px solid var(--border-color);
    z-index: 1;
}

/* Today Weather styles */
.weather-status-card {
    background: linear-gradient(135deg, rgba(30, 41, 59, 0.6) 0%, rgba(15, 23, 42, 0.8) 100%);
    border: 1px solid var(--accent-color);
    border-radius: 12px;
    padding: 1.5rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 2rem;
    box-shadow: var(--shadow-main);
}

@media (max-width: 640px) {
    .weather-status-card {
        flex-direction: column;
        align-items: flex-start;
        gap: 1.5rem;
    }
}

.weather-info {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.weather-temp-row {
    display: flex;
    align-items: baseline;
    gap: 0.5rem;
}

.weather-temp {
    font-size: 3rem;
    font-weight: 800;
    color: var(--text-primary);
    line-height: 1;
}

.weather-unit {
    font-size: 1.5rem;
    color: var(--accent-color);
}

.weather-condition {
    font-size: 1.15rem;
    font-weight: 600;
    color: var(--text-primary);
}

.weather-meta-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 1rem 2rem;
}

.weather-meta-item {
    display: flex;
    flex-direction: column;
}

.weather-meta-label {
    font-size: 0.75rem;
    color: var(--text-secondary);
}

.weather-meta-val {
    font-size: 1rem;
    font-weight: 600;
    color: var(--text-primary);
}

.weather-icon-large {
    font-size: 4rem;
    line-height: 1;
}

/* Style overrides for Leaflet elements inside dark theme */
.leaflet-container {
    font-family: inherit !important;
}

.leaflet-bar a {
    background-color: var(--bg-card) !important;
    color: var(--text-primary) !important;
    border-bottom: 1px solid var(--border-color) !important;
}

.leaflet-bar a:hover {
    background-color: rgba(56, 189, 248, 0.1) !important;
    color: var(--accent-color) !important;
}

.leaflet-popup-content-wrapper, .leaflet-popup-tip {
    background: rgba(15, 23, 42, 0.95) !important;
    color: var(--text-primary) !important;
    border: 1px solid var(--accent-color) !important;
    box-shadow: var(--shadow-main) !important;
}

.leaflet-popup-content {
    margin: 12px 15px !important;
    font-size: 0.85rem !important;
    line-height: 1.4 !important;
}

