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

body {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
    background: linear-gradient(135deg, #74b9ff, #0984e3);
    min-height: 100vh;
    padding: 20px;
    color: #333;
}

/* Rain radar page should have no background or padding */
body.rain-radar-map {
    background: none;
    padding: 0;
    min-height: auto;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    background: white;
    border-radius: 15px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3);
    overflow: hidden;
}

.header {
    background: linear-gradient(135deg, #2d3436, #636e72);
    color: white;
    padding: 30px;
    text-align: center;
}

.header h1 {
    font-size: 2.5em;
    font-weight: 600;
    margin-bottom: 10px;
}

.form-section {
    padding: 30px;
    background: #f8f9fa;
    border-bottom: 1px solid #dee2e6;
}

.form-row {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
    align-items: end;
}

.button-row {
    margin-top: 15px;
    justify-content: flex-start;
}

.form-group {
    flex: 0 1 auto;
    min-width: 120px;
}

.form-group label {
    display: block;
    margin-bottom: 5px;
    font-weight: 600;
    color: #495057;
}

.form-group input {
    width: 100%;
    padding: 12px;
    border: 2px solid #dee2e6;
    border-radius: 8px;
    font-size: 16px;
    transition: border-color 0.3s;
}

.form-group input:focus {
    outline: none;
    border-color: #74b9ff;
    box-shadow: 0 0 0 3px rgba(116, 185, 255, 0.1);
}

.btn {
    background: linear-gradient(135deg, #00ce9b, #008f72);
    color: white;
    padding: 12px 30px;
    border: none;
    border-radius: 8px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: transform 0.2s, box-shadow 0.2s;
    min-width: 140px;
    text-align: center;
    display: inline-block;
}

.btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(0, 206, 155, 0.4);
}

.error {
    background: #ff7675;
    color: white;
    padding: 15px;
    margin: 20px 30px;
    border-radius: 8px;
    font-weight: 500;
}

.forecast-section {
    padding: 30px;
}

.location-title {
    text-align: center;
    font-weight: 500;
    font-style: ;
    margin-bottom: 30px;
    color: #2d3436;
}

.hourly-forecast {
    margin-bottom: 30px;
    background: white;
    border: 1px solid #dee2e6;
    border-radius: 12px;
    padding: 20px;
}

.hourly-title {
    font-size: 1.5em;
    font-weight: 500;
    color: #2d3436;
    margin-bottom: 20px;
    text-align: center;
    padding-bottom: 10px;
    border-bottom: 2px solid #74b9ff;
}

.hourly-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
    gap: 15px;
    overflow-x: auto;
    padding: 10px 0;
}

.hour-card {
    background: #f8f9fa;
    border: 1px solid #dee2e6;
    border-radius: 8px;
    padding: 15px;
    text-align: center;
    min-width: 140px;
}

.hour-detail.wind-info {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 5px;
}

.hour-time {
    font-size: 0.9em;
    font-weight: 600;
    color: #636e72;
    margin-bottom: 8px;
}

.hour-temp {
    font-size: 1.3em;
    font-weight: bold;
    margin: 8px 0;
}

.hour-details {
    font-size: 0.8em;
    color: #636e72;
}

.hour-detail {
    margin: 3px 0;
}

.forecast-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
    gap: 20px;
}

.day-card {
    background: #f8f9fa;
    border: 1px solid #dee2e6;
    border-radius: 12px;
    padding: 20px;
    text-align: center;
}


.day-name {
    font-size: 1.3em;
    font-weight: 500;
    color: #2d3436;
    margin-bottom: 15px;
    padding-bottom: 10px;
    border-bottom: 2px solid #74b9ff;
}

.temperature {
    font-size: 2em;
    font-weight: bold;
    margin: 15px 0;
}

.temp-range {
    font-size: 0.6em;
    color: #636e72;
    font-weight: normal;
}

.temp-positive {
    color: #00b894;
}

.temp-negative {
    color: #e17055;
}

.weather-detail {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 8px 0;
    border-bottom: 1px solid #f1f2f6;
    font-size: 0.9em;
}

.weather-detail:last-child {
    border-bottom: none;
}

