/*
 * Global styles for the Meteo Station website.
 *
 * This stylesheet defines a modern dark theme with a gradient backdrop and
 * card-style containers reminiscent of television weather broadcasts.  It
 * follows a mobile-first approach and adapts gracefully to larger screens.
 */

:root {
    /* Soft pastel colour scheme inspired by TV weather apps */
    --bg-gradient: linear-gradient(180deg, #d8e2ff 0%, #f6eaff 100%);
    --card-gradient: linear-gradient(180deg, #dadbff 0%, #ece1ff 100%);
    /* Accent colour for buttons and highlights */
    --accent-color: #a063f6;
    --text-color: #2f2f45;
    --secondary-text-color: #6f72a0;
    --shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    --border-radius: 16px;
}

* {
    box-sizing: border-box;
}

body, html {
    margin: 0;
    padding: 0;
    font-family: 'Poppins', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    background: var(--bg-gradient);
    color: var(--text-color);
    min-height: 100vh;
}

header {
    background: transparent;
}

/* Navigation bar */
.navbar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.75rem 1rem;
}

/* Bottom navigation bar for mobile */
.bottom-nav {
    display: none;
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    background: var(--card-gradient);
    box-shadow: 0 -4px 12px rgba(0, 0, 0, 0.15);
    border-top-left-radius: var(--border-radius);
    border-top-right-radius: var(--border-radius);
    padding: 0.5rem 0;
    justify-content: space-around;
    align-items: center;
    z-index: 50;
}

.bottom-nav a,
.bottom-nav button {
    flex: 1;
    text-align: center;
    background: none;
    border: none;
    color: var(--text-color);
    font-size: 0.8rem;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    cursor: pointer;
}

.bottom-nav a i,
.bottom-nav button i {
    font-size: 1.4rem;
    margin-bottom: 0.15rem;
    color: var(--accent-color);
}

/* Favourite overlay for mobile and desktop */
.favorites-overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.4);
    backdrop-filter: blur(4px);
    justify-content: center;
    align-items: center;
    z-index: 100;
}
.favorites-overlay.show {
    display: flex;
}
.overlay-content {
    background: var(--card-gradient);
    width: 90%;
    max-width: 420px;
    max-height: 80vh;
    overflow-y: auto;
    border-radius: var(--border-radius);
    box-shadow: var(--shadow);
    padding: 1rem;
    position: relative;
}
.overlay-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 0.75rem;
}
.overlay-header h2 {
    margin: 0;
    font-size: 1.4rem;
}
.close-overlay {
    background: none;
    border: none;
    font-size: 1.6rem;
    color: var(--accent-color);
    cursor: pointer;
}
.favorites-list .favorite-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.6rem 0;
    border-bottom: 1px solid rgba(0, 0, 0, 0.1);
    cursor: pointer;
}
.favorites-list .favorite-item:last-child {
    border-bottom: none;
}
.favorites-list .favorite-item span {
    flex: 1;
}
.favorites-list .favorite-item button {
    background: none;
    border: none;
    color: var(--accent-color);
    font-size: 1.2rem;
    cursor: pointer;
}
.favorites-list .favorites-empty {
    padding: 0.75rem 0;
    color: var(--secondary-text-color);
    text-align: center;
    font-size: 0.9rem;
}

/* Adjust navigation display for responsive design */
@media (max-width: 768px) {
    .navbar {
        display: none;
    }
    .bottom-nav {
        display: flex;
    }
}
@media (min-width: 769px) {
    .bottom-nav {
        display: none;
    }
}

.nav-brand {
    font-size: 1.5rem;
    font-weight: 600;
    color: var(--text-color);
}

/* Mobile nav toggle button */
.nav-toggle-btn {
    display: none;
    background: none;
    border: none;
    color: var(--text-color);
    font-size: 1.6rem;
    cursor: pointer;
}

/* Navigation links */
.nav-menu {
    display: flex;
    list-style: none;
    margin: 0;
    padding: 0;
    gap: 1rem;
}

.nav-menu a {
    color: var(--text-color);
    text-decoration: none;
    padding: 0.5rem 1rem;
    border-radius: 8px;
    display: flex;
    align-items: center;
    gap: 0.35rem;
    transition: background 0.3s ease, color 0.3s ease;
}

