/* Reset and base styles */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    background-color: #252525;
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    min-height: 100vh;
    padding: 0rem;
    color: white;
}

.container {
    max-width: 1800px;
    margin: 0 auto;
}

.weather-card {
    background: rgb(47, 47, 48);
    border-radius: 24px;
    padding: 2rem;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.1);
}

/* Main grid layout */
.weather-grid {
    display: flex;
    flex-direction: column;
    gap: 1rem;
    margin-bottom: 2rem;
}

/* Location Section */
.location-section {
    width: 100%;
}

.search {
    display: flex;
    gap: 0.5rem;
    margin-bottom: 1.5rem;
}

.search input {
    flex: 1;
    padding: 0.75rem;
    border: 2px solid rgba(255, 255, 255, 0.1);
    border-radius: 12px;
    background: rgba(255, 255, 255, 0.1);
    color: white;
    font-size: 1rem;
}

.search input:focus {
    outline: none;
    border-color: rgba(255, 255, 255, 0.3);
}

.search button {
    background: rgba(255, 255, 255, 0.1);
    border: none;
    border-radius: 12px;
    padding: 0.75rem;
    cursor: pointer;
    transition: background-color 0.3s ease;
}

.search button:hover {
    background: rgb(147, 147, 147);
}

.search button img {
    width: 20px;
    height: 20px;    
}

.location-info p {
    margin: 0.5rem 0;
    color: rgba(255, 255, 255, 0.8);
}

/* Current Weather Section */
.current-weather {
    width: 100%;
    padding: 1rem;
    margin: 0.5rem 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    gap: 0.5rem;
    background: linear-gradient(135deg, rgba(255, 255, 255, 0.1), rgba(255, 255, 255, 0.05));
    border-radius: 16px;
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.current-weather #currentDay {
    font-size: 1rem;
    color: rgba(255, 255, 255, 0.9);
    margin-bottom: 0;
}

.current-weather img {
    width: 60px;
    height: auto;
    margin: 0;
}

.current-weather h3 {
    font-size: 1.5rem;
    margin: 0;
    color: rgba(255, 255, 255, 0.95);
}

.current-weather #currentDesc {
    font-size: 1rem;
    color: rgba(255, 255, 255, 0.8);
    text-transform: capitalize;
    margin: 0;
}

