/* -------------------------------------------------------------------------- */
/* BASE & LAYOUT                               */
/* -------------------------------------------------------------------------- */

:root {
    --color-background: #1e1b2f; /* Dark Purple/Blue Background */
    --color-card: #2e2c45;       /* Slightly Lighter Card Background */
    --color-text-primary: #ffffff;
    --color-text-secondary: #a7a6b0;
    --color-highlight: #ffc800;  /* Yellow highlight for buttons/active elements */
    --color-gradient-start: #6a11cb;
    --color-gradient-end: #2575fc;
    --color-accent-blue: #4f73e5;
    --font-family-primary: 'Inter', sans-serif;
}

/* Load Inter font (using Google Fonts link in the future or via @import) */
@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;600;700;900&display=swap');

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
    font-family: var(--font-family-primary);
}

body {
    background-color: var(--color-background);
    color: var(--color-text-primary);
    min-height: 100vh;
    padding: 20px;
}

.app-container {
    max-width: 1400px;
    margin: 0 auto;
    padding: 20px;
    background-color: var(--color-background);
}

/* -------------------------------------------------------------------------- */
/* HEADER & SEARCH                             */
/* -------------------------------------------------------------------------- */

.header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding-bottom: 30px;
    gap: 20px;
    flex-wrap: wrap; /* Allows header items to wrap on mobile */
}

.search-bar {
    display: flex;
    align-items: center;
    background-color: var(--color-card);
    border-radius: 12px;
    padding: 8px 15px;
}

#location-input {
    background: none;
    border: none;
    color: var(--color-text-primary);
    padding: 5px;
    font-size: 1rem;
    outline: none;
    min-width: 200px;
}
#location-input::placeholder {
    color: var(--color-text-secondary);
}

#search-button {
    background: none;
    border: none;
    color: var(--color-text-secondary);
    cursor: pointer;
    padding: 5px;
    transition: color 0.2s;
}
#search-button:hover {
    color: var(--color-highlight);
}

.current-location {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 1.1rem;
    color: var(--color-text-secondary);
}
.current-location i {
    color: var(--color-highlight);
}
#current-temp-small {
    font-weight: 600;
    color: var(--color-text-primary);
}

/* -------------------------------------------------------------------------- */
/* MAIN DASHBOARD LAYOUT                       */
/* -------------------------------------------------------------------------- */

.weather-dashboard {
    display: grid;
    grid-template-columns: 1fr 2fr; /* Left column 1 part, Right column 2 parts */
    gap: 25px;
}

.main-column {
    display: flex;
    flex-direction: column;
    gap: 25px;
}

.side-column {
    display: flex;
    flex-direction: column;
    gap: 25px;
}

/* -------------------------------------------------------------------------- */
/* CARDS STYLING                           */
/* -------------------------------------------------------------------------- */

section {
    background-color: var(--color-card);
    border-radius: 18px;
    padding: 25px;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2);
}

/* Current Weather Card */
.current-weather-card {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
    min-height: 250px;
    background-image: linear-gradient(135deg, var(--color-accent-blue) 0%, #3e488d 100%);
}

.temp-display {
    font-size: 5rem;
    font-weight: 900;
    line-height: 1;
    margin-bottom: 5px;
}
.unit-celsius {
    font-size: 2.5rem;
    font-weight: 700;
    vertical-align: top;
    line-height: 2;
}
.condition-text {
    font-size: 1.5rem;
    font-weight: 600;
    margin-bottom: 10px;
}
.current-icon {
    font-size: 3rem;
    color: var(--color-highlight);
}

/* Detail Grid (Wind, Humidity, etc.) */
.details-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 15px;
}

.detail-card {
    background-color: var(--color-card);
    border-radius: 12px;
    padding: 15px;
    border: 1px solid #3d3b5b;
}
.detail-label {
    font-size: 0.9rem;
    color: var(--color-text-secondary);
    margin-bottom: 5px;
}
.detail-value {
    font-size: 1.3rem;
    font-weight: 700;
}

