* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

:root {
    --primary-color: #2563eb;
    --primary-dark: #1e40af;
    --secondary-color: #64748b;
    --success-color: #10b981;
    --warning-color: #f59e0b;
    --error-color: #ef4444;
    --bg-color: #f8fafc;
    --card-bg: #ffffff;
    --text-color: #1e293b;
    --text-light: #64748b;
    --border-color: #e2e8f0;
    --shadow: 0 1px 3px 0 rgba(0, 0, 0, 0.1), 0 1px 2px 0 rgba(0, 0, 0, 0.06);
    --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: var(--text-color);
    line-height: 1.6;
    min-height: 100vh;
    padding: 20px;
}

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

header {
    text-align: center;
    color: white;
    margin-bottom: 40px;
    padding: 30px 20px;
}

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

.subtitle {
    font-size: 1.1rem;
    opacity: 0.9;
}

.card {
    background: var(--card-bg);
    border-radius: 12px;
    padding: 30px;
    margin-bottom: 30px;
    box-shadow: var(--shadow-lg);
    transition: transform 0.2s, box-shadow 0.2s;
}

.card:hover {
    transform: translateY(-2px);
    box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 10px 10px -5px rgba(0, 0, 0, 0.04);
}

.card h2 {
    color: var(--primary-color);
    margin-bottom: 20px;
    font-size: 1.5rem;
    border-bottom: 2px solid var(--border-color);
    padding-bottom: 10px;
}

.form {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.form-group {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.form-group label {
    font-weight: 600;
    color: var(--text-color);
    font-size: 0.95rem;
}

.form-group select {
    padding: 12px 16px;
    border: 2px solid var(--border-color);
    border-radius: 8px;
    font-size: 1rem;
    background: white;
    color: var(--text-color);
    transition: border-color 0.2s, box-shadow 0.2s;
    cursor: pointer;
}

.form-group select:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.1);
}

.form-control {
    padding: 12px 16px;
    border: 2px solid var(--border-color);
    border-radius: 8px;
    font-size: 1rem;
    background: white;
    color: var(--text-color);
    transition: border-color 0.2s, box-shadow 0.2s;
    width: 100%;
}

.form-control:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.1);
}

input[type="radio"] {
    margin-right: 5px;
    cursor: pointer;
}

input[type="radio"] + label {
    cursor: pointer;
}

.form-hint {
    display: block;
    margin-top: 5px;
    font-size: 0.85rem;
    color: var(--text-light);
    font-style: italic;
}

.map-info {
    margin-bottom: 10px;
    color: var(--text-light);
    font-size: 0.9rem;
}

.language-selector {
    display: flex;
    align-items: center;
}

.lang-link {
    color: white;
    text-decoration: none;
    padding: 5px 10px;
    border-radius: 4px;
    transition: background 0.2s;
    font-size: 0.9rem;
}

.lang-link:hover {
    background: rgba(255, 255, 255, 0.2);
}

.lang-link.active {
    background: rgba(255, 255, 255, 0.3);
    font-weight: 600;
}

