/* ===== RESET & BASE ===== */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

:root {
    --primary: #2d7d46;
    --primary-dark: #1e5a32;
    --secondary: #5a9bd4;
    --danger: #d9534f;
    --success: #5cb85c;
    --warning: #f0ad4e;
    --bg: #f5f7fa;
    --card-bg: #ffffff;
    --text: #333333;
    --text-light: #666666;
    --border: #e0e0e0;
    --shadow: 0 2px 8px rgba(0,0,0,0.1);
    --radius: 12px;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, sans-serif;
    background: var(--bg);
    color: var(--text);
    line-height: 1.6;
    min-height: 100vh;
}

.container {
    max-width: 900px;
    margin: 0 auto;
    padding: 1rem;
}

/* ===== HEADER ===== */
header {
    text-align: center;
    padding: 1.5rem 0;
}

header h1 {
    font-size: 1.8rem;
    color: var(--primary);
    margin-bottom: 0.25rem;
}

.subtitle {
    color: var(--text-light);
    font-size: 0.95rem;
}

/* ===== CARDS ===== */
.card {
    background: var(--card-bg);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    padding: 1.25rem;
    margin-bottom: 1rem;
}

.card h2 {
    font-size: 1.2rem;
    margin-bottom: 1rem;
    color: var(--primary-dark);
    border-bottom: 2px solid var(--primary);
    padding-bottom: 0.5rem;
}

/* ===== BUTTONS ===== */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    padding: 0.75rem 1.25rem;
    border: none;
    border-radius: 8px;
    font-size: 1rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
    text-decoration: none;
}

.btn-primary {
    background: var(--primary);
    color: white;
}

.btn-primary:hover {
    background: var(--primary-dark);
}

.btn-secondary {
    background: var(--secondary);
    color: white;
}

.btn-secondary:hover {
    background: #4a8bc4;
}

.btn-small {
    padding: 0.5rem 0.75rem;
    font-size: 0.85rem;
}

.btn-icon {
    font-size: 1.1em;
}

/* ===== LOCATION SECTION ===== */
.location-controls {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 1rem;
    margin-bottom: 1rem;
}

.or-divider {
    color: var(--text-light);
    font-size: 0.9rem;
}

#map {
    height: 250px;
    border-radius: 8px;
    border: 2px solid var(--border);
    margin-bottom: 0.75rem;
}

.location-info {
    font-size: 0.9rem;
    color: var(--text-light);
    text-align: center;
}

.location-info.active {
    color: var(--success);
    font-weight: 500;
}

/* ===== SETTINGS SECTION ===== */
.setting-group {
    margin-bottom: 1.25rem;
}

.setting-group > label {
    display: block;
    font-weight: 500;
    margin-bottom: 0.5rem;
}

.input-with-unit {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
}

.input-with-unit input {
    width: 80px;
    padding: 0.5rem;
    border: 2px solid var(--border);
    border-radius: 6px;
    font-size: 1rem;
    text-align: center;
}

.input-with-unit input:focus {
    outline: none;
    border-color: var(--primary);
}

.unit {
    color: var(--text-light);
    font-size: 0.9rem;
}

/* Slider input group */
.slider-input-group {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.slider {
    flex: 1;
    -webkit-appearance: none;
    appearance: none;
    height: 8px;
    background: var(--border);
    border-radius: 4px;
    outline: none;
    cursor: pointer;
}

.slider::-webkit-slider-thumb {
    -webkit-appearance: none;
    appearance: none;
    width: 20px;
    height: 20px;
    background: var(--primary);
    border-radius: 50%;
    cursor: pointer;
    transition: background 0.2s ease;
}

.slider::-webkit-slider-thumb:hover {
    background: var(--primary-dark);
}

.slider::-moz-range-thumb {
    width: 20px;
    height: 20px;
    background: var(--primary);
    border: none;
    border-radius: 50%;
    cursor: pointer;
    transition: background 0.2s ease;
}

.slider::-moz-range-thumb:hover {
    background: var(--primary-dark);
}

/* Sun angle control with arrows */
.sun-angle-control {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin-bottom: 0.5rem;
}

.angle-arrow {
    width: 36px;
    height: 36px;
    border: 2px solid var(--border);
    border-radius: 50%;
    background: var(--bg);
    font-size: 1rem;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
    flex-shrink: 0;
}

.angle-arrow:hover {
    border-color: var(--primary);
    background: var(--primary);
    color: white;
}

.angle-arrow:active {
    transform: scale(0.95);
}

.slider-with-markers {
    flex: 1;
    position: relative;
    padding-bottom: 20px;
}

.slider-with-photos {
    width: 100%;
}

.slider-markers {
    position: absolute;
    left: 10px;
    right: 10px;
    bottom: 0;
    height: 20px;
    display: flex;
    justify-content: space-between;
}

.slider-marker {
    position: absolute;
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: var(--border);
    transform: translateX(-50%);
    bottom: 6px;
}

.slider-marker.has-photo {
    background: var(--primary);
    width: 10px;
    height: 10px;
    cursor: pointer;
}

.slider-marker.has-photo:hover {
    transform: translateX(-50%) scale(1.3);
}

.slider-marker-label {
    position: absolute;
    font-size: 0.65rem;
    color: var(--text-light);
    transform: translateX(-50%);
    bottom: -2px;
    white-space: nowrap;
}

/* Sun photos gallery */
.sun-photos-gallery {
    margin-top: 1rem;
    padding: 1rem;
    background: var(--bg);
    border-radius: 8px;
}

.gallery-title {
    font-size: 0.95rem;
    font-weight: 500;
    margin-bottom: 0.75rem;
    color: var(--text);
}

#gallery-angle-display {
    color: var(--primary);
    font-weight: 600;
}

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


