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

:root {
    --primary-color: #2563eb;
    --secondary-color: #f1f5f9;
    --text-color: #1e293b;
    --text-light: #64748b;
    --white: #ffffff;
    --h1: #fff;
    --border-color: #e2e8f0;
    --shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
    --gradient: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    line-height: 1.6;
    color: var(--text-color);
    background: var(--gradient);
    min-height: 100vh;
    transition: all 0.3s ease;
}

body.dark-mode {
    --primary-color: #3b82f6;
    --secondary-color: #1e293b;
    --text-color: #f8fafc;
    --text-light: #94a3b8;
    --h1: #7d8591;
    --white: #334155;
    --border-color: #475569;
    --gradient: linear-gradient(135deg, #1e293b 0%, #0f172a 100%);
}

.container {
    max-width: 1400px;
    margin: 0 auto;
    padding: 20px;
}

header {
    text-align: center;
    margin-bottom: 30px;
}

h1 {
    color: var(--h1);
    font-size: 2.5rem;
    margin-bottom: 10px;
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.3);
}

.subtitle {
    color: var(--white);
    opacity: 0.9;
    font-size: 1.1rem;
}

.dark-mode-toggle {
    position: fixed;
    top: 20px;
    right: 20px;
    background: var(--white);
    border: none;
    border-radius: 50%;
    width: 50px;
    height: 50px;
    cursor: pointer;
    box-shadow: var(--shadow);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
    z-index: 1000;
    transition: all 0.3s ease;
}

.dark-mode-toggle:hover {
    transform: scale(1.1);
}

.main-content {
    display: grid;
    grid-template-columns: 1fr 2fr 1fr;
    gap: 20px;
    align-items: start;
}

.form-container, .map-container {
    background: var(--white);
    padding: 20px;
    border-radius: 15px;
    box-shadow: var(--shadow);
}

.map-container h3 {
    margin-bottom: 15px;
    color: var(--text-color);
    text-align: center;
}

#map {
    height: 400px;
    border-radius: 10px;
    border: 2px solid var(--border-color);
}

.form-group {
    margin-bottom: 20px;
}

label {
    display: block;
    margin-bottom: 8px;
    font-weight: 600;
    color: var(--text-color);
}

input[type="text"] {
    width: 100%;
    padding: 12px;
    border: 2px solid var(--border-color);
    border-radius: 8px;
    font-size: 16px;
    transition: border-color 0.3s ease;
}

input[type="text"]:focus {
    outline: none;
    border-color: var(--primary-color);
}

.slider-container {
    margin-bottom: 20px;
}

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

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

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

.slider-value {
    text-align: center;
    font-weight: bold;
    color: var(--primary-color);
    margin-top: 10px;
}

.checkbox-group {
    display: grid;
    grid-template-columns: 1fr;
    gap: 10px;
    margin-bottom: 20px;
}

.checkbox-item {
    display: flex;
    align-items: center;
    gap: 8px;
}

.checkbox-item input[type="checkbox"] {
    width: 18px;
    height: 18px;
    accent-color: var(--primary-color);
}

.checkbox-item label {
    margin: 0;
    font-weight: normal;
    cursor: pointer;
}

.btn {
    background: var(--primary-color);
    color: white;
    border: none;
    padding: 12px 30px;
    border-radius: 8px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    width: 100%;
}

.btn:hover {
    background: #1d4ed8;
    transform: translateY(-2px);
}

.weather-display {
    background: var(--white);
    border-radius: 15px;
    box-shadow: var(--shadow);
    padding: 30px;
    min-height: 400px;
}

.weather-card {
    background: var(--secondary-color);
    border-radius: 12px;
    padding: 20px;
    margin-bottom: 20px;
    border: 1px solid var(--border-color);
}

.weather-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 15px;
}

.weather-date {
    font-size: 1.1rem;
    font-weight: 600;
    color: var(--text-color);
}

.weather-icon {
    font-size: 2rem;
}

.weather-info {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
    gap: 15px;
}

.info-item {
    text-align: center;
}

.info-value {
    font-size: 1.3rem;
    font-weight: bold;
    color: var(--primary-color);
}

.info-label {
    font-size: 0.8rem;
    color: var(--text-light);
    margin-top: 5px;
}

.loading {
    text-align: center;
    padding: 60px 20px;
    color: var(--text-light);
}

.loading::after {
    content: '';
    width: 40px;
    height: 40px;
    border: 4px solid var(--border-color);
    border-top: 4px solid var(--primary-color);
    border-radius: 50%;
    animation: spin 1s linear infinite;
    display: inline-block;
    margin-top: 20px;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

.error {
    background: #fee2e2;
    color: #dc2626;
    padding: 15px;
    border-radius: 8px;
    margin-bottom: 20px;
    text-align: center;
}

.map-info {
    background: var(--secondary-color);
    padding: 15px;
    border-radius: 8px;
    margin-top: 15px;
    text-align: center;
}

.map-info p {
    margin: 5px 0;
    color: var(--text-color);
}

.map-use {
    text-align: center;
    padding-top:15px;
}

.coordinate {
    font-weight: bold;
    color: var(--primary-color);
}

@media (max-width: 1200px) {
    .main-content {
        grid-template-columns: 1fr 2fr;
        gap: 20px;
    }
    
    .map-container {
        grid-column: 1 / -1;
        order: -1;
    }
}

@media (max-width: 768px) {
    .main-content {
        grid-template-columns: 1fr;
        gap: 20px;
    }

    h1 {
        font-size: 2rem;
    }

    .form-container,
    .weather-display,
    .map-container {
        padding: 20px;
    }

    #map {
        height: 300px;
    }

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