:root {
    --primary-color: #0ea5e9;
    --primary-hover: #0284c7;
    --bg-color: #0f172a;
    --card-bg: rgba(30, 41, 59, 0.7);
    --text-main: #f8fafc;
    --text-muted: #94a3b8;
    --border-color: rgba(255, 255, 255, 0.1);
    --glass-shadow: 0 4px 30px rgba(0, 0, 0, 0.5);
    --glass-blur: blur(10px);
}

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

body {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
    background-color: var(--bg-color);
    color: var(--text-main);
    line-height: 1.5;
    background-image: 
        radial-gradient(circle at 15% 50%, rgba(14, 165, 233, 0.08) 0%, transparent 50%),
        radial-gradient(circle at 85% 30%, rgba(2, 132, 199, 0.08) 0%, transparent 50%);
    background-attachment: fixed;
}

/* Header */
.main-header {
    text-align: center;
    padding: 2rem 1rem 3rem 1rem;
    background: linear-gradient(180deg, rgba(14, 165, 233, 0.1) 0%, transparent 100%);
    position: relative;
}

.lang-toggle-container {
    position: absolute;
    top: 1rem;
    left: 1.5rem;
}

.lang-btn {
    background: rgba(255,255,255,0.1);
    border: 1px solid var(--border-color);
    color: var(--text-main);
    padding: 0.4rem 0.8rem;
    border-radius: 20px;
    cursor: pointer;
    font-size: 0.9rem;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    gap: 5px;
}

.lang-btn:hover {
    background: rgba(255,255,255,0.2);
    border-color: var(--primary-color);
}

