/* Reset and Base Styles */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Roboto', sans-serif;
    background: linear-gradient(135deg, #f5f7fa 0%, #e4e8f0 100%);
    color: #333;
    line-height: 1.6;
    min-height: 100vh;
    padding: 20px;
}

.container {
    max-width: 1400px;
    margin: 0 auto;
    background: white;
    border-radius: 20px;
    box-shadow: 0 15px 50px rgba(0, 0, 0, 0.1);
    overflow: hidden;
    min-height: calc(100vh - 40px);
    display: flex;
    flex-direction: column;
}

/* Header Styles */
.header {
    background: linear-gradient(135deg, #2c3e50 0%, #3498db 100%);
    color: white;
    padding: 25px 40px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 20px;
}

.logo-section {
    flex: 1;
}

.back-button {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    color: #ffd700;
    text-decoration: none;
    font-size: 0.9rem;
    margin-bottom: 10px;
    transition: all 0.3s ease;
}

.back-button:hover {
    color: white;
    transform: translateX(-3px);
}

.logo {
    font-family: 'Poppins', sans-serif;
    font-size: 2.5rem;
    font-weight: 700;
    margin-bottom: 5px;
    letter-spacing: -0.5px;
}

.logo-highlight {
    color: #ffd700;
    position: relative;
}

.logo-highlight::after {
    content: '';
    position: absolute;
    bottom: -2px;
    left: 0;
    width: 100%;
    height: 3px;
    background: #ffd700;
    border-radius: 2px;
}

.tagline {
    font-size: 0.95rem;
    opacity: 0.9;
    font-weight: 300;
}

/* Weather Info Styles */
.weather-info {
    background: rgba(255, 255, 255, 0.15);
    backdrop-filter: blur(10px);
    border-radius: 15px;
    padding: 20px;
    display: flex;
    align-items: center;
    gap: 25px;
    flex-wrap: wrap;
    min-width: 300px;
}

.weather-location {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 1.2rem;
    font-weight: 500;
}

.weather-details {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.temperature {
    font-size: 1.8rem;
    font-weight: 700;
    display: flex;
    align-items: center;
    gap: 8px;
}

.weather-condition {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 1rem;
}

.weather-extra {
    display: flex;
    gap: 15px;
    font-size: 0.85rem;
    opacity: 0.9;
}

.weather-extra span {
    display: flex;
    align-items: center;
    gap: 5px;
}

.weather-refresh button {
    background: rgba(255, 255, 255, 0.2);
    border: none;
    color: white;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
}

.weather-refresh button:hover {
    background: rgba(255, 255, 255, 0.3);
    transform: rotate(90deg);
}

/* Weather Controls */
.weather-controls {
    padding: 20px 40px;
    background: #f8fafc;
    border-bottom: 1px solid #eaeaea;
}

.search-filter {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 20px;
}

.location-filter {
    flex: 1;
    min-width: 300px;
    position: relative;
}

.location-filter i {
    position: absolute;
    left: 15px;
    top: 50%;
    transform: translateY(-50%);
    color: #3498db;
    z-index: 1;
}

.location-filter select {
    width: 100%;
    padding: 12px 45px 12px 45px;
    border: 2px solid #e0e6ed;
    border-radius: 10px;
    font-size: 1rem;
    background: white;
    cursor: pointer;
    transition: all 0.3s ease;
    appearance: none;
    -webkit-appearance: none;
    -moz-appearance: none;
}

.location-filter select:focus {
    outline: none;
    border-color: #3498db;
    box-shadow: 0 0 0 3px rgba(52, 152, 219, 0.2);
}

.stats-info {
    display: flex;
    gap: 30px;
    flex-wrap: wrap;
}

.stat-item {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 0.9rem;
    color: #555;
}

.stat-item i {
    color: #3498db;
}

/* Main Content */
.main-content {
    flex: 1;
    padding: 30px 40px;
    display: flex;
    flex-direction: column;
    gap: 40px;
}

.section-title {
    font-family: 'Poppins', sans-serif;
    font-size: 1.8rem;
    color: #2c3e50;
    margin-bottom: 20px;
    display: flex;
    align-items: center;
    gap: 10px;
}

/* Details Section */
.details-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 25px;
}

.detail-card {
    background: white;
    border-radius: 12px;
    padding: 25px;
    box-shadow: 0 5px 20px rgba(0, 0, 0, 0.08);
    border: 1px solid #eaeaea;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    gap: 20px;
}

.detail-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 15px 30px rgba(0, 0, 0, 0.15);
    border-color: #3498db;
}

.detail-icon {
    width: 60px;
    height: 60px;
    background: linear-gradient(135deg, #3498db 0%, #2980b9 100%);
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.8rem;
    color: white;
}

.detail-content {
    flex: 1;
}

.detail-content h3 {
    font-family: 'Poppins', sans-serif;
    font-size: 1.2rem;
    color: #2c3e50;
    margin-bottom: 8px;
}

.detail-value {
    font-size: 2rem;
    font-weight: 700;
    color: #3498db;
    margin-bottom: 5px;
}

.detail-label {
    font-size: 0.9rem;
    color: #666;
}

.detail-label span {
    color: #2c3e50;
    font-weight: 500;
}

/* Charts Section */
.charts-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(350px, 1fr));
    gap: 30px;
}