/* Weather Details Section */
.weather-details {
    width: 100%;
    padding: 0;
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.weather-details p {
    width: 100%;
    padding: 0.75rem 1rem;
    background: linear-gradient(135deg, rgba(255, 255, 255, 0.08), rgba(255, 255, 255, 0.03));
    border-radius: 12px;
    color: rgba(255, 255, 255, 0.9);
    font-size: 0.9rem;
    text-align: left;
    margin: 0;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

/* Forecast Section */
.forecast-section {
    grid-column: 1 / -1;
    margin-top: 2rem;
}

.days {
    display: grid;
    grid-template-columns: repeat(6, 1fr);
    gap: 1rem;
}

.day-card {
    background: linear-gradient(135deg, rgba(255, 255, 255, 0.1), rgba(255, 255, 255, 0.05));
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 12px;
    padding: 0.75rem 1rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.day-info {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.day-info img {
    width: 30px;
    height: 30px;
}

/* Statistics Section */
.stats-section {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 2rem;
    margin: 2rem 0;
}

.stats-card {
    background: linear-gradient(135deg, rgba(255, 255, 255, 0.1), rgba(255, 255, 255, 0.05));
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 16px;
    padding: 1.5rem;
}

.stats-card h4 {
    margin-bottom: 1rem;
    color: rgba(255, 255, 255, 0.9);
}

.stats-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 1rem;
}

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

/* Chart Controls */
.chart-controls {
    display: flex;
    gap: 0.75rem;
    flex-wrap: wrap;
    justify-content: center;
    margin: 2rem 0;
    padding: 1rem;
    background: linear-gradient(135deg, rgba(255, 255, 255, 0.05), rgba(255, 255, 255, 0.02));
    border-radius: 12px;
}

.chart-controls button {
    padding: 0.75rem 1.25rem;
    border: none;
    border-radius: 8px;
    background: rgba(255, 255, 255, 0.1);
    color: white;
    cursor: pointer;
    transition: all 0.3s ease;
    font-size: 0.95rem;
    min-width: 150px;
}

.chart-controls button:hover {
    background: rgba(255, 255, 255, 0.2);
}

.chart-controls button.active {
    background: rgba(255, 255, 255, 0.3);
}

/* Historical Data Section */
.historical-section {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
    margin: 2rem auto;
    padding: 1.5rem;
    background: linear-gradient(135deg, rgba(255, 255, 255, 0.1), rgba(255, 255, 255, 0.05));
    border-radius: 16px;
    border: 1px solid rgba(255, 255, 255, 0.1);
    max-width: 600px;
}

.historical-section h2 {
    color: white;
    margin-bottom: 1rem;
    font-size: 1.1rem;
}

.time-period-selector {
    display: flex;
    align-items: center;
    gap: 1rem;
    margin-top: 0.5rem;
}

.time-period-selector label {
    color: white;
    font-size: 1rem;
}

#pastDaysDropdown {
    padding: 0.5rem 1rem;
    border: none;
    border-radius: 8px;
    background: rgba(255, 255, 255, 0.1);
    color: white;
    font-size: 1rem;
    cursor: pointer;
    transition: all 0.3s ease;
}

#pastDaysDropdown:hover {
    background: rgba(255, 255, 255, 0.2);
}

#pastDaysDropdown option {
    background: #1a1a1a;
    color: white;
}

/* Charts Section */
.charts-wrapper {
    position: relative;
    width: 100%;
    height: 500px;
    margin-top: 2rem;
    padding: 1rem;
    background: linear-gradient(135deg, rgba(255, 255, 255, 0.1), rgba(255, 255, 255, 0.05));
    border-radius: 16px;
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.chart-container {
    position: absolute;
    width: 100%;
    height: 100%;
    opacity: 0;
    visibility: hidden;
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    padding: 1rem;
}

.chart-container canvas {
    width: 100% !important;
    height: 100% !important;
}

.chart-container.show {
    opacity: 1;
    visibility: visible;
}

.collapse {
    display: none;
    width: 100%;
    height: 100%;
}

.collapse.show {
    display: block;
}

/* Responsive Design */
@media (max-width: 1400px) {
    .weather-grid {
        grid-template-columns: 250px 300px 1fr;
    }
    
    .forecast-section {
        grid-column: 1 / -1;
        margin-top: 2rem;
    }
    
    .days {
        display: grid;
        grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
        gap: 1rem;
    }
}

@media (max-width: 1000px) {
    .weather-grid {
        grid-template-columns: 1fr;
        gap: 1.5rem;
    }
    
    .stats-section {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 600px) {
    body {
        padding: 10px;
    }
    
    .weather-card {
        padding: 1rem;
    }
    
    .chart-controls {
        justify-content: center;
    }
    
    .time-period-selector {
        flex-direction: column;
    }
}

/* Mobile First Approach - Default styles for mobile */
@media only screen and (max-width: 480px) {
    .container {
        padding: 0.75rem;
    }

    .weather-card {
        padding: 1rem;
    }

    .weather-grid {
        display: flex;
        flex-direction: column;
        gap: 1rem;
    }

    .location-section {
        width: 100%;
        margin-bottom: 0.5rem;
    }

    .search {
        width: 100%;
        margin-bottom: 1rem;
    }

    .search input {
        flex: 1;
        min-width: 0;
    }

    .location-info p {
        padding: 0.5rem 0;
        color: rgba(255, 255, 255, 0.8);
        font-size: 0.9rem;
    }

    .current-weather {
        width: 100%;
        padding: 1.5rem;
        margin: 0.5rem 0;
        display: flex;
        flex-direction: column;
        align-items: center;
        text-align: center;
        gap: 1rem;
        background: linear-gradient(135deg, rgba(255, 255, 255, 0.1), rgba(255, 255, 255, 0.05));
        border-radius: 16px;
        border: 1px solid rgba(255, 255, 255, 0.1);
    }

    .current-weather #currentDay {
        font-size: 1.2rem;
        color: rgba(255, 255, 255, 0.9);
        margin-bottom: 0.5rem;
    }

    .current-weather img {
        width: 80px;
        height: auto;
        margin-bottom: 0.5rem;
    }

    .current-weather h3 {
        font-size: 2rem;
        margin: 0;
        color: rgba(255, 255, 255, 0.95);
    }

    .current-weather #currentDesc {
        font-size: 1.1rem;
        color: rgba(255, 255, 255, 0.8);
        text-transform: capitalize;
        margin: 0;
    }

    .weather-details {
        width: 100%;
        padding: 0;
        display: flex;
        flex-direction: column;
        gap: 0.5rem;
    }

    .weather-details p {
        width: 100%;
        padding: 0.75rem 1rem;
        background: linear-gradient(135deg, rgba(255, 255, 255, 0.08), rgba(255, 255, 255, 0.03));
        border-radius: 12px;
        color: rgba(255, 255, 255, 0.9);
        font-size: 0.9rem;
        text-align: left;
        margin: 0;
        display: flex;
        justify-content: space-between;
        align-items: center;
    }

    .forecast-section {
        width: 100%;
        overflow-x: auto;
        margin-top: 1rem;
    }

    .days {
        display: flex;
        gap: 1rem;
        min-width: max-content;
        padding-bottom: 1rem;
    }

    .day-card {
        min-width: 120px;
        padding: 0.75rem;
    }
}