.main-header h1 {
    font-size: 2.5rem;
    font-weight: 700;
    margin-bottom: 0.5rem;
    background: linear-gradient(90deg, #38bdf8, #818cf8);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.main-header p {
    font-size: 1.1rem;
    color: var(--text-muted);
}

.header-logo-container {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 15px;
    margin-bottom: 1.5rem;
}

.header-logo {
    width: 60px;
    height: 60px;
    border-radius: 50%;
    border: 2px solid var(--primary-color);
    box-shadow: 0 0 15px rgba(14, 165, 233, 0.5);
    object-fit: cover;
}

.header-brand {
    font-size: 2.2rem;
    font-weight: 700;
    letter-spacing: -0.5px;
    color: var(--text-main);
}

.highlight-pink {
    color: #e81cff;
}

.advertise-text {
    margin-top: 1rem !important;
    font-size: 1.05rem !important;
}

.highlight-turquoise {
    color: #06b6d4;
    font-weight: 600;
    text-decoration: none;
    transition: all 0.3s ease;
}

.highlight-turquoise:hover {
    color: #22d3ee;
    text-shadow: 0 0 8px rgba(34, 211, 238, 0.6);
    text-decoration: underline;
}

/* Main Layout */
.container {
    max-width: 1400px;
    margin: 0 auto;
    padding: 0 2rem;
    padding-right: 180px; /* Leave space for the 160px right sidebar ad */
    padding-left: 180px; /* Leave space for the 160px left sidebar ad */
    position: relative;
    z-index: 10;
}

/* AI Header Image Slider */
.header-slider {
    width: 100%;
    height: 600px;
    margin-bottom: 2rem;
    position: relative;
}

.parallax-slider {
    background-image: url('./sailing.png');
    background-attachment: fixed;
    background-position: center bottom; /* Fokus auf den unteren Teil des Bildes */
    background-repeat: no-repeat;
    background-size: cover;
}

@media (max-width: 768px) {
    .container {
        padding: 0 1rem;
        /* Padding removed on mobile since sidebar is collapsed by default */
    }
}

/* Filter Section */
.filter-section {
    margin-bottom: 3rem;
    display: block; /* Removed flex row so items stack naturally */
}

.filter-buttons {
    display: flex;
    flex-wrap: wrap;
    gap: 0.75rem;
    justify-content: center;
    width: 100%;
}

.filter-btn {
    background: rgba(255, 255, 255, 0.7);
    border: 1px solid var(--border-color);
    padding: 0.6rem 1.25rem;
    border-radius: 30px;
    font-weight: 500;
    color: var(--text-color);
    cursor: pointer;
    backdrop-filter: var(--glass-blur);
    transition: all 0.3s;
    outline: none;
    font-size: 0.95rem;
}

.filter-btn:hover {
    background: #e2e8f0;
}

.filter-btn.active {
    background: var(--primary-color);
    color: #fff;
    border-color: var(--primary-color);
}

.filter-divider {
    width: 100%;
    height: 1px;
    background: linear-gradient(90deg, transparent, var(--border-color), transparent);
    margin: 1.5rem 0;
}

.map-buttons {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 1rem;
    width: 100%;
}

/* Wind Map Button & Section */
.wind-btn {
    background: linear-gradient(135deg, #ec4899, #db2777); /* Pink */
    color: white;
    border: none;
    box-shadow: 0 4px 15px rgba(236, 72, 153, 0.3);
    border-radius: 30px;
    padding: 0.6rem 1.8rem;
    font-size: 0.95rem; /* Match filter-btn font size */
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.wind-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(236, 72, 153, 0.4);
}

/* Weather Map Button */
.weather-btn {
    background: linear-gradient(135deg, #14b8a6, #0d9488); /* Turquoise */
    color: white;
    border: none;
    box-shadow: 0 4px 15px rgba(20, 184, 166, 0.3);
    border-radius: 30px;
    padding: 0.6rem 1.8rem;
    font-size: 0.95rem; /* Match filter-btn font size */
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.weather-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(20, 184, 166, 0.4);
}

.wind-map-section {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background: rgba(0, 0, 0, 0.7);
    backdrop-filter: blur(5px);
    z-index: 1000;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s ease, visibility 0.3s ease;
}

.wind-map-section.show {
    opacity: 1;
    visibility: visible;
}

.wind-map-container {
    width: 90%;
    max-width: 1200px;
    height: 80vh;
    border-radius: 16px;
    overflow: hidden;
    box-shadow: 0 10px 40px rgba(0,0,0,0.5);
    background: #f8f9fa;
    position: relative;
    transform: translateY(20px);
    transition: transform 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

.wind-map-section.show .wind-map-container {
    transform: translateY(0);
}

.close-wind-map {
    position: absolute;
    top: 15px;
    right: 15px;
    width: 40px;
    height: 40px;
    background: #ec4899;
    color: white;
    border: none;
    border-radius: 50%;
    font-size: 1.5rem;
    line-height: 1;
    cursor: pointer;
    z-index: 1001;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 2px 10px rgba(0,0,0,0.3);
    transition: transform 0.2s, background 0.2s;
}

.close-wind-map:hover {
    background: #db2777;
    transform: scale(1.1);
}

/* Webcam Grid */
.webcam-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 2rem;
    padding-bottom: 4rem;
}

/* Webcam Card */
.webcam-card {
    background: var(--card-bg);
    border: 1px solid var(--border-color);
    border-radius: 16px;
    padding: 1rem;
    display: flex;
    flex-direction: column;
    gap: 1rem;
    backdrop-filter: var(--glass-blur);
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
    position: relative;
    transition: transform 0.6s cubic-bezier(0.2, 0.8, 0.2, 1), box-shadow 0.3s ease, opacity 0.6s ease-out;
}

.webcam-card.fly-in-left {
    opacity: 0;
    transform: translateX(-50px);
}

.webcam-card.fly-in-right {
    opacity: 0;
    transform: translateX(50px);
}

.webcam-card.visible {
    opacity: 1;
    transform: translateX(0);
}

.webcam-card.visible:hover {
    transform: translateY(-5px);
    box-shadow: var(--glass-shadow);
    border-color: rgba(255, 255, 255, 0.2);
    z-index: 100; /* Ensure the hovered card and its zoomed image are above everything else */
}

.card-header h2 {
    font-size: 1.1rem;
    font-weight: 600;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.card-header p {
    font-size: 0.8rem;
    color: var(--text-muted);
}

/* Image Container & Hover Zoom Logic */
.image-container {
    position: relative;
    width: 100%;
    aspect-ratio: 16 / 9;
    border-radius: 8px;
    overflow: visible; /* Need visible so absolute zoomed image can bleed out */
}

.base-image {
    width: 100%;
    height: 100%;
    object-fit: cover;
    border-radius: 8px;
    background: #000;
}

/* The zoomed overlay that appears on hover */
.zoomed-image-wrapper {
    position: absolute;
    bottom: 10px; /* Anchor to the bottom of the image container to not cover the footer */
    left: 50%;
    transform: translate(-50%, 0) scale(0.9);
    transform-origin: bottom center;
    width: 640px;
    opacity: 0;
    pointer-events: none; 
    z-index: 50; /* Bring above everything */
    transition: opacity 0.3s ease, transform 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    border-radius: 12px;
    box-shadow: 0 20px 40px rgba(0,0,0,0.8);
    overflow: hidden;
    border: 2px solid var(--primary-color);
    background: #fff; /* White background for the ad area below the image */
    display: flex;
    flex-direction: column;
}

.zoomed-image-wrapper img, .zoomed-image-wrapper video {
    width: 100%;
    height: auto;
    object-fit: cover;
    display: block;
    flex-shrink: 0;
}

/* Trigger zoom */
.image-container:hover .zoomed-image-wrapper {
    opacity: 1;
    transform: translate(-50%, 0) scale(1);
    pointer-events: auto; /* Allow clicking the ad */
}

/* Ads Placeholder */
.ad-slot {
    text-align: center;
    margin: 0.5rem 0;
    min-height: 50px; /* Provides space so layout doesn't jump */
}

/* Source Link */
.card-footer {
    margin-top: auto;
    font-size: 0.7rem;
    color: var(--text-muted);
    text-align: right;
}

.card-footer a {
    color: var(--primary-color);
    text-decoration: none;
    transition: color 0.2s;
}

.card-footer a:hover {
    color: var(--primary-hover);
    text-decoration: underline;
}

/* Footer */
.main-footer {
    text-align: center;
    padding: 2.5rem 2rem;
    color: var(--text-muted);
    font-size: 0.85rem;
    border-top: 1px solid var(--border-color);
    background: rgba(15, 23, 42, 0.8);
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 15px;
}

.main-footer a {
    color: var(--primary-color);
    text-decoration: none;
    transition: color 0.3s;
}

.main-footer a:hover {
    color: #38bdf8;
    text-decoration: underline;
}

/* Collapsible Sidebar Skyscraper Ad */
.sidebar-ad {
    position: fixed;
    right: 0;
    top: 0;
    height: 100vh;
    transform: translateX(0);
    background: #0f172a;
    box-shadow: -2px 0 15px rgba(0,0,0,0.5);
    z-index: 999;
    display: flex;
    flex-direction: column;
    align-items: center;
    padding-top: 40px; /* Space for the button */
    transition: transform 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    overflow-y: auto;
}

.sidebar-ad.collapsed {
    transform: translateX(100%);
}

.sidebar-ad-content {
    padding: 10px;
    text-align: center;
}

.sidebar-ad .ad-label {
    display: block;
    font-size: 10px;
    color: #888;
    margin-bottom: 5px;
    text-transform: uppercase;
    letter-spacing: 1px;
}

/* Floating light grey toggle button */
.sidebar-ad-toggle {
    position: fixed;
    top: 10px;
    right: 15px;
    z-index: 1000;
    background: transparent;
    color: #aaaaaa;
    border: none;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 5px;
    transition: color 0.2s, transform 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    outline: none;
}

.sidebar-ad-toggle:hover {
    color: white;
}

.sidebar-ad-toggle.collapsed {
    transform: scaleX(-1); /* Flips the arrow to point left */
}

.footer-links {
    margin-top: 0.5rem;
}

/* Collapsible Left Sidebar Skyscraper Ad */
.sidebar-ad-left {
    position: fixed;
    left: 0;
    top: 0;
    height: 100vh;
    transform: translateX(0);
    background: #0f172a;
    box-shadow: 2px 0 15px rgba(0,0,0,0.5);
    z-index: 999;
    display: flex;
    flex-direction: column;
    align-items: center;
    padding-top: 40px; /* Space for the button */
    transition: transform 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    overflow-y: auto;
}

.sidebar-ad-left.collapsed {
    transform: translateX(-100%);
}

.sidebar-ad-toggle-left {
    position: fixed;
    top: 10px;
    left: 15px;
    z-index: 1000;
    background: transparent;
    color: #aaaaaa;
    border: none;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 5px;
    transition: color 0.2s, transform 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    outline: none;
}

.sidebar-ad-toggle-left:hover {
    color: white;
}

.sidebar-ad-toggle-left.collapsed {
    transform: scaleX(-1); /* Flips the arrow to point right */
}

/* Hide sidebar elements until scrolled past slider */
.hidden-sidebar {
    opacity: 0;
    pointer-events: none;
    visibility: hidden;
    transform: translateX(-100%);
}

/* Utility to hide elements smoothly */
.hidden {
    display: none !important;
}

/* Responsive adjustment for zoom so it doesn't break small screens */
@media (max-width: 768px) {
    .zoomed-image-wrapper {
        width: 90vw; /* Scale down if screen is too small for 640px */
    }
    
    /* White ring outline for the toggle button on mobile */
    .sidebar-ad-toggle, .sidebar-ad-toggle-left {
        border: 2px solid white;
        border-radius: 50%;
        width: 32px;
        height: 32px;
        background: rgba(0, 0, 0, 0.4); /* Slight dark background to make the white ring pop on any webcam image */
        color: white;
    }
}

/* Ad Overlay in Zoom Mode */
.zoomed-ad-overlay {
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
    background: rgba(0, 0, 0, 0.65);
    color: rgba(255, 255, 255, 0.95);
    text-align: center;
    padding: 8px 10px;
    font-size: 0.8rem;
    font-weight: 500;
    letter-spacing: 0.5px;
    backdrop-filter: blur(4px);
    border-bottom-left-radius: 10px;
    border-bottom-right-radius: 10px;
    pointer-events: auto; /* Allow clicking on the ad */
    z-index: 60;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
}