.nav-menu a:hover {
    background: rgba(160, 99, 246, 0.15);
    color: var(--accent-color);
}

/* Favourite button in the top navigation */
.nav-fav-btn {
    background: none;
    border: none;
    display: flex;
    align-items: center;
    gap: 0.35rem;
    color: var(--text-color);
    padding: 0.5rem 1rem;
    border-radius: 8px;
    cursor: pointer;
    transition: background 0.3s ease, color 0.3s ease;
}
.nav-fav-btn:hover {
    background: rgba(160, 99, 246, 0.15);
    color: var(--accent-color);
}

/* Favourites menu in navigation */
.favorites-menu {
    position: relative;
}
.nav-favorites-btn {
    background: none;
    border: none;
    color: var(--text-color);
    display: flex;
    align-items: center;
    gap: 0.4rem;
    padding: 0.5rem 1rem;
    border-radius: 8px;
    cursor: pointer;
    transition: background 0.3s ease;
}
.nav-favorites-btn:hover {
    background: rgba(160, 99, 246, 0.15);
    color: var(--accent-color);
}
.favorites-dropdown {
    position: absolute;
    top: 100%;
    right: 0;
    background: var(--card-gradient);
    border-radius: 0 0 12px 12px;
    box-shadow: var(--shadow);
    width: 240px;
    display: none;
    flex-direction: column;
    overflow: hidden;
    z-index: 20;
}
.favorites-dropdown.show {
    display: flex;
}
.favorites-dropdown .favorite-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.6rem 1rem;
    cursor: pointer;
}
.favorites-dropdown .favorite-item:hover {
    background: rgba(160, 99, 246, 0.15);
}
.favorites-dropdown .favorite-item span {
    flex: 1;
}
.favorites-dropdown .favorite-item button {
    background: none;
    border: none;
    color: var(--accent-color);
    font-size: 1.2rem;
    cursor: pointer;
}
.favorites-dropdown .favorites-empty {
    padding: 0.6rem 1rem;
    color: var(--secondary-text-color);
    font-size: 0.9rem;
    text-align: center;
}

/* Mobile menu styling */
@media (max-width: 768px) {
    .nav-toggle-btn {
        display: block;
    }
    .nav-menu {
        position: static;
        background: var(--card-gradient);
        flex-direction: column;
        width: 100%;
        max-height: 0;
        overflow: hidden;
        box-shadow: var(--shadow);
        border-radius: 0 0 12px 12px;
        transition: max-height 0.3s ease;
        margin-top: 0.5rem;
        z-index: 10;
    }
    .nav-menu li {
        margin: 0;
    }
    .nav-menu a {
        padding: 1rem;
        display: block;
    }
    .nav-menu.active {
        max-height: 500px;
    }

    /* Make the favourites dropdown span full width on mobile */
    .favorites-dropdown {
        position: static;
        width: 100%;
        border-radius: 0 0 12px 12px;
    }
}

main {
    padding: 1rem;
}

/* Search bar */
.search-container {
    position: relative;
    margin-bottom: 1rem;
}

#searchInput {
    width: 100%;
    padding: 0.75rem 1rem;
    border-radius: 8px;
    border: none;
    background: var(--card-gradient);
    color: var(--text-color);
    font-size: 1rem;
}

#searchInput::placeholder {
    color: var(--secondary-text-color);
}

.suggestions {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: var(--card-gradient);
    list-style: none;
    margin: 0;
    padding: 0;
    border-radius: 0 0 8px 8px;
    max-height: 200px;
    overflow-y: auto;
    box-shadow: var(--shadow);
    z-index: 5;
}

.suggestions li {
    padding: 0.75rem 1rem;
    cursor: pointer;
}

.suggestions li:hover {
    background: rgba(255, 255, 255, 0.1);
}

/* Weather card */
.weather {
    background: var(--card-gradient);
    border-radius: var(--border-radius);
    padding: 1rem;
    box-shadow: var(--shadow);
    position: relative;
}

/* When a background map is applied to the weather container, ensure it covers the area
   and add a semi-transparent overlay to enhance text readability. */