/* Sunrise/Sunset Card */
.sun-card {
    display: flex;
    flex-direction: column;
    gap: 15px;
    border-radius: 18px;
    background-color: var(--color-card);
}
.sun-time {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 1rem;
    font-weight: 600;
}
.sun-time i {
    color: var(--color-highlight);
    font-size: 1.2rem;
}
.day-length-chart {
    height: 10px;
    background: linear-gradient(to right, #f97316, #ffc800);
    border-radius: 5px;
    position: relative;
    margin-top: 10px;
}
.time-marker {
    position: absolute;
    top: -30px;
    right: 0;
    font-size: 0.8rem;
    color: var(--color-text-secondary);
}

/* -------------------------------------------------------------------------- */
/* FORECAST TABS & GRID                      */
/* -------------------------------------------------------------------------- */

.tab-header {
    display: flex;
    gap: 10px;
    margin-bottom: 20px;
}

.tab-button {
    padding: 8px 15px;
    border: none;
    border-radius: 20px;
    cursor: pointer;
    font-weight: 600;
    transition: all 0.2s;
    background-color: #3d3b5b;
    color: var(--color-text-secondary);
}
.tab-button.active {
    background-color: var(--color-highlight);
    color: #1e1b2f; /* Dark text for contrast */
}

.seven-day-grid {
    display: flex;
    gap: 15px;
    overflow-x: auto; /* Allows horizontal scrolling for many days */
    padding-bottom: 10px;
}

.day-card {
    flex: 0 0 100px; /* Ensures cards maintain a fixed width */
    text-align: center;
    padding: 15px 10px;
    border-radius: 12px;
    background-color: #3d3b5b;
    transition: background-color 0.2s;
    cursor: pointer;
}
.day-card:hover {
    background-color: #4f4d66;
}
.today-card {
    border: 2px solid var(--color-highlight);
}
.day-name {
    font-weight: 600;
    margin-bottom: 10px;
    font-size: 0.9rem;
}
.day-temp-icon i {
    font-size: 1.5rem;
    color: var(--color-highlight);
    margin-bottom: 5px;
}
.day-temp {
    font-size: 1.1rem;
    font-weight: 700;
    margin-top: 5px;
}
.day-low {
    font-size: 0.8rem;
    color: var(--color-text-secondary);
}

/* -------------------------------------------------------------------------- */
/* HOURLY FORECAST / CHART                      */
/* -------------------------------------------------------------------------- */

.hourly-overview-section {
    padding: 25px;
    background-color: var(--color-card);
    border-radius: 18px;
}
.section-sub-title {
    font-size: 1.2rem;
    font-weight: 700;
    margin-bottom: 15px;
}

.hourly-forecast-grid {
    display: flex;
    gap: 10px;
    overflow-x: auto;
    padding-bottom: 15px;
    border-bottom: 1px solid #3d3b5b;
}

.hourly-item {
    flex: 0 0 70px; /* Fixed width for hourly items */
    text-align: center;
    padding: 10px 5px;
    border-radius: 10px;
    transition: background-color 0.2s;
}
.hourly-item:hover {
    background-color: #3d3b5b;
}
.hour-time {
    font-size: 0.8rem;
    color: var(--color-text-secondary);
    margin-bottom: 8px;
}
.hourly-item i {
    font-size: 1.5rem;
    color: var(--color-highlight);
    margin-bottom: 5px;
}
.hour-temp {
    font-weight: 600;
}

.chart-area {
    /* Placeholder for the chart visualization */
    min-height: 200px;
    background-color: #3d3b5b; /* Darker placeholder */
    border-radius: 10px;
    margin-top: 15px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--color-text-secondary);
    font-style: italic;
    font-size: 0.9rem;
}

/* -------------------------------------------------------------------------- */
/* NEWS PANEL (Placeholder)                     */
/* -------------------------------------------------------------------------- */
.news-panel {
    display: flex;
    flex-direction: column;
    gap: 15px;
    background-color: var(--color-card);
    padding: 25px;
}
.news-item {
    padding: 10px 0;
    border-bottom: 1px solid #3d3b5b;
}
.news-title {
    font-size: 1rem;
    font-weight: 600;
    line-height: 1.4;
}
.news-source {
    font-size: 0.75rem;
    color: var(--color-text-secondary);
    margin-top: 5px;
}
.more-news-btn {
    background-color: var(--color-highlight);
    color: #1e1b2f;
    border: none;
    padding: 8px 15px;
    border-radius: 8px;
    cursor: pointer;
    font-weight: 600;
    align-self: flex-start;
    transition: background-color 0.2s;
}
.more-news-btn:hover {
    background-color: #ffda47;
}

/* -------------------------------------------------------------------------- */
/* RESPONSIVENESS (MOBILE)                      */
/* -------------------------------------------------------------------------- */
@media (max-width: 1024px) {
    .weather-dashboard {
        grid-template-columns: 1fr; /* Stack columns on smaller screens */
    }
}

@media (max-width: 600px) {
    .app-container {
        padding: 10px;
    }
    .header {
        flex-direction: column;
        align-items: flex-start;
    }
    .search-bar {
        width: 100%;
    }
    #location-input {
        min-width: 80%;
    }
    .details-grid {
        grid-template-columns: 1fr; /* Stack detail cards on smallest screens */
    }
    .temp-display {
        font-size: 4rem;
    }
    .unit-celsius {
        font-size: 2rem;
    }
}