.gallery-item {
    display: flex;
    flex-direction: column;
    background: var(--card-bg);
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 1px 4px rgba(0,0,0,0.1);
}

.gallery-item img {
    width: 100%;
    aspect-ratio: 4/3;
    object-fit: cover;
    cursor: pointer;
    transition: transform 0.2s ease;
}

.gallery-item img:hover {
    transform: scale(1.02);
}

.gallery-item-info {
    padding: 0.5rem;
    font-size: 0.75rem;
    color: var(--text-light);
    text-align: center;
    background: var(--card-bg);
}

.gallery-info {
    font-size: 0.8rem;
    color: var(--text-light);
    margin-top: 0.75rem;
    text-align: center;
    font-style: italic;
}

.gallery-no-photos {
    text-align: center;
    padding: 2rem;
    color: var(--text-light);
    font-style: italic;
}

.hint {
    display: block;
    width: 100%;
    color: var(--text-light);
    font-size: 0.8rem;
    margin-top: 0.25rem;
}

/* ===== TRANSPORT SECTION ===== */
.transport-mode {
    margin-bottom: 1rem;
}

.transport-mode > label {
    display: block;
    font-weight: 500;
    margin-bottom: 0.5rem;
}

.transport-buttons {
    display: flex;
    gap: 0.5rem;
}

.transport-btn {
    flex: 1;
    padding: 0.75rem;
    font-size: 1.5rem;
    background: var(--bg);
    border: 2px solid var(--border);
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.2s ease;
}

.transport-btn:hover {
    border-color: var(--primary);
}

.transport-btn.active {
    border-color: var(--primary);
    background: rgba(45, 125, 70, 0.1);
}

/* Course travel cards */
.courses-travel {
    display: grid;
    gap: 1rem;
    margin-bottom: 1rem;
}

.course-travel-card {
    background: var(--bg);
    border-radius: 8px;
    padding: 1rem;
    display: flex;
    flex-direction: column;
}

.course-travel-card h3 {
    font-size: 1rem;
    margin-bottom: 0.75rem;
    color: var(--primary-dark);
}

.travel-estimate {
    display: flex;
    flex-wrap: wrap;
    align-items: baseline;
    gap: 0.5rem;
    margin-bottom: 0.5rem;
}

.estimate-label {
    color: var(--text-light);
    font-size: 0.9rem;
}

.estimate-value {
    font-weight: 600;
    font-size: 1.1rem;
    color: var(--primary);
}

.estimate-note {
    color: var(--text-light);
    font-size: 0.75rem;
    width: 100%;
}

.travel-actions {
    margin-bottom: 0.75rem;
}

.travel-input {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin-top: auto;
}

.travel-input label {
    font-size: 0.9rem;
}

.travel-input input {
    width: 70px;
}

.speed-info {
    font-size: 0.8rem;
    color: var(--text-light);
    background: rgba(90, 155, 212, 0.1);
    padding: 0.75rem;
    border-radius: 6px;
    line-height: 1.5;
}

/* ===== RESULTS SECTION ===== */
.results-card {
    background: linear-gradient(135deg, var(--primary) 0%, var(--primary-dark) 100%);
    color: white;
}

.results-card h2 {
    color: white;
    border-color: rgba(255,255,255,0.3);
}

.current-time {
    text-align: center;
    font-size: 1.1rem;
    margin-bottom: 1rem;
    opacity: 0.9;
}

.results-grid {
    display: grid;
    gap: 1rem;
}

.result-card {
    background: rgba(255,255,255,0.95);
    color: var(--text);
    border-radius: 10px;
    padding: 1rem;
    text-align: center;
}

.result-card h3 {
    font-size: 1rem;
    margin-bottom: 0.75rem;
    color: var(--primary-dark);
}

.result-sun-time,
.result-arrival {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 0.9rem;
    margin-bottom: 0.5rem;
    padding: 0.25rem 0;
}

.result-sun-time .label,
.result-arrival .label {
    color: var(--text-light);
}

.result-sun-time .value,
.result-arrival .value {
    font-weight: 600;
}

.sun-angle-display {
    font-weight: 600;
    color: var(--primary);
}