.btn {
    padding: 14px 28px;
    border: none;
    border-radius: 8px;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.btn-primary {
    background: var(--primary-color);
    color: white;
}

.btn-primary:hover {
    background: var(--primary-dark);
    transform: translateY(-1px);
    box-shadow: var(--shadow-lg);
}

.btn-primary:active {
    transform: translateY(0);
}

.btn-download {
    background: var(--success-color);
    color: white;
    padding: 10px 20px;
    font-size: 0.9rem;
}

.btn-download:hover {
    background: #059669;
    transform: translateY(-1px);
    box-shadow: var(--shadow-lg);
}

.alert {
    padding: 20px;
    border-radius: 8px;
    margin-bottom: 30px;
    border-left: 4px solid;
}

.alert-warning {
    background: #fef3c7;
    border-color: var(--warning-color);
    color: #92400e;
}

.alert-error {
    background: #fee2e2;
    border-color: var(--error-color);
    color: #991b1b;
}

.alert strong {
    display: block;
    margin-bottom: 8px;
    font-size: 1.1rem;
}

.alert code {
    background: rgba(0, 0, 0, 0.1);
    padding: 2px 6px;
    border-radius: 4px;
    font-family: 'Courier New', monospace;
}

.weather-data {
    margin-top: 20px;
}

.table-container {
    overflow-x: auto;
    border-radius: 8px;
    border: 1px solid var(--border-color);
}

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

.data-table thead {
    background: var(--primary-color);
    color: white;
}

.data-table th {
    padding: 14px 16px;
    text-align: left;
    font-weight: 600;
    font-size: 0.9rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.data-table td {
    padding: 12px 16px;
    border-bottom: 1px solid var(--border-color);
}

.data-table tbody tr {
    transition: background-color 0.2s;
}

.data-table tbody tr:hover {
    background: #f8fafc;
}

.data-table tbody tr:last-child td {
    border-bottom: none;
}

.no-data {
    text-align: center;
    padding: 40px;
    color: var(--text-light);
    font-style: italic;
}

footer {
    text-align: center;
    color: white;
    padding: 30px 20px;
    opacity: 0.9;
}

footer a {
    color: white;
    text-decoration: underline;
}

footer a:hover {
    opacity: 0.8;
}

/* Responsive Design */
@media (max-width: 768px) {
    header h1 {
        font-size: 2rem;
    }

    .card {
        padding: 20px;
    }

    .data-table {
        font-size: 0.85rem;
    }

    .data-table th,
    .data-table td {
        padding: 10px 12px;
    }
}

/* Loading animation */
.loading {
    display: inline-block;
    width: 20px;
    height: 20px;
    border: 3px solid rgba(255, 255, 255, 0.3);
    border-radius: 50%;
    border-top-color: white;
    animation: spin 1s ease-in-out infinite;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

/* Map Styles */
.weather-map {
    width: 100% !important;
    height: 700px !important;
    min-height: 600px !important;
    max-height: none !important;
    border-radius: 8px;
    overflow: hidden;
    border: 2px solid var(--border-color);
    margin-top: 15px;
    background: #e5e7eb;
    position: relative;
    z-index: 1;
    display: block !important;
    visibility: visible !important;
    box-sizing: border-box;
}

.weather-map:empty::before {
    content: "Indlæser kort...";
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    color: var(--text-light);
    font-style: italic;
    z-index: 0;
}

/* Ensure Leaflet map tiles are visible */
.weather-map .leaflet-container {
    height: 100% !important;
    width: 100% !important;
    min-height: 600px !important;
    z-index: 1;
    position: relative;
}

.weather-map .leaflet-tile-container {
    visibility: visible !important;
}

.weather-map .leaflet-map-pane {
    height: 100% !important;
}

.weather-station-marker {
    background: transparent !important;
    border: none !important;
}

.weather-station-marker .marker-icon {
    font-size: 45px !important;
    text-align: center !important;
    filter: drop-shadow(0 3px 6px rgba(0, 0, 0, 0.4)) !important;
    cursor: pointer !important;
    transition: transform 0.2s !important;
    line-height: 1 !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    width: 45px !important;
    height: 45px !important;
}

.weather-station-marker .marker-icon:hover {
    transform: scale(1.15) !important;
}

.map-popup {
    min-width: 250px;
    max-width: 300px;
}

.map-popup h3 {
    margin: 0 0 10px 0;
    color: var(--primary-color);
    font-size: 1.1rem;
}

.map-popup h4 {
    margin: 10px 0 5px 0;
    color: var(--text-color);
    font-size: 0.95rem;
    border-bottom: 2px solid var(--primary-color);
    padding-bottom: 5px;
}

.map-popup p {
    margin: 5px 0;
    font-size: 0.9rem;
    color: var(--text-color);
    line-height: 1.5;
}

.map-popup .timestamp {
    color: var(--text-light);
    font-size: 0.85rem;
    margin-bottom: 10px;
}

.weather-current-data {
    background: #f8fafc;
    padding: 10px;
    border-radius: 6px;
    margin: 10px 0;
}

.weather-current-data p {
    margin: 8px 0;
}

/* Leaflet popup customization */
.leaflet-popup-content-wrapper {
    border-radius: 8px;
    box-shadow: var(--shadow-lg);
}

.leaflet-popup-content {
    margin: 15px;
}

.weather-popup .leaflet-popup-content-wrapper {
    background: white;
}

/* Tooltip styling */
.leaflet-tooltip {
    background: rgba(0, 0, 0, 0.85);
    color: white;
    border: none;
    border-radius: 6px;
    padding: 8px 12px;
    font-size: 0.9rem;
    font-weight: 600;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.3);
    white-space: nowrap;
}

.weather-tooltip {
    background: rgba(37, 99, 235, 0.95) !important;
    color: white !important;
    border: 2px solid rgba(255, 255, 255, 0.3) !important;
    font-weight: 600 !important;
}

.btn-select-device {
    margin-top: 10px;
    padding: 8px 16px;
    background: var(--primary-color);
    color: white;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    font-size: 0.9rem;
    font-weight: 600;
    transition: background 0.2s;
    width: 100%;
}

.btn-select-device:hover {
    background: var(--primary-dark);
}

/* Leaflet popup customization */
.leaflet-popup-content-wrapper {
    border-radius: 8px;
    box-shadow: var(--shadow-lg);
}

.leaflet-popup-content {
    margin: 15px;
}

/* Responsive map */
@media (max-width: 768px) {
    .weather-map {
        height: 500px;
        min-height: 450px;
    }
}

@media (min-width: 1200px) {
    .weather-map {
        height: 800px;
        min-height: 700px;
    }
}