.weather.with-map {
    background-size: cover;
    background-position: center;
    overflow: hidden;
}
.weather.with-map::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    /* Reduce the opacity of the overlay so the underlying map remains visible */
    background: rgba(255, 255, 255, 0.4);
    /* Use a lighter blur so map details are not lost */
    backdrop-filter: blur(1.5px);
    z-index: 1;
}
.weather.with-map > *:not(.map-background) {
    /* Position all children above the map background, except the map image itself */
    position: relative;
    z-index: 2;
}

/* Map background image inside the weather container */
.map-background {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    /* Render the underlying tile in grey scale with reduced brightness for subtlety */
    filter: grayscale(100%) brightness(80%);
    z-index: 0;
}

/* Marker on the map indicating the selected location */
.map-marker {
    position: absolute;
    transform: translate(-50%, -50%);
    color: var(--accent-color);
    font-size: 1.6rem;
    z-index: 4;
    pointer-events: none;
}

/* Controls for zooming the background map */
.map-controls {
    position: absolute;
    top: 0.5rem;
    right: 0.5rem;
    display: flex;
    flex-direction: column;
    gap: 0.3rem;
    z-index: 5;
}

.map-controls button {
    width: 32px;
    height: 32px;
    border: none;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.8);
    color: var(--text-color);
    font-size: 1.2rem;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    box-shadow: var(--shadow);
    transition: transform 0.1s ease;
}

.map-controls button:active {
    transform: scale(0.94);
}

/* Overlay for showing details of a selected day */
.day-overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.5);
    z-index: 120;
    justify-content: center;
    align-items: center;
}
.day-overlay.show {
    display: flex;
}
.day-overlay-content {
    background: var(--card-gradient);
    border-radius: var(--border-radius);
    width: 90%;
    max-width: 480px;
    max-height: 85vh;
    overflow-y: auto;
    padding: 1rem;
    box-shadow: var(--shadow);
    display: flex;
    flex-direction: column;
    position: relative;
}
.day-overlay-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 0.75rem;
}
.day-overlay-header h3 {
    margin: 0;
    font-size: 1.3rem;
    color: var(--text-color);
}
.close-day-overlay {
    background: none;
    border: none;
    font-size: 1.6rem;
    color: var(--accent-color);
    cursor: pointer;
}
.day-overlay-body {
    display: flex;
    flex-direction: column;
    gap: 0.6rem;
}

/* Map overlay: full screen container for the interactive satellite map */
.map-overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.6);
    z-index: 130;
    justify-content: center;
    align-items: center;
}
.map-overlay.show {
    display: flex;
}
.map-overlay-content {
    position: relative;
    width: 90%;
    max-width: 600px;
    height: 70vh;
    background: var(--card-gradient);
    border-radius: var(--border-radius);
    overflow: hidden;
    box-shadow: var(--shadow);
}
/* Close button for the map overlay */
.close-map-overlay {
    position: absolute;
    top: 0.5rem;
    right: 0.5rem;
    background: rgba(255, 255, 255, 0.8);
    border: none;
    border-radius: 50%;
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.2rem;
    color: var(--accent-color);
    cursor: pointer;
    z-index: 5;
    box-shadow: var(--shadow);
}
/* The custom map container inside the overlay */
.simple-map {
    width: 100%;
    height: 100%;
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 1;
    background: var(--card-bg);
    cursor: grab;
}
/* Zoom controls for the custom map */
.map-controls {
    position: absolute;
    top: 0.5rem;
    right: 0.5rem;
    display: flex;
    flex-direction: column;
    gap: 0.3rem;
    z-index: 6;
}
.map-controls button {
    width: 32px;
    height: 32px;
    border: none;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.8);
    color: var(--text-color);
    font-size: 1.2rem;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    box-shadow: var(--shadow);
    transition: transform 0.1s ease;
}
.map-controls button:active {
    transform: scale(0.94);
}
/* Each row inside the overlay shows forecast at a particular hour */
.detail-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: var(--card-gradient);
    border-radius: 12px;
    padding: 0.6rem 0.8rem;
    box-shadow: var(--shadow);
}
.detail-row .detail-time {
    font-size: 0.9rem;
    font-weight: 600;
    color: var(--accent-color);
}
.detail-row .detail-icon {
    font-size: 1.4rem;
    color: var(--accent-color);
    flex: 0 0 32px;
    text-align: center;
}
.detail-row .detail-temp {
    font-size: 1rem;
    font-weight: 500;
    color: var(--text-color);
}