.result-playtime {
    margin: 1rem 0;
    padding: 1rem;
    background: var(--bg);
    border-radius: 8px;
}

.playtime-value {
    display: block;
    font-size: 1.8rem;
    font-weight: 700;
    color: var(--success);
}

.playtime-value.late {
    color: var(--danger);
}

.playtime-value.night {
    color: var(--secondary);
}

.result-nextday.night-info {
    background: rgba(90, 155, 212, 0.2);
    color: var(--text);
}

.playtime-label {
    font-size: 0.85rem;
    color: var(--text-light);
}

.result-nextday {
    margin: 0.5rem 0;
    padding: 0.75rem;
    background: rgba(90, 155, 212, 0.15);
    border-radius: 6px;
    font-size: 0.85rem;
    color: var(--secondary);
    text-align: center;
}

.result-nextday strong {
    color: var(--text);
}

.result-weather {
    margin: 0.5rem 0;
    padding: 0.5rem;
    background: rgba(255, 255, 255, 0.5);
    border-radius: 6px;
    font-size: 0.8rem;
    text-align: center;
}

/* ===== WEATHER CARD ===== */
.weather-card {
    transition: background 0.3s ease, border-color 0.3s ease;
}

.weather-card.weather-good {
    background: linear-gradient(135deg, #e8f5e9 0%, #c8e6c9 100%);
    border-left: 4px solid var(--success);
}

.weather-card.weather-warning {
    background: linear-gradient(135deg, #fff8e1 0%, #ffecb3 100%);
    border-left: 4px solid var(--warning);
}

.weather-card.weather-bad {
    background: linear-gradient(135deg, #ffebee 0%, #ffcdd2 100%);
    border-left: 4px solid var(--danger);
}

.weather-loading {
    text-align: center;
    color: var(--text-light);
    padding: 1rem;
}

/* Weather 3 columns layout */
.weather-columns {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 0.75rem;
    margin-bottom: 0.75rem;
}

.weather-column {
    background: rgba(255, 255, 255, 0.6);
    border-radius: 8px;
    padding: 0.75rem;
    text-align: center;
}

.weather-column-time {
    font-size: 1rem;
    font-weight: 600;
    color: var(--primary-dark);
    margin-bottom: 0.25rem;
}

.weather-column-icon {
    font-size: 2rem;
    margin: 0.25rem 0;
}

.weather-column-temp {
    font-size: 1.3rem;
    font-weight: 700;
    margin-bottom: 0.5rem;
}

.weather-column-details {
    display: flex;
    flex-direction: column;
    gap: 0.2rem;
    font-size: 0.75rem;
    color: var(--text-light);
}

.weather-column-details span {
    display: block;
}

.weather-column-details small {
    color: var(--text-light);
    opacity: 0.7;
    margin-left: 0.15rem;
}

.weather-alert {
    margin-top: 0.5rem;
    padding: 0.75rem;
    border-radius: 6px;
    font-weight: 500;
    text-align: center;
}

.weather-alert.alert-warning {
    background: rgba(240, 173, 78, 0.2);
    color: #856404;
}

.weather-alert.alert-danger {
    background: rgba(217, 83, 79, 0.2);
    color: #721c24;
}

.btn-navigate {
    width: 100%;
    margin-top: 0.5rem;
}

/* ===== FOOTER ===== */
footer {
    text-align: center;
    padding: 1.5rem;
    color: var(--text-light);
    font-size: 0.85rem;
}

footer .links {
    margin-top: 0.5rem;
}

footer .attribution {
    margin-top: 0.75rem;
    font-size: 0.75rem;
    opacity: 0.7;
}

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

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

/* ===== RESPONSIVE ===== */
@media (max-width: 599px) {
    .weather-columns {
        gap: 0.5rem;
    }

    .weather-column {
        padding: 0.5rem;
    }

    .weather-column-time {
        font-size: 0.85rem;
    }

    .weather-column-icon {
        font-size: 1.5rem;
    }

    .weather-column-temp {
        font-size: 1.1rem;
    }

    .weather-column-details {
        font-size: 0.65rem;
    }
}

@media (min-width: 600px) {
    .container {
        padding: 2rem;
    }

    header h1 {
        font-size: 2.2rem;
    }

    #map {
        height: 300px;
    }

    .courses-travel {
        grid-template-columns: repeat(3, 1fr);
    }

    .results-grid {
        grid-template-columns: repeat(3, 1fr);
    }

    .result-card {
        padding: 1.25rem;
    }

    .playtime-value {
        font-size: 2rem;
    }
}

@media (min-width: 800px) {
    .card {
        padding: 1.5rem;
    }

    .sun-presets {
        gap: 1rem;
    }

    .preset-label {
        font-size: 0.9rem;
    }
}

/* ===== LEAFLET OVERRIDES ===== */
.leaflet-control-attribution {
    font-size: 0.7rem;
}

.user-marker {
    font-size: 2.5rem;
    text-shadow: 0 2px 4px rgba(0,0,0,0.3);
}

