:root {
    --primary-bg: #121214;
    --secondary-bg: #1e1e21;
    --accent-bg: #2a2a2d;
    --text-color: #ffffff;
    --muted-color: #888888;
    --border-color: #333333;
    --highlight-color: #5c7cfa;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
}

body {
    background-color: var(--primary-bg);
    color: var(--text-color);
    min-height: 100vh;
    /* Default block display + auto margin on child centers it horizontally */
}

html {
    background-color: var(--primary-bg);
}

/* Custom Global Scrollbar */
::-webkit-scrollbar {
    width: 8px;
    /* Thin scrollbar */
}

::-webkit-scrollbar-track {
    background: var(--primary-bg);
}

::-webkit-scrollbar-thumb {
    background: linear-gradient(180deg, #2a2a2d 0%, #444448 100%);
    /* Dark gradient */
    border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
    background: #555;
}

/* Main Content */
.main-content {
    display: flex;
    flex-direction: column;
    padding: 30px 40px;
    /* Increased side padding for breathing room */
    /* Add padding here instead of body */
    max-width: 1200px;
    /* Constrain width */
    width: 100%;
    margin: 0 auto;
    /* Center content horizontally */
    /* Removed overflow/height to let page scroll naturally */
}

.header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 30px;
    width: 100%;
    /* Ensure full width */
    min-height: 50px;
    /* Force height */
}

.logo {
    font-size: 28px;
    font-weight: bold;
    color: var(--text-color);
}

.search-bar {
    background-color: var(--secondary-bg);
    border-radius: 20px;
    padding: 8px 15px;
    display: flex;
    align-items: center;
    width: 200px;
    position: relative;
}

/* Recent Searches */
.recent-searches {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background-color: var(--secondary-bg);
    border-radius: 10px;
    margin-top: 5px;
    padding: 5px;
    display: none;
    z-index: 100;
    border: 1px solid var(--border-color);
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.3);
}

.recent-search-item {
    padding: 8px 12px;
    border-radius: 5px;
    cursor: pointer;
    transition: background-color 0.2s;
    color: var(--muted-color);
    font-size: 14px;
}

.recent-search-item:hover {
    background-color: var(--accent-bg);
    color: var(--text-color);
}

.search-bar input {
    background: none;
    border: none;
    color: var(--text-color);
    outline: none;
    flex: 1;
    margin-left: 8px;
}

/* Weather Card */
.weather-card {
    background-color: var(--secondary-bg);
    border-radius: 15px;
    padding: 20px;
    margin-bottom: 20px;
    display: flex;
    align-items: center;
}

.weather-icon {
    font-size: 60px;
    margin-right: 20px;
}

.weather-info {
    display: flex;
    flex-direction: column;
}

.temperature {
    font-size: 48px;
    font-weight: bold;
    margin-bottom: 5px;
}

.condition {
    font-size: 16px;
    color: var(--muted-color);
    margin-bottom: 10px;
}

.location {
    display: flex;
    align-items: center;
    font-size: 14px;
    color: var(--muted-color);
    margin-bottom: 5px;
}

.date-time {
    display: flex;
    align-items: center;
    font-size: 14px;
    color: var(--muted-color);
}

/* Highlights Section */
.highlights {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 15px;
    margin-bottom: 20px;
}

.highlight-card {
    background-color: var(--secondary-bg);
    border-radius: 15px;
    padding: 15px;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
}

.highlight-title {
    font-size: 14px;
    color: var(--muted-color);
    margin-bottom: 10px;
}

.chart-container {
    height: 80px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 10px;
}

.highlight-icon {
    font-size: 48px;
    /* Bigger emojis */
}

.stat-group {
    margin-bottom: 10px;
}

.highlight-value {
    font-size: 28px;
    font-weight: bold;
    margin-bottom: 2px;
}

.highlight-subvalue {
    font-size: 14px;
    color: var(--muted-color);
}

.sun-times {
    display: flex;
    justify-content: space-between;
    margin-bottom: 15px;
}

.sun-item {
    display: flex;
    flex-direction: column;
}

.sun-item .label {
    font-size: 12px;
    color: var(--muted-color);
}

.sun-item .value {
    font-size: 16px;
    font-weight: bold;
}

.highlight-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: auto;
    padding-top: 10px;
    border-top: 1px solid rgba(255, 255, 255, 0.05);
}

.footer-label {
    font-size: 12px;
    color: var(--muted-color);
}

.footer-value {
    font-size: 14px;
    font-weight: bold;
}

/* Forecast Section */
.forecast-section {
    display: flex;
    gap: 20px;
    margin-bottom: 20px;
}

.forecast-card {
    background-color: var(--secondary-bg);
    border-radius: 15px;
    padding: 20px;
    flex: 1;
}

.section-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 15px;
}

.section-title {
    font-size: 18px;
    font-weight: bold;
}

.dropdown {
    background-color: var(--accent-bg);
    border-radius: 8px;
    padding: 5px 10px;
    font-size: 14px;
    cursor: pointer;
}

.forecast-list {
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.forecast-item {
    display: flex;
    align-items: center;
    padding: 10px;
    border-radius: 10px;
    cursor: pointer;
}

.forecast-item:hover {
    background-color: rgba(255, 255, 255, 0.05);
}

.forecast-icon {
    font-size: 24px;
    margin-right: 15px;
}

.forecast-details {
    display: flex;
    flex-direction: column;
}

.forecast-temp {
    font-weight: bold;
}

.forecast-date {
    font-size: 14px;
    color: var(--muted-color);
}

/* Map Section */
.map-card {
    background-color: var(--secondary-bg);
    border-radius: 15px;
    padding: 20px;
    height: 300px;
    position: relative;
}

.map-container {
    width: 100%;
    height: 100%;
    border-radius: 10px;
    overflow: hidden;
    position: relative;
    z-index: 1;
    /* Behind all    controls */
}

.map-controls {
    position: absolute;
    right: 20px;
    top: 20px;
    display: flex;
    flex-direction: column;
    gap: 10px;
    z-index: 2;
    /* Above map */
}

.map-control {
    width: 30px;
    height: 30px;
    background-color: var(--accent-bg);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
}

.map-layers {
    position: absolute;
    bottom: 20px;
    left: 20px;
    display: flex;
    gap: 10px;
}

.map-layer {
    background-color: var(--accent-bg);
    padding: 5px 10px;
    border-radius: 8px;
    font-size: 12px;
    cursor: pointer;
}

/* Responsive Design */
@media (max-width: 1024px) {
    .highlights {
        grid-template-columns: repeat(2, 1fr);
    }

    .forecast-section {
        flex-direction: column;
    }
}

@media (max-width: 768px) {
    .sidebar {
        width: 50px;
    }

    .weather-card {
        flex-direction: column;
        text-align: center;
    }

    .weather-icon {
        margin-right: 0;
        margin-bottom: 15px;
    }

    .highlights {
        grid-template-columns: 1fr;
    }
}

/* Error Message */
.error-message {
    background-color: rgba(255, 82, 82, 0.1);
    color: #ff5252;
    padding: 12px 20px;
    border-radius: 10px;
    border: 1px solid rgba(255, 82, 82, 0.2);
    margin-bottom: 20px;
    display: flex;
    align-items: center;
    gap: 10px;
    animation: fadeIn 0.3s ease;
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(-10px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}