/* Reset and Base Styles */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    line-height: 1.6;
    color: #333;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    min-height: 100vh;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
}

/* Header */
header {
    background: rgba(255, 255, 255, 0.95);
    padding: 30px 0;
    text-align: center;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
}

header h1 {
    font-size: 2.5rem;
    color: #2c3e50;
    margin-bottom: 10px;
}

.subtitle {
    color: #7f8c8d;
    font-size: 1.1rem;
}

/* Main Content */
main {
    padding: 40px 0;
}

/* Weather Card */
.weather-card {
    background: rgba(255, 255, 255, 0.95);
    border-radius: 20px;
    padding: 40px;
    margin-bottom: 30px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.2);
}

.weather-main {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 30px;
    flex-wrap: wrap;
    gap: 20px;
}

.temperature {
    display: flex;
    align-items: flex-start;
}

.temp-value {
    font-size: 5rem;
    font-weight: 700;
    color: #2c3e50;
    line-height: 1;
}

.temp-unit {
    font-size: 2.5rem;
    color: #7f8c8d;
    margin-left: 5px;
}

.weather-icon {
    font-size: 5rem;
}

.weather-description h2 {
    font-size: 1.8rem;
    color: #2c3e50;
    margin-bottom: 10px;
    text-transform: capitalize;
}

.location {
    color: #7f8c8d;
    font-size: 1.1rem;
}

.weather-details {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    gap: 20px;
    margin-top: 30px;
    padding-top: 30px;
    border-top: 2px solid #ecf0f1;
}

.detail-item {
    text-align: center;
}

.detail-item .label {
    display: block;
    color: #7f8c8d;
    font-size: 0.9rem;
    margin-bottom: 5px;
}

.detail-item .value {
    display: block;
    font-size: 1.3rem;
    font-weight: 600;
    color: #2c3e50;
}

/* Forecast Section */
.forecast-section {
    background: rgba(255, 255, 255, 0.95);
    border-radius: 20px;
    padding: 40px;
    margin-bottom: 30px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.2);
}

.forecast-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 30px;
    flex-wrap: wrap;
    gap: 20px;
}

.forecast-section h2 {
    font-size: 2rem;
    color: #2c3e50;
    margin: 0;
}

.forecast-tabs {
    display: flex;
    gap: 10px;
}

.forecast-tabs .tab {
    padding: 10px 20px;
    background: #f8f9fa;
    border-radius: 8px;
    cursor: pointer;
    font-weight: 600;
    color: #7f8c8d;
    transition: all 0.3s ease;
    border: 2px solid transparent;
}

.forecast-tabs .tab:hover {
    background: #e9ecef;
    color: #2c3e50;
}

.forecast-tabs .tab.active {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border-color: #667eea;
}

.forecast-container {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 20px;
}

.forecast-item {
    background: #f8f9fa;
    border-radius: 15px;
    padding: 20px;
    text-align: center;
    transition: transform 0.3s ease;
}

.forecast-item:hover {
    transform: translateY(-5px);
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.1);
}

.forecast-date {
    font-weight: 600;
    color: #2c3e50;
    margin-bottom: 10px;
    font-size: 1rem;
}

.forecast-icon {
    font-size: 3rem;
    margin: 15px 0;
}

.forecast-temp {
    font-size: 1.3rem;
    font-weight: 700;
    color: #2c3e50;
    margin-bottom: 5px;
    line-height: 1.4;
}

.forecast-desc {
    color: #7f8c8d;
    font-size: 0.9rem;
    text-transform: capitalize;
}

.ensemble-badge {
    display: inline-block;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    font-size: 0.7rem;
    padding: 2px 8px;
    border-radius: 10px;
    margin-left: 8px;
    font-weight: 600;
}

/* Forecast Table */
.forecast-table-wrapper {
    margin-top: 30px;
    overflow-x: auto;
}

.forecast-table {
    width: 100%;
    border-collapse: collapse;
    background: white;
    border-radius: 10px;
    overflow: hidden;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
}

.forecast-table thead {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
}

.forecast-table th {
    padding: 15px;
    text-align: left;
    font-weight: 600;
    font-size: 0.95rem;
}

.forecast-table td {
    padding: 15px;
    border-bottom: 1px solid #ecf0f1;
    color: #2c3e50;
}

.forecast-table tbody tr:hover {
    background: #f8f9fa;
}

.forecast-table tbody tr:last-child td {
    border-bottom: none;
}

.table-date {
    font-weight: 600;
    color: #2c3e50;
}

.table-weather {
    display: flex;
    align-items: center;
    gap: 10px;
}

.table-weather-icon {
    font-size: 1.5rem;
}

.table-weather-desc {
    color: #555;
    font-size: 0.9rem;
}

.table-precipitation {
    color: #667eea;
    font-weight: 600;
}

.table-temp-day {
    font-weight: 700;
    color: #2c3e50;
    font-size: 1.1rem;
}

.table-temp-night {
    color: #7f8c8d;
    font-size: 0.95rem;
}

/* Info Section */
.info-section {
    background: rgba(255, 255, 255, 0.95);
    border-radius: 20px;
    padding: 40px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.2);
}

.info-section h2 {
    font-size: 2rem;
    color: #2c3e50;
    margin-bottom: 20px;
}