.weather .location {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1rem;
}

/* Location bar with map background */
.weather .location.with-map {
    position: relative;
    padding: 1rem;
    border-radius: var(--border-radius);
    overflow: hidden;
    background-size: cover;
    background-position: center;
    margin-bottom: 1rem;
}
.weather .location.with-map::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(255, 255, 255, 0.5);
    backdrop-filter: blur(2px);
}
.weather .location.with-map > * {
    position: relative;
    z-index: 1;
}

.weather .location h2 {
    margin: 0;
    font-size: 1.4rem;
}

.weather .location button {
    background: none;
    border: none;
    color: var(--accent-color);
    font-size: 1.8rem;
    cursor: pointer;
}

.weather .current {
    display: flex;
    flex-direction: column;
    align-items: center;
    margin-bottom: 1rem;
    gap: 0.25rem;
}

/* Layout for the icon and temperature row */
.current-header {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 0.5rem;
    width: 100%;
}

.weather .current .temp {
    font-size: 3rem;
    font-weight: bold;
    margin: 0;
}

/* Large weather icon in current weather */
.weather .current .weather-icon {
    font-size: 3rem;
    color: var(--accent-color);
    margin-bottom: 0.25rem;
}

.weather .current .description {
    font-size: 1.1rem;
    color: var(--secondary-text-color);
    margin-top: 0.25rem;
}

/* Chart container for displaying the daily temperature trend */
.weather .chart-container {
    width: 100%;
    height: 140px;
    margin: 0.5rem 0 0.75rem 0;
    position: relative;
}

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

/* Overlay container for drawing icons and temperature values on the chart */
.graph-overlays {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
}

/* Connector lines from the chart line down to the label row */
.graph-connector {
    position: absolute;
    width: 1px;
    background: rgba(160, 99, 246, 0.5);
    pointer-events: none;
}
.graph-connector.current-connector {
    background: var(--accent-color);
    width: 2px;
}
/* Info labels beneath the chart line. Each info cluster holds the value, icon and hour label. */
.graph-info {
    position: absolute;
    transform: translate(-50%, 0);
    display: flex;
    flex-direction: column;
    align-items: center;
    pointer-events: none;
}

/* Internal row that houses the value and icon side by side under the chart line */
.graph-info .info-top {
    display: flex;
    align-items: center;
    gap: 0.25rem;
    white-space: nowrap;
}
.graph-info .value {
    font-size: 0.8rem;
    color: var(--text-color);
    font-weight: 500;
    margin-bottom: 0.05rem;
    white-space: nowrap;
}
.graph-info .icon i {
    font-size: 1rem;
    color: var(--accent-color);
    line-height: 1;
}
.graph-info .time {
    font-size: 0.75rem;
    color: var(--secondary-text-color);
    margin-top: 0.05rem;
}
.graph-info.current-info .value {
    font-size: 0.95rem;
    font-weight: 600;
}
.graph-info.current-info .icon i {
    font-size: 1.4rem;
}
.graph-info.current-info .time {
    font-weight: 600;
    color: var(--accent-color);
}

/* Metrics (wind, clouds, precipitation) styling */
.metrics {
    display: flex;
    justify-content: space-around;
    flex-wrap: wrap;
    gap: 1rem;
    margin-top: 0.5rem;
}
.metric {
    flex: 1 1 100px;
    text-align: center;
}
.metric .icon {
    font-size: 1.3rem;
    margin-bottom: 0.2rem;
    color: var(--accent-color);
}
.metric .value {
    font-size: 1.1rem;
    font-weight: 500;
    color: var(--text-color);
}
.metric .label {
    font-size: 0.75rem;
    color: var(--secondary-text-color);
}

.weather .details {
    display: flex;
    justify-content: space-around;
    flex-wrap: wrap;
    gap: 1rem;
}

.weather .detail {
    flex: 1 1 100px;
    text-align: center;
}

.weather .detail .icon {
    font-size: 1.6rem;
    margin-bottom: 0.5rem;
    color: var(--accent-color);
}

