/* Core styles for Sunshine Intensity Map */

:root {
    --primary-color: #0d6efd;
    --secondary-color: #6c757d;
    --success-color: #198754;
    --light-bg: #f8f9fa;
    --dark-bg: #212529;
    --shadow-color: rgba(0, 0, 0, 0.15);
}

* {
    box-sizing: border-box;
}

body {
    margin: 0;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, 'Open Sans', 'Helvetica Neue', sans-serif;
    overflow: hidden;
    height: 100vh;
}

.container-fluid {
    height: 100vh;
    display: flex;
    flex-direction: column;
}

header {
    flex-shrink: 0;
}

#controls-sidebar {
    overflow-y: auto;
    height: 100%;
}

#map {
    height: 100%;
    width: 100%;
    background: #e0e0e0;
}

.leaflet-container {
    font-family: inherit;
}

/* Circular Clock Slider Styles */
.clock-slider-container {
    display: flex;
    flex-direction: column;
    align-items: center;
    margin: 0.5rem 0;
    padding: 0.5rem;
}

.clock-slider {
    position: relative;
    width: 140px;
    height: 140px;
    user-select: none;
    cursor: pointer;
}

.clock-face {
    position: relative;
    width: 100%;
    height: 100%;
    border-radius: 50%;
    background: #f8f9fa;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
    border: 3px solid #0d6efd;
}

.hour-marker {
    position: absolute;
    width: 100%;
    height: 100%;
    top: 0;
    left: 0;
    pointer-events: none;
    transform: rotate(var(--rotation));
}

.hour-marker span {
    position: absolute;
    top: 5px;
    left: 50%;
    transform: translateX(-50%);
    font-size: 10px;
    font-weight: 700;
    color: #212529;
}

.clock-hand {
    position: absolute;
    width: 3px;
    height: 48px;
    background: #dc3545;
    left: 50%;
    top: 50%;
    transform-origin: bottom center;
    transform: translateX(-50%) translateY(-100%) rotate(0deg);
    border-radius: 2px;
    z-index: 10;
    pointer-events: none;
}

.clock-hand-knob {
    position: absolute;
    top: -5px;
    left: 50%;
    transform: translateX(-50%);
    width: 12px;
    height: 12px;
    background: #dc3545;
    border-radius: 50%;
    border: 2px solid #fff;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.3);
}

.clock-center {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 40px;
    height: 40px;
    background: #fff;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    border: 2px solid #dee2e6;
    z-index: 5;
}

.clock-center span {
    font-size: 10px;
    font-weight: 700;
    color: #0d6efd;
    font-family: 'Courier New', monospace;
}

.clock-am-pm {
    margin-top: 0.5rem;
    font-size: 11px;
    font-weight: 600;
    color: #6c757d;
}

/* Form controls */
.form-range::-webkit-slider-thumb {
    background-color: var(--primary-color);
}

.form-range::-moz-range-thumb {
    background-color: var(--primary-color);
}

/* Location results */
#location-results .list-group-item {
    cursor: pointer;
    transition: background-color 0.2s;
}

#location-results .list-group-item:hover {
    background-color: #e9ecef;
}

/* Info box */
.info-box {
    background: white;
    padding: 12px;
    border-radius: 8px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.2);
    min-width: 250px;
}

.info-box h5 {
    margin: 0 0 8px 0;
    color: #0d6efd;
    font-size: 13px;
}

.info-box .stat {
    display: flex;
    justify-content: space-between;
    margin: 4px 0;
    font-size: 12px;
}

.info-box .stat-value {
    font-weight: 600;
}

.info-box hr {
    margin: 8px 0;
    border-color: #dee2e6;
}

/* Sun intensity legend */
.sun-intensity-legend {
    background: white;
    padding: 10px;
    border-radius: 5px;
    box-shadow: 0 2px 6px rgba(0,0,0,0.2);
}

.sun-intensity-legend h4 {
    margin: 0 0 8px 0;
    font-size: 12px;
}

.sun-intensity-legend .color-scale {
    display: flex;
    height: 16px;
    border-radius: 3px;
    overflow: hidden;
}

.sun-intensity-legend .color-scale div {
    flex: 1;
}

.sun-intensity-legend .labels {
    display: flex;
    justify-content: space-between;
    font-size: 10px;
    margin-top: 4px;
}

/* Leaflet layer control styling */
.leaflet-control-layers {
    border-radius: 8px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.2);
}

.leaflet-control-layers-toggle {
    width: 36px;
    height: 36px;
}

.leaflet-control-layers-list {
    font-size: 12px;
}

/* Scale control */
.leaflet-control-scale-line {
    background: rgba(255,255,255,0.8);
    border-radius: 3px;
}

/* Responsive adjustments */
@media (max-width: 768px) {
    #controls-sidebar {
        position: fixed;
        left: 0;
        top: 50px;
        width: 280px;
        height: calc(100vh - 50px);
        z-index: 1000;
        transform: translateX(-100%);
        transition: transform 0.3s ease;
    }
    
    #controls-sidebar.show {
        transform: translateX(0);
    }
    
    .clock-slider {
        width: 120px;
        height: 120px;
    }
    
    .clock-hand {
        height: 40px;
    }
    
    .clock-center {
        width: 35px;
        height: 35px;
    }
    
    .clock-center span {
        font-size: 9px;
    }
}

/* Loading spinner */
.loading-spinner {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 2rem;
}

.spinner-border {
    width: 3rem;
    height: 3rem;
    margin-bottom: 1rem;
}

/* Button styles */
.btn-outline-primary:hover,
.btn-outline-secondary:hover,
.btn-outline-info:hover {
    transform: translateY(-1px);
    transition: transform 0.2s ease;
}

/* Badge styles */
.badge {
    font-weight: 500;
}

/* Scrollbar styling */
#controls-sidebar::-webkit-scrollbar {
    width: 6px;
}

#controls-sidebar::-webkit-scrollbar-track {
    background: #f1f1f1;
}

#controls-sidebar::-webkit-scrollbar-thumb {
    background: #c1c1c1;
    border-radius: 3px;
}

#controls-sidebar::-webkit-scrollbar-thumb:hover {
    background: #a8a8a8;
}