.info-section p {
    color: #555;
    margin-bottom: 15px;
    line-height: 1.8;
}

.info-section h3 {
    font-size: 1.5rem;
    color: #2c3e50;
    margin-top: 30px;
    margin-bottom: 20px;
    padding-top: 20px;
    border-top: 2px solid #ecf0f1;
}

.api-info {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 20px;
    margin-top: 20px;
}

.api-item {
    background: #f8f9fa;
    padding: 20px;
    border-radius: 10px;
    border-left: 4px solid #667eea;
}

.api-item h4 {
    font-size: 1.2rem;
    color: #2c3e50;
    margin-bottom: 10px;
}

.api-item p {
    color: #555;
    font-size: 0.95rem;
    line-height: 1.6;
    margin-bottom: 10px;
}

.api-item a {
    color: #667eea;
    text-decoration: none;
    font-weight: 600;
}

.api-item a:hover {
    text-decoration: underline;
}

.api-url {
    background: #e9ecef;
    padding: 10px;
    border-radius: 5px;
    font-family: 'Courier New', monospace;
    font-size: 0.85rem;
    word-break: break-all;
    margin-top: 10px;
}

.api-url code {
    color: #495057;
    background: transparent;
    padding: 0;
}

/* Loading and Error States */
.loading, .error {
    text-align: center;
    padding: 40px;
    color: #7f8c8d;
    font-size: 1.1rem;
}

.error {
    color: #e74c3c;
}

/* Footer */
footer {
    background: rgba(255, 255, 255, 0.95);
    padding: 30px 0;
    text-align: center;
    margin-top: 40px;
}

footer p {
    color: #7f8c8d;
    margin: 5px 0;
    font-size: 0.9rem;
}

.author-credit {
    margin-top: 15px;
    padding-top: 15px;
    border-top: 1px solid rgba(255, 255, 255, 0.2);
}

.author-credit a {
    color: #667eea;
    text-decoration: none;
    font-weight: 600;
}

.author-credit a:hover {
    text-decoration: underline;
}

/* Responsive Design */
@media (max-width: 768px) {
    header h1 {
        font-size: 2rem;
    }
    
    .subtitle {
        font-size: 1rem;
    }
    
    .weather-card, .forecast-section, .info-section {
        padding: 25px;
    }
    
    .temp-value {
        font-size: 4rem;
    }
    
    .temp-unit {
        font-size: 2rem;
    }
    
    .weather-icon {
        font-size: 4rem;
    }
    
    .weather-description h2 {
        font-size: 1.5rem;
    }
    
    .weather-details {
        grid-template-columns: repeat(2, 1fr);
    }
    
    .forecast-container {
        grid-template-columns: 1fr;
    }
    
    .forecast-section h2, .info-section h2 {
        font-size: 1.5rem;
    }
    
    .forecast-header {
        flex-direction: column;
        align-items: flex-start;
    }
    
    .forecast-tabs {
        width: 100%;
        justify-content: center;
    }
    
    .forecast-tabs .tab {
        flex: 1;
        text-align: center;
        padding: 8px 15px;
        font-size: 0.9rem;
    }
    
    .forecast-table-wrapper {
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
    }
    
    .forecast-table {
        min-width: 600px;
    }
    
    .forecast-table th,
    .forecast-table td {
        padding: 10px 8px;
        font-size: 0.85rem;
    }
    
    .forecast-header h2 {
        font-size: 1.3rem;
    }
    
    .forecast-tabs .tab {
        padding: 6px 12px;
        font-size: 0.8rem;
    }
    
    .forecast-table {
        min-width: 500px;
        font-size: 0.8rem;
    }
    
    .forecast-table th,
    .forecast-table td {
        padding: 8px 5px;
    }
    
    .info-section h3 {
        font-size: 1.3rem;
    }
    
    .api-info {
        grid-template-columns: 1fr;
    }
    
    .api-url {
        font-size: 0.75rem;
    }
}

@media (max-width: 480px) {
    .container {
        padding: 0 15px;
    }
    
    header {
        padding: 20px 0;
    }
    
    header h1 {
        font-size: 1.75rem;
    }
    
    main {
        padding: 20px 0;
    }
    
    .weather-card, .forecast-section, .info-section {
        padding: 20px;
        border-radius: 15px;
    }
    
    .temp-value {
        font-size: 3.5rem;
    }
    
    .temp-unit {
        font-size: 1.75rem;
    }
    
    .weather-icon {
        font-size: 3.5rem;
    }
    
    .weather-details {
        grid-template-columns: 1fr;
        gap: 15px;
    }
    
    .forecast-header h2 {
        font-size: 1.2rem;
    }
    
    .forecast-tabs {
        flex-wrap: wrap;
    }
    
    .forecast-tabs .tab {
        flex: 1 1 calc(33.333% - 10px);
        min-width: 80px;
        padding: 6px 8px;
        font-size: 0.75rem;
    }
    
    .forecast-table {
        min-width: 450px;
    }
    
    .forecast-table th,
    .forecast-table td {
        padding: 8px 4px;
        font-size: 0.75rem;
    }
    
    .table-weather {
        flex-direction: column;
        gap: 5px;
    }
    
    .table-weather-icon {
        font-size: 1.2rem;
    }
}