/* Tablet */
@media only screen and (min-width: 481px) and (max-width: 768px) {
    .container {
        padding: 1.5rem;
    }

    .weather-grid {
        grid-template-columns: 1fr;
        gap: 2rem;
    }

    .stats-section {
        grid-template-columns: 1fr;
        gap: 1.5rem;
    }

    .charts-wrapper {
        height: 400px;
    }

    .chart-controls button {
        padding: 0.6rem 1rem;
        font-size: 0.9rem;
    }
}

/* Laptop */
@media only screen and (min-width: 769px) and (max-width: 1024px) {
    .container {
        padding: 2rem;
    }

    .weather-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 2rem;
    }

    .forecast-section {
        grid-column: 1 / -1;
    }

    .stats-section {
        grid-template-columns: repeat(2, 1fr);
        gap: 2rem;
    }

    .charts-wrapper {
        height: 450px;
    }
}

/* Desktop HD and Full HD */
@media only screen and (min-width: 1025px) {
    .container {
        padding: 2rem;
        max-width: 1800px;
        margin: 0 auto;
    }

    .weather-grid {
        display: grid;
        grid-template-columns: repeat(3, 1fr);
        gap: 2.5rem;
    }

    .forecast-section {
        grid-column: 1 / -1;
        margin-top: 2.5rem;
    }

    .days {
        display: grid;
        grid-template-columns: repeat(6, 1fr);
        gap: 2rem;
    }

    .day-card {
        padding: 1.25rem;
        background: linear-gradient(135deg, rgba(255, 255, 255, 0.1), rgba(255, 255, 255, 0.05));
        border: 1px solid rgba(255, 255, 255, 0.1);
        border-radius: 16px;
        display: flex;
        flex-direction: column;
        align-items: center;
        text-align: center;
        gap: 1rem;
    }

    .day-info {
        display: flex;
        flex-direction: column;
        align-items: center;
        gap: 1rem;
        width: 100%;
    }

    .day-info img {
        width: 60px;
        height: 60px;
    }

    .stats-section {
        grid-template-columns: repeat(2, 1fr);
        gap: 2.5rem;
        margin: 2.5rem 0;
    }

    .stats-card {
        padding: 1.75rem;
    }

    .stats-card h4 {
        font-size: 1rem;
        margin-bottom: 1.25rem;
    }

    .stats-grid {
        gap: 1.25rem;
        font-size: 0.9rem;
    }

    .stat-item {
        font-size: 0.9rem;
    }

    .chart-controls {
        gap: 1.25rem;
        margin: 2.5rem 0;
    }

    .chart-controls button {
        padding: 0.875rem 1.75rem;
        font-size: 1.1rem;
        min-width: 180px;
    }

    .charts-wrapper {
        height: 500px;
        margin-top: 2.5rem;
    }

    .current-weather {
        padding: 2rem;
        display: flex;
        flex-direction: column;
        align-items: center;
        text-align: center;
    }

    .current-weather #currentDay {
        font-size: 1.6rem;
        margin-bottom: 1.25rem;
    }

    .current-weather img {
        width: 120px;
        margin-bottom: 1rem;
    }

    .current-weather h3 {
        font-size: 2rem;
    }

    .current-weather #currentDesc {
        font-size: 1.2rem;
    }

    .weather-details {
        padding: 1rem;
    }

    .weather-details p {
        padding: 1rem 1.5rem;
        font-size: 1.1rem;
    }

    .historical-section {
        padding: 2rem;
        margin: 2.5rem auto;
    }

    .historical-section h2 {
        font-size: 1.4rem;
        margin-bottom: 1.25rem;
    }

    #pastDaysDropdown {
        padding: 0.75rem 1.25rem;
        font-size: 1.1rem;
    }
}