.weather .hourly,
 .weather .daily {
    margin-top: 1rem;
    overflow-x: auto;
    padding-bottom: 0.5rem;
 }

/* Horizontal scroller for the daily forecast bubbles */
.daily-scroll {
    display: flex;
    flex-wrap: nowrap;
    overflow-x: auto;
    gap: 0.5rem;
    margin-top: 1rem;
    padding-bottom: 1rem;
}
.day-item {
    position: relative;
    background: var(--card-gradient);
    border-radius: 24px;
    padding: 0.8rem 1rem;
    box-shadow: var(--shadow);
    min-width: 90px;
    flex: 0 0 auto;
    display: flex;
    align-items: stretch;
    justify-content: center;
    cursor: pointer;
    pointer-events: auto;
}
.day-item img.map-img {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    z-index: 0;
    pointer-events: none;
}
.day-item .map-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(255, 255, 255, 0.6);
    backdrop-filter: blur(2px);
    z-index: 1;
    pointer-events: none;
}
.day-item .day-content {
    position: relative;
    z-index: 2;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
}
.day-item .day-content .icon i {
    font-size: 1.6rem;
    color: var(--accent-color);
    margin-bottom: 0.35rem;
}
.day-item .day-content .date {
    font-size: 0.85rem;
    color: var(--secondary-text-color);
    margin-bottom: 0.15rem;
}
.day-item .day-content .temp {
    font-size: 0.95rem;
    font-weight: 500;
    white-space: nowrap;
}

/* Loading spinner */
.loading {
    display: none;
    justify-content: center;
    align-items: center;
    margin-top: 1rem;
    flex-direction: column;
}
.loading .spinner {
    width: 50px;
    height: 50px;
    border: 5px solid var(--secondary-text-color);
    border-top: 5px solid var(--accent-color);
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

.loading .loading-text {
    margin-top: 0.5rem;
    color: var(--secondary-text-color);
    font-size: 0.9rem;
}

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

.hourly .hour-item,
.daily .day-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    margin-right: 1rem;
    min-width: 60px;
}

.hour-item .time,
.day-item .date {
    font-size: 0.9rem;
    color: var(--secondary-text-color);
    margin-bottom: 0.25rem;
}

.hour-item .icon,
 .day-item .icon {
    font-size: 1.3rem;
    margin-bottom: 0.25rem;
}

/* Colour for forecast icons */
.hour-item .icon i,
.day-item .icon i {
    color: var(--accent-color);
}

.hour-item .temp,
.day-item .temp {
    font-size: 0.95rem;
    white-space: nowrap;
}

/* Favourites section */
.favorites {
    margin-top: 1rem;
}

.favorites h2 {
    margin: 0 0 0.5rem 0;
    font-size: 1.2rem;
}

.favorite-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: var(--card-gradient);
    padding: 0.5rem 1rem;
    border-radius: 8px;
    margin-bottom: 0.5rem;
    box-shadow: var(--shadow);
    cursor: pointer;
}

.favorite-item span {
    flex: 1;
}

.favorite-item button {
    background: none;
    border: none;
    color: var(--accent-color);
    font-size: 1.2rem;
    cursor: pointer;
}

.favorite-item button:hover {
    color: #ff9aff;
}

/* Message when no favourites are stored */
.favorites-empty {
    background: var(--card-gradient);
    padding: 0.75rem 1rem;
    border-radius: 12px;
    box-shadow: var(--shadow);
    color: var(--secondary-text-color);
    font-size: 0.9rem;
    text-align: center;
}

/* Radar page iframe */
.radar-page iframe {
    border: none;
    border-radius: var(--border-radius);
    box-shadow: var(--shadow);
}

/* Footer */
.footer {
    margin-top: 2rem;
    text-align: center;
    color: var(--secondary-text-color);
    font-size: 0.9rem;
}

