/* Reset */
*, *::before, *::after {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html, body {
    width: 100%;
    height: 100%;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    font-size: 14px;
    overflow: hidden;
}

/* Full-viewport map */
#map {
    width: 100%;
    height: 100%;
    z-index: 0;
}

/* Shared panel styles */
.panel {
    position: absolute;
    z-index: 1000;
    background: rgba(255, 255, 255, 0.95);
    border-radius: 8px;
    box-shadow: 0 2px 12px rgba(0, 0, 0, 0.25);
    backdrop-filter: blur(4px);
}

.panel-toggle {
    display: none;
    position: absolute;
    background: rgba(255, 255, 255, 0.95);
    border: none;
    border-radius: 8px;
    box-shadow: 0 2px 12px rgba(0, 0, 0, 0.25);
    cursor: pointer;
    font-size: 18px;
    width: 36px;
    height: 36px;
    line-height: 36px;
    text-align: center;
    z-index: 1001;
}

.panel-body {
    padding: 14px;
}

/* Controls panel — top-left */
#controls-panel {
    top: 10px;
    left: 10px;
    width: 280px;
}

#controls-toggle {
    top: 0;
    left: 0;
}

/* Search */
.search-group {
    display: flex;
    gap: 6px;
}

#search-input {
    flex: 1;
    padding: 7px 10px;
    border: 1px solid #ccc;
    border-radius: 4px;
    font-size: 13px;
}

#search-btn {
    padding: 7px 14px;
    background: #2196F3;
    color: #fff;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-size: 13px;
}

#search-btn:hover {
    background: #1976D2;
}

/* My Location button */
.full-width-btn {
    width: 100%;
    padding: 7px;
    margin-top: 8px;
    background: #4CAF50;
    color: #fff;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-size: 13px;
}

.full-width-btn:hover {
    background: #388E3C;
}

/* Control groups */
.control-group {
    margin-top: 10px;
}

.control-group label {
    display: block;
    margin-bottom: 4px;
    font-weight: 600;
    color: #333;
    font-size: 13px;
}

#date-input {
    width: 100%;
    padding: 6px 8px;
    border: 1px solid #ccc;
    border-radius: 4px;
    font-size: 13px;
}

/* Season quick-buttons */
.season-buttons {
    display: flex;
    gap: 4px;
    margin-top: 6px;
}

.season-btn {
    flex: 1;
    padding: 5px 2px;
    font-size: 11px;
    background: #f5f5f5;
    border: 1px solid #ccc;
    border-radius: 4px;
    cursor: pointer;
    transition: background 0.15s;
}

.season-btn:hover {
    background: #e0e0e0;
}

.season-btn[data-date="equinox-spring"] { color: #4CAF50; }
.season-btn[data-date="solstice-summer"] { color: #FF9800; }
.season-btn[data-date="equinox-autumn"] { color: #795548; }
.season-btn[data-date="solstice-winter"] { color: #2196F3; }

/* Time slider */
#time-slider {
    width: 100%;
    margin-top: 2px;
    cursor: pointer;
}

#time-display {
    font-weight: normal;
    font-variant-numeric: tabular-nums;
}

/* Height input */
.height-group {
    display: flex;
    align-items: center;
    gap: 6px;
}

#height-input {
    width: 80px;
    padding: 6px 8px;
    border: 1px solid #ccc;
    border-radius: 4px;
    font-size: 13px;
}

.unit {
    color: #666;
    font-size: 13px;
}

/* Shadow color picker */
.shadow-color-group {
    display: flex;
    align-items: center;
    gap: 6px;
}

#shadow-color {
    width: 32px;
    height: 28px;
    padding: 1px;
    border: 1px solid #ccc;
    border-radius: 4px;
    cursor: pointer;
}

#shadow-opacity {
    flex: 1;
    cursor: pointer;
}

#shadow-opacity-display {
    font-size: 12px;
    color: #666;
    min-width: 28px;
    font-variant-numeric: tabular-nums;
}

/* Info panel — bottom-right */
#info-panel {
    bottom: 30px;
    right: 10px;
    min-width: 200px;
}

#info-toggle {
    top: 0;
    right: 0;
}

.info-row {
    display: flex;
    justify-content: space-between;
    padding: 3px 0;
    font-size: 13px;
    border-bottom: 1px solid #f0f0f0;
}

.info-row:last-child {
    border-bottom: none;
}

.info-label {
    color: #666;
    margin-right: 12px;
}

/* Leaflet tooltip for hourly markers */
.sun-hour-tooltip {
    background: rgba(0, 0, 0, 0.75);
    color: #fff;
    border: none;
    border-radius: 4px;
    padding: 3px 7px;
    font-size: 12px;
    font-weight: 600;
    box-shadow: none;
}

.sun-hour-tooltip::before {
    border-top-color: rgba(0, 0, 0, 0.75);
}

/* Draggable sun marker */
.sun-drag-icon {
    width: 20px;
    height: 20px;
    background: radial-gradient(circle, #FFD600 40%, #FF8F00 70%, transparent 71%);
    border-radius: 50%;
    cursor: grab;
    box-shadow: 0 0 8px 2px rgba(255, 214, 0, 0.6);
}

.sun-drag-icon:active {
    cursor: grabbing;
}

/* --- Mobile / responsive --- */
@media (max-width: 600px) {
    .panel-toggle {
        display: block;
    }

    #controls-panel {
        width: calc(100% - 20px);
    }

    #controls-panel .panel-body {
        display: none;
    }

    #controls-panel.open .panel-body {
        display: block;
    }

    #info-panel {
        bottom: 10px;
        right: 10px;
        left: 10px;
        min-width: unset;
    }

    #info-panel .panel-body {
        display: none;
    }

    #info-panel.open .panel-body {
        display: block;
    }
}