/* 2K and 4K */
@media only screen and (min-width: 1921px) {
    .container {
        padding: 3rem;
        max-width: 2000px;
        margin: 0 auto;
    }

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

    .forecast-section {
        grid-column: 1 / -1;
        margin-top: 3rem;
    }

    .days {
        display: grid;
        grid-template-columns: repeat(6, 1fr);
        gap: 2rem;
    }

    .day-card {
        padding: 1.5rem;
        background: linear-gradient(135deg, rgba(255, 255, 255, 0.1), rgba(255, 255, 255, 0.05));
        border: 1px solid rgba(255, 255, 255, 0.1);
        border-radius: 16px;
        display: flex;
        flex-direction: column;
        align-items: center;
        text-align: center;
        gap: 1rem;
    }

    .day-info {
        display: flex;
        flex-direction: column;
        align-items: center;
        gap: 1rem;
        width: 100%;
    }

    .day-info img {
        width: 80px;
        height: 80px;
    }

    .stats-section {
        grid-template-columns: repeat(2, 1fr);
        gap: 3rem;
    }

    .stats-card {
        padding: 2rem;
    }

    .stats-card h4 {
        font-size: 1.2rem;
        margin-bottom: 1.5rem;
    }

    .stats-grid {
        gap: 1.5rem;
        font-size: 1rem;
    }

    .stat-item {
        font-size: 1rem;
    }

    .chart-controls button {
        padding: 1rem 2rem;
        font-size: 1.2rem;
        min-width: 200px;
    }

    .current-weather #currentDay {
        font-size: 1.8rem;
        margin-bottom: 1.5rem;
    }
}

/* Dark Mode and High Contrast Support */
@media (prefers-color-scheme: dark) {
    .weather-card {
        background: rgba(0, 0, 0, 0.3);
    }

    .search input {
        background: rgba(255, 255, 255, 0.1);
        color: white;
    }

    .chart-controls button:hover {
        background: rgba(255, 255, 255, 0.3);
    }
}

/* Reduced Motion */
@media (prefers-reduced-motion: reduce) {
    .chart-container {
        transition: none;
    }

    .chart-controls button {
        transition: none;
    }
}