.chart-container {
    background: white;
    border-radius: 12px;
    padding: 25px;
    box-shadow: 0 5px 20px rgba(0, 0, 0, 0.08);
    border: 1px solid #eaeaea;
    height: 300px;
}

.chart-container h3 {
    font-family: 'Poppins', sans-serif;
    font-size: 1.3rem;
    color: #2c3e50;
    margin-bottom: 20px;
    display: flex;
    align-items: center;
    gap: 10px;
}

.chart-container canvas {
    width: 100% !important;
    height: calc(100% - 40px) !important;
}

/* Forecast Section */
.forecast-container {
    background: white;
    border-radius: 12px;
    padding: 20px;
    box-shadow: 0 5px 20px rgba(0, 0, 0, 0.08);
    border: 1px solid #eaeaea;
    overflow: hidden;
}

.forecast-scroll {
    display: flex;
    gap: 20px;
    overflow-x: auto;
    padding: 10px 0;
    scrollbar-width: thin;
    scrollbar-color: #3498db #f1f1f1;
}

.forecast-scroll::-webkit-scrollbar {
    height: 8px;
}

.forecast-scroll::-webkit-scrollbar-track {
    background: #f1f1f1;
    border-radius: 4px;
}

.forecast-scroll::-webkit-scrollbar-thumb {
    background: #3498db;
    border-radius: 4px;
}

.forecast-card {
    min-width: 180px;
    background: #f8fafc;
    border-radius: 10px;
    padding: 20px;
    border: 1px solid #eaeaea;
    transition: all 0.3s ease;
}

.forecast-card:hover {
    background: #e3f2fd;
    border-color: #3498db;
}

.forecast-time {
    font-size: 1rem;
    color: #2c3e50;
    font-weight: 600;
    margin-bottom: 15px;
    text-align: center;
}

.forecast-temp {
    font-size: 2rem;
    font-weight: 700;
    color: #e74c3c;
    text-align: center;
    margin-bottom: 10px;
}

.forecast-details {
    display: flex;
    flex-direction: column;
    gap: 8px;
    font-size: 0.9rem;
    color: #666;
}

.forecast-details div {
    display: flex;
    justify-content: space-between;
}

/* Table Section */
.table-container {
    background: white;
    border-radius: 12px;
    padding: 25px;
    box-shadow: 0 5px 20px rgba(0, 0, 0, 0.08);
    border: 1px solid #eaeaea;
    overflow: auto;
}

#weatherTable {
    width: 100%;
    border-collapse: collapse;
}

#weatherTable thead {
    background: #f8fafc;
}

#weatherTable th {
    padding: 15px;
    text-align: left;
    font-family: 'Poppins', sans-serif;
    color: #2c3e50;
    font-weight: 600;
    border-bottom: 2px solid #eaeaea;
}

#weatherTable td {
    padding: 15px;
    border-bottom: 1px solid #eaeaea;
    color: #555;
}

#weatherTable tbody tr:hover {
    background: #f8fafc;
}

#weatherTable tbody tr.current-location {
    background: #e3f2fd !important;
    border-left: 4px solid #3498db;
}

/* Footer */
.footer {
    background: #2c3e50;
    color: white;
    padding: 20px 40px;
    margin-top: auto;
}

.footer-content {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 15px;
}

.footer-status {
    display: flex;
    align-items: center;
    gap: 15px;
    font-size: 0.9rem;
    flex-wrap: wrap;
}

.separator {
    opacity: 0.5;
}

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

.loading-overlay.active {
    display: flex;
}

.loading-content {
    background: white;
    border-radius: 15px;
    padding: 40px;
    text-align: center;
    max-width: 300px;
}

.loading-spinner {
    width: 50px;
    height: 50px;
    border: 5px solid #f3f3f3;
    border-top: 5px solid #3498db;
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin: 0 auto 20px;
}

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

/* Responsive Design */
@media (max-width: 1024px) {
    .header {
        flex-direction: column;
        text-align: center;
        padding: 20px;
    }

    .weather-info {
        width: 100%;
        justify-content: center;
    }

    .search-filter {
        flex-direction: column;
        align-items: stretch;
    }

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

@media (max-width: 768px) {
    .container {
        border-radius: 10px;
    }

    .weather-controls,
    .main-content {
        padding: 20px;
    }

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

    .footer-content {
        flex-direction: column;
        text-align: center;
    }

    .footer-status {
        justify-content: center;
    }
}

@media (max-width: 480px) {
    .logo {
        font-size: 2rem;
    }

    .weather-info {
        flex-direction: column;
        text-align: center;
        gap: 15px;
    }

    .section-title {
        font-size: 1.5rem;
    }

    .detail-value {
        font-size: 1.5rem;
    }
}

/* Scrollbar Styling */
::-webkit-scrollbar {
    width: 8px;
}

::-webkit-scrollbar-track {
    background: #f1f1f1;
    border-radius: 4px;
}

::-webkit-scrollbar-thumb {
    background: #3498db;
    border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
    background: #2980b9;
}