/* Norwegian Weather App Styles */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Helvetica Neue', 'Arial', sans-serif;
    background: linear-gradient(180deg, #e8f4f8 0%, #cfe9f3 100%);
    min-height: 100vh;
    color: #333;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 20px;
}

header {
    text-align: center;
    margin-bottom: 30px;
    padding: 40px 20px;
    background: linear-gradient(135deg, #0066cc 0%, #004d99 100%);
    border-radius: 4px;
    box-shadow: 0 2px 8px rgba(0, 102, 204, 0.2);
}

header h1 {
    font-size: 2.5rem;
    margin-bottom: 10px;
    color: white;
    text-shadow: 2px 2px 4px rgba(0,0,0,0.2);
}

header p {
    font-size: 1.1rem;
    color: rgba(255, 255, 255, 0.95);
}

.search-section {
    background: white;
    border-radius: 4px;
    padding: 30px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
    margin-bottom: 20px;
}

.search-box {
    display: flex;
    gap: 15px;
    margin-bottom: 20px;
}

.autocomplete-wrapper {
    flex: 1;
    position: relative;
}

#locationInput {
    width: 100%;
    padding: 15px;
    border: 1px solid #cfe9f3;
    border-radius: 3px;
    font-size: 16px;
    transition: border-color 0.3s ease;
}

#locationInput:focus {
    outline: none;
    border-color: #0066cc;
}

.autocomplete-items {
    position: absolute;
    border: 1px solid #cfe9f3;
    border-top: none;
    z-index: 99;
    top: 100%;
    left: 0;
    right: 0;
    background: white;
    max-height: 300px;
    overflow-y: auto;
    border-radius: 0 0 3px 3px;
    box-shadow: 0 4px 8px rgba(0,0,0,0.1);
}

.autocomplete-items div {
    padding: 12px 15px;
    cursor: pointer;
    border-bottom: 1px solid #f0f0f0;
    font-size: 14px;
}

.autocomplete-items div:hover {
    background-color: #e8f4f8;
}

.autocomplete-items div.autocomplete-active {
    background-color: #0066cc !important;
    color: white;
}

#searchButton {
    padding: 15px 30px;
    background: linear-gradient(135deg, #0066cc 0%, #004d99 100%);
    color: white;
    border: none;
    border-radius: 3px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
}

#searchButton:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 102, 204, 0.4);
}

#searchButton:disabled {
    opacity: 0.6;
    cursor: not-allowed;
    transform: none;
}

.loading {
    text-align: center;
    padding: 20px;
}

.spinner {
    width: 40px;
    height: 40px;
    border: 4px solid #e8f4f8;
    border-top: 4px solid #0066cc;
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin: 0 auto 15px;
}

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

.error {
    background: #ffebee;
    color: #c62828;
    padding: 15px;
    border-radius: 3px;
    margin-bottom: 20px;
    border-left: 4px solid #c62828;
}

.results {
    background: white;
    border-radius: 4px;
    padding: 30px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
    margin-bottom: 20px;
}

.location-info {
    text-align: center;
    margin-bottom: 30px;
    padding-bottom: 20px;
    border-bottom: 2px solid #cfe9f3;
}

.location-info h2 {
    color: #0066cc;
    font-size: 2rem;
    margin-bottom: 10px;
}

.location-info p {
    color: #555;
    font-size: 1.1rem;
}

.map-section {
    margin-bottom: 30px;
    padding-bottom: 30px;
    border-bottom: 2px solid #cfe9f3;
}

.map-section h3 {
    color: #004d99;
    margin-bottom: 15px;
    font-size: 1.5rem;
}

#map {
    height: 350px;
    width: 100%;
    border-radius: 3px;
    box-shadow: 0 2px 6px rgba(0,0,0,0.1);
    z-index: 1;
    border: 1px solid #cfe9f3;
}

.data-section h3 {
    color: #004d99;
    margin-bottom: 20px;
    font-size: 1.5rem;
}

.chart-wrapper {
    background: #f5fbff;
    border-radius: 3px;
    padding: 20px;
    margin-bottom: 30px;
    border: 1px solid #cfe9f3;
}

.chart-title {
    font-size: 1.1rem;
    font-weight: 600;
    color: #004d99;
    text-align: center;
    margin-bottom: 10px;
}

.chart-legend {
    display: flex;
    justify-content: center;
    gap: 20px;
    margin-bottom: 15px;
    flex-wrap: wrap;
}

.chart-legend-item {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 0.9rem;
}

.chart-legend-color {
    width: 30px;
    height: 3px;
    border-radius: 2px;
}

.chart-scroll-container {
    overflow-x: auto;
    overflow-y: hidden;
    -webkit-overflow-scrolling: touch;
    position: relative;
}

.chart-scroll-container canvas {
    max-width: none;
    /* Height controlled by JavaScript for responsive behavior */
}

.table-container {
    overflow-x: auto;
    border-radius: 3px;
    border: 1px solid #cfe9f3;
}

.table-note {
    font-size: 0.9rem;
    color: #666;
    font-style: italic;
    margin-bottom: 10px;
    text-align: right;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
}

table {
    width: 100%;
    border-collapse: collapse;
    background: white;
}

th, td {
    padding: 12px 15px;
    text-align: left;
    border-bottom: 1px solid #e1e5e9;
}

td:nth-child(2),
td:nth-child(3),
td:nth-child(4) {
    text-align: center;
}

th {
    background: linear-gradient(135deg, #0066cc 0%, #004d99 100%);
    color: white;
    font-weight: bold;
    text-transform: uppercase;
    font-size: 0.9rem;
    letter-spacing: 0.5px;
}

tr:hover {
    background: #e8f4f8;
}

tr:nth-child(even) {
    background: #f5fbff;
}

tr:nth-child(even):hover {
    background: #e8f4f8;
}

footer {
    text-align: center;
    color: #004d99;
    opacity: 0.8;
    margin-top: 30px;
    padding: 20px;
}

footer a {
    color: #0066cc;
    text-decoration: underline;
}

footer a:hover {
    text-decoration: none;
    color: #004d99;
}

/* Responsive Design */
@media (max-width: 768px) {
    .container {
        padding: 10px;
    }
    
    header h1 {
        font-size: 2rem;
    }
    
    .search-box {
        flex-direction: column;
    }
    
    #searchButton {
        width: 100%;
    }
    
    #map {
        height: 280px;
    }
    
    .chart-wrapper {
        padding: 15px 10px;
    }
    
    .chart-scroll-container {
        position: relative;
    }
    
    .chart-scroll-container::before {
        content: '← Swipe to scroll →';
        display: block;
        text-align: center;
        font-size: 0.8rem;
        color: #0066cc;
        margin-bottom: 10px;
        font-weight: 600;
    }
    
    .chart-scroll-container canvas {
        /* Height controlled by JavaScript */
    }
    
    table {
        font-size: 0.85rem;
    }
    
    th {
        padding: 8px 6px;
        font-size: 0.8rem;
        line-height: 1.2;
    }
    
    td {
        padding: 8px 6px;
        white-space: nowrap;
    }
}

@media (max-width: 480px) {
    header h1 {
        font-size: 1.8rem;
    }
    
    header p {
        font-size: 1rem;
    }
    
    .search-section, .results {
        padding: 20px;
    }
    
    .chart-scroll-container canvas {
        /* Height controlled by JavaScript */
    }
    
    table {
        font-size: 0.8rem;
    }
    
    th {
        padding: 6px 4px;
        font-size: 0.75rem;
    }
    
    td {
        padding: 6px 4px;
    }
}