/* Weather alert banner for severe conditions */
.alert {
    background: linear-gradient(90deg, #ffe082, #ffcc80);
    color: #333;
    border-radius: 12px;
    padding: 0.8rem 1rem;
    margin-bottom: 1rem;
    display: flex;
    align-items: center;
    gap: 0.6rem;
    box-shadow: var(--shadow);
}
.alert .icon i {
    font-size: 1.4rem;
    color: #ff6f00;
}
.alert .message {
    flex: 1;
    font-size: 0.9rem;
    font-weight: 500;
}

/* =========================================================
   ADDITIONS ONLY (Map marker click + tooltip + recenter btn)
   Nothing above is changed, we only override/extend here.
   ========================================================= */

/* Make marker clickable only inside the map overlay container */
#mapOverlay .map-marker,
#simpleMap .map-marker {
    pointer-events: auto;  /* override the global "none" above */
    cursor: pointer;
}

/* Tooltip bubble shown when clicking the marker */
#simpleMap .map-tooltip {
    position: absolute;
    transform: translate(-50%, -120%);
    background: rgba(255, 255, 255, 0.92);
    color: var(--text-color);
    padding: 0.45rem 0.6rem;
    border-radius: 12px;
    box-shadow: var(--shadow);
    font-size: 0.85rem;
    line-height: 1.15;
    z-index: 7;            /* above tiles + marker */
    max-width: 85%;
    pointer-events: none;  /* tooltip itself shouldn't block map dragging */
    white-space: nowrap;
}

#simpleMap .map-tooltip .title {
    font-weight: 600;
    margin-bottom: 0.15rem;
}

#simpleMap .map-tooltip .coords {
    color: var(--secondary-text-color);
    font-variant-numeric: tabular-nums;
    font-size: 0.78rem;
}

/* Recenter button (crosshairs) added dynamically into .map-controls */
#mapOverlay .map-controls .map-recenter i {
    font-size: 1.05rem;
}

.nav-brand {
    display: flex;
    align-items: center;
}

.brand-link {
    display: flex;
    align-items: center;
    gap: 0.55rem;
    text-decoration: none;
    color: inherit;
}

.brand-link:hover {
    opacity: 0.9;
}

.brand-icon {
    display: inline-flex;
}

.brand-text {
    font-weight: 600;
    font-size: 1.15rem;
    letter-spacing: 0.2px;
}

/* =========================================================
   WEBCAMS (FIXED): echte Seitenbreite + Standort-Badge
   (überschreibt die alten Flex/max-width Regeln zuverlässig)
   ========================================================= */

/* Webcams: Grid statt Flex und KEIN max-width:33% mehr */
.webcam-gallery{
    display: grid;
    grid-template-columns: 1fr;   /* Mobile: 1 Spalte, volle Breite */
    gap: 1rem;
    width: 100%;
    justify-content: initial;     /* überschreibt altes justify-content:center */
}

/* Wichtig: alte Regel .webcam-gallery .webcam { max-width:33%; } neutralisieren */
.webcam-gallery .webcam{
    width: 100%;
    max-width: none !important;
    flex: initial !important;
    position: relative;           /* für Badge */
}

/* Einheitlicher 16:9-Rahmen (Video + iframe) */
.webcam-media{
    width: 100%;
    aspect-ratio: 16 / 9;
    border: 0;
    border-radius: var(--border-radius);
    overflow: hidden;
    background: #000;
    display: block;
    box-shadow: var(--shadow);
}

/* Standort-Badge */
.cam-badge{
    position: absolute;
    top: 10px;
    left: 10px;
    z-index: 5;
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    padding: 0.35rem 0.6rem;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.88);
    backdrop-filter: blur(6px);
    color: var(--text-color);
    font-size: 0.85rem;
    font-weight: 600;
    box-shadow: var(--shadow);
    pointer-events: none; /* Badge blockiert keine Clicks/Fullscreen */
}

/* Optional: kleiner Untertitel */
.cam-sub{
    position: absolute;
    bottom: 10px;
    left: 10px;
    z-index: 5;
    padding: 0.3rem 0.55rem;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.78);
    backdrop-filter: blur(6px);
    color: var(--secondary-text-color);
    font-size: 0.78rem;
    font-weight: 500;
    box-shadow: var(--shadow);
    pointer-events: none;
}

/* Ab Tablet: 2 Spalten, ab Desktop: 3 Spalten */
@media (min-width: 760px){
    .webcam-gallery{ grid-template-columns: repeat(2, 1fr); }
}
@media (min-width: 1100px){
    .webcam-gallery{ grid-template-columns: repeat(3, 1fr); }
}