.detail-label {
    font-weight: 600;
    color: #636e72;
    font-size: 0.9em;
}

.detail-value {
    font-weight: 500;
    color: #2d3436;
}

.wind-info {
    display: flex;
    align-items: center;
    gap: 5px;
}

.locations {
    background: #f8f9fa;
    border: 1px solid #dee2e6;
    border-radius: 12px;
    padding: 20px;
    margin-top: 20px;
    border-radius: 8px;
}

.locations h3 {
    color: #2d3436;
    margin-bottom: 10px;
}

.locations p {
    color: #636e72;
    margin: 5px 0;
    font-size: 0.9em;
}

.footer {
    max-width: 1200px;
    background: linear-gradient(135deg, #2d3436, #636e72);
    color: white;
    padding: 20px;
    text-align: center;
    margin: 0 auto;
    margin-top: 30px;
    border-radius: 15px 15px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3);
}

.footer-content {
    margin: 0 auto;
}

.footer p {
    margin: 0;
    font-size: 0.9em;
    opacity: 0.9;
}

.footer a {
    color: #74b9ff;
    text-decoration: none;
    font-weight: 600;
    transition: color 0.3s;
}

.footer a:hover {
    color: #0984e3;
    text-decoration: underline;
}

/* Geocode Button */
.btn-geocode {
    background: linear-gradient(135deg, #fcc06d, #cc8e35) !important;
}

.btn-geocode:hover {
    box-shadow: 0 5px 15px rgba(255, 177, 66, 0.4) !important;
}

/* Rain Radar Button */
.btn-radar {
    background: linear-gradient(135deg, #0984e3, #74b9ff) !important;
}

.btn-radar:hover {
    box-shadow: 0 5px 15px rgba(116, 185, 255, 0.4) !important;
}

/* Save Button */
.btn-save {
    background: linear-gradient(135deg, #be89d3, #6c3483) !important;
}

.btn-save:hover {
    box-shadow: 0 5px 15px rgba(195, 155, 211, 0.4) !important;
}

/* Clear List Button */
.btn-clear-list {
    background: linear-gradient(135deg, #ff6b6b, #c0392b) !important;
    padding: 8px 20px !important;
    font-size: 14px !important;
    min-width: auto !important;
}

.btn-clear-list:hover {
    box-shadow: 0 5px 15px rgba(255, 107, 107, 0.4) !important;
}

/* Clear Button */
.btn-clear {
    background: linear-gradient(135deg, #ff6b6b, #c0392b) !important;
}

.btn-clear:hover {
    box-shadow: 0 5px 15px rgba(255, 107, 107, 0.4) !important;
}

/* Overlay Styles */
.overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.8);
    z-index: 1000;
    justify-content: center;
    align-items: center;
    padding: 20px;
}

.overlay-content {
    background: white;
    border-radius: 12px;
    width: 90%;
    max-width: 1200px;
    height: 90%;
    max-height: 800px;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.5);
}

.overlay-header {
    background: linear-gradient(135deg, #2d3436, #636e72);
    color: white;
    padding: 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 1px solid #dee2e6;
}

.overlay-header h3 {
    margin: 0;
    font-size: 1.5em;
    font-weight: 300;
}

.close-btn {
    background: none;
    border: none;
    color: white;
    font-size: 2em;
    cursor: pointer;
    padding: 0;
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    transition: background-color 0.3s;
}

.close-btn:hover {
    background: rgba(255, 255, 255, 0.1);
}

.rain-radar-frame {
    flex: 1;
    width: 100%;
    border: none;
    background: white;
}

@media (max-width: 768px) {
    .form-row {
        flex-direction: column;
        align-items: flex-start;
    }

    .form-group {
        width: 100%;
        max-width: 100%;
        margin-bottom: 15px;
    }

    .form-group:last-child {
        margin-bottom: 0;
    }

    .button-row {
        margin-top: 15px;
        justify-content: flex-start;
        width: 100%;
    }

    .button-row .form-group {
        margin-bottom: 10px;
        width: 100%;
    }

    .button-row .form-group:last-child {
        margin-bottom: 0;
    }

    .btn {
        min-width: 100%;
        width: 100%;
        box-sizing: border-box;
    }

    .forecast-grid {
        grid-template-columns: 1fr;
    }

    .hourly-grid {
        grid-template-columns: repeat(auto-fit, minmax(100px, 1fr));
        gap: 10px;
    }

    .hour-card {
        min-width: 100px;
        padding: 10px;
    }

    .hour-temp {
        font-size: 1.1em;
    }

    .hour-details {
        font-size: 0.7em;
    }

    .header h1 {
        font-size: 2em;
    }

    .footer {
        padding: 15px;
    }
    
    .overlay-content {
        width: 95%;
        height: 95%;
    }
}

/* Rain Radar Map Styles */
html.rain-radar-map,
body.rain-radar-map {
    margin: 0;
    padding: 0;
    height: 100%;
    width: 100%;
    background: none;
    min-height: auto;
}

body.rain-radar-map #map {
    margin: 0;
    height: 100%;
    width: 100%;
    font-family: system-ui, monospace;
    font-size: small;
}

/* Customize Leaflet default styles for rain radar */
body.rain-radar-map .leaflet-popup-tip,
body.rain-radar-map .leaflet-popup-content-wrapper {
    background: rgba(255, 255, 255, 0.79);
    color: rgb(0, 0, 0);
}

body.rain-radar-map .leaflet-popup-content {
    background: rgba(255, 255, 255, 0);
    color: rgb(0, 0, 0);
    font-family: monospace;
}

/* Rain legend */
.rain-legend {
    position: absolute;
    bottom: 30px;
    right: 10px;
    z-index: 1000;
    background: rgba(255, 255, 255, 0.9);
    padding: 10px;
    border-radius: 5px;
    box-shadow: 0 2px 5px rgba(0,0,0,0.3);
    font-family: monospace;
    font-size: 12px;
}

.rain-legend h4 {
    margin: 0 0 8px 0;
    font-size: 14px;
    font-weight: bold;
}

.rain-legend-item {
    display: flex;
    align-items: center;
    margin-bottom: 4px;
}

    .rain-legend-color {
        width: 20px;
        height: 15px;
        margin-right: 8px;
        border: 1px solid #ccc;
    }

/* Login Page Styles */
body.login-page {
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 100vh;
    padding: 20px;
}

.login-container {
    max-width: 400px;
    width: 100%;
    margin: 0 auto;
}

.login-header {
    text-align: center;
    padding: 30px;
}

.login-header h1 {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    margin-bottom: 10px;
}

.login-header img {
    width: 1.5em;
    height: 1.5em;
}

.login-form-section {
    padding: 30px;
    text-align: center;
}

.login-form {
    display: flex;
    flex-direction: column;
    gap: 20px;
    margin-bottom: 20px;
}

.login-form-group {
    width: 100%;
    max-width: 100%;
}

.login-form-group input[type="password"] {
    width: 100%;
    padding: 12px;
    border: 2px solid #dee2e6;
    border-radius: 8px;
    font-size: 16px;
    background-color: white;
}

.login-form-group input[type="password"]:focus {
    outline: none;
    border-color: #74b9ff;
    box-shadow: 0 0 0 3px rgba(116, 185, 255, 0.1);
}

.remember-me {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    font-size: 0.9em;
    color: #495057;
    margin: 10px 0;
}

.remember-me input[type="checkbox"] {
    width: 16px;
    height: 16px;
    cursor: pointer;
}

.login-btn {
    width: 100%;
    max-width: 200px;
    margin: 0 auto;
}

.login-error {
    margin: 0 0 20px 0;
    text-align: center;
}

.default-password-note {
    margin-top: 20px;
    padding: 15px;
    background-color: #f8f9fa;
    border: 1px solid #dee2e6;
    border-radius: 8px;
    font-size: 0.9em;
    color: #495057;
}

.default-password-note p {
    margin: 5px 0;
}

.default-password-note strong {
    color: #2d3436;
}

@media (max-width: 768px) {
    .login-container {
        max-width: 100%;
    }
    
    .login-header {
        padding: 20px;
    }
    
    .login-form-section {
        padding: 20px;
    }
    
    .login-btn {
        max-width: 100%;
    }
}