/* Reset and Base Styles */
*,
*::before,
*::after {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html, body {
    height: 100%;
    margin: 0;
    padding: 0;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, sans-serif;
    background-color: #b7dbbf;
    color: #333;
    line-height: 1.6;
}

/* ==========================================
   HEADLINE OVERLAY
   ========================================== */
.headline-overlay {
    position: fixed;
    top: 16px;
    left: 50%;
    transform: translateX(-50%);
    z-index: 50;
    padding: 16px 32px;
    background: rgba(255, 255, 255, 0.25);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border: 1px solid rgba(255, 255, 255, 0.4);
    border-radius: 20px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.08);
    pointer-events: none;
}

.headline-content {
    max-width: 800px;
    margin: 0 auto;
    text-align: center;
}

.headline-overlay h1 {
    font-family: 'Fredoka', sans-serif;
    font-size: clamp(1.2rem, 3.5vw, 1.6rem);
    font-weight: 600;
    color: #1a1a1a;
    margin: 0 0 6px 0;
    line-height: 1.35;
    letter-spacing: -0.01em;
}

.headline-overlay .subtitle {
    font-family: 'Quicksand', sans-serif;
    font-size: clamp(0.9rem, 2.5vw, 1.05rem);
    color: #333;
    margin: 0;
    font-weight: 600;
    letter-spacing: 0.02em;
}

.social-links {
    position: fixed;
    bottom: 20px;
    left: 50%;
    transform: translateX(-50%);
    z-index: 50;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
    padding: 12px 24px;
    background: rgba(255, 255, 255, 0.2);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border: 1px solid rgba(255, 255, 255, 0.4);
    border-radius: 50px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.08);
}

.hashtag {
    font-size: 0.95rem;
    font-weight: 600;
    color: #c42484;
}

.social-link {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background-color: rgba(255,255,255,0.9);
    color: #555;
    transition: all 0.2s ease;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
}

.social-link:hover {
    transform: scale(1.1);
    box-shadow: 0 4px 12px rgba(0,0,0,0.15);
}

.social-link:first-of-type:hover {
    background: linear-gradient(45deg, #f09433, #e6683c, #dc2743, #cc2366, #bc1888);
    color: white;
}

.social-link:last-of-type:hover {
    background-color: #1877f2;
    color: white;
}

.social-link svg {
    width: 20px;
    height: 20px;
}

/* Map Container - Landscape/Desktop: contain within viewport */
.map-container {
    position: relative;
    width: 100vw;
    height: 100vh;
    overflow: hidden;
    display: flex;
    align-items: center;
    justify-content: center;
    background-color: #b7dbbf;
}

.map-image {
    width: 100vw;
    height: 100dvh;
    display: block;
}

/* Show/hide maps based on orientation */
.map-mobile {
    display: none;
}

.map-desktop {
    display: block;
}

/* Portrait orientation: show mobile map */
@media (orientation: portrait) {
    .map-mobile {
        display: block;
        width: 100%;
        height: auto;
    }

    .map-desktop {
        display: none;
    }

    .map-container {
        width: 100vw;
        height: 100dvh;
        display: flex;
        align-items: center;
        justify-content: center;
    }

    .map-image {
        width: 100vw;
        height: 100dvh;
    }
}

/* Markers Container - positioned to match actual image bounds */
.markers-container {
    position: absolute;
    pointer-events: none;
    /* These will be set dynamically via JavaScript */
}

/* Arrow floating animation */
@keyframes float {
    0%, 100% {
        transform: translateY(0);
    }
    50% {
        transform: translateY(-8px);
    }
}

@keyframes pulse-glow {
    0%, 100% {
        filter: drop-shadow(2px 4px 6px rgba(0, 0, 0, 0.3));
    }
    50% {
        filter: drop-shadow(2px 6px 12px rgba(0, 0, 0, 0.4));
    }
}

.marker {
    position: absolute;
    left: var(--marker-x);
    top: var(--marker-y);
    transform: translate(-50%, -50%); /* Center the arrow */
    pointer-events: none;  /* Marker selbst nicht klickbar */
    cursor: default;
    transition: transform 0.3s ease;
}

/* Hover-Effekte sind auf .marker-logo */

.marker-arrow {
    width: 80px;
    height: auto;
    filter: drop-shadow(2px 4px 6px rgba(0, 0, 0, 0.3));
    animation: float 3s ease-in-out infinite, pulse-glow 3s ease-in-out infinite;
    pointer-events: none;  /* Pfeil nicht klickbar */
}

/* Logo an der Pfeilspitze */
.marker-logo {
    position: absolute;
    left: 50%;
    transform: translateX(-50%);
    max-width: 100px;
    max-height: 80px;
    width: auto;
    height: auto;
    object-fit: contain;
    background-color: white;
    padding: 2px;
    border-radius: 8px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.3);
    cursor: pointer;
    pointer-events: auto;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
    z-index: 10;
}

.marker-logo:hover {
    transform: translateX(-50%) scale(1.15);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.4);
}

.marker-logo:focus-visible {
    outline: 2px solid #4A90D9;
    outline-offset: 2px;
}

/* Stagger animation delays for each marker */
.marker:nth-child(1) .marker-arrow { animation-delay: 0s; }
.marker:nth-child(2) .marker-arrow { animation-delay: 0.4s; }
.marker:nth-child(3) .marker-arrow { animation-delay: 0.8s; }
.marker:nth-child(4) .marker-arrow { animation-delay: 1.2s; }
.marker:nth-child(5) .marker-arrow { animation-delay: 1.6s; }
.marker:nth-child(6) .marker-arrow { animation-delay: 2s; }
.marker:nth-child(7) .marker-arrow { animation-delay: 2.4s; }

/* Impressum Trigger Link */
.impressum-trigger {
    position: fixed;
    bottom: 16px;
    right: 16px;
    padding: 8px 12px;
    background: transparent;
    border: none;
    font-size: 13px;
    font-weight: 500;
    color: rgba(0, 0, 0, 0.5);
    cursor: pointer;
    transition: color 0.2s ease;
    z-index: 100;
}

.impressum-trigger:hover {
    color: rgba(0, 0, 0, 0.8);
}

/* Drawer Overlay */
.drawer-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.5);
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s ease, visibility 0.3s ease;
    z-index: 200;
}

.drawer-overlay.active {
    opacity: 1;
    visibility: visible;
}

/* Bottom Drawer */
.drawer {
    position: fixed;
    bottom: 0;
    left: 0;
    width: 100%;
    max-height: 80vh;
    background-color: #fff;
    border-radius: 20px 20px 0 0;
    transform: translateY(100%);
    transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    z-index: 300;
    overflow: hidden;
}

.drawer.active {
    transform: translateY(0);
}

/* Drawer Handle */
.drawer-handle {
    display: flex;
    justify-content: center;
    padding: 12px 0 8px;
    cursor: grab;
}

.drawer-handle:active {
    cursor: grabbing;
}

.handle-bar {
    width: 40px;
    height: 4px;
    background-color: #ddd;
    border-radius: 2px;
}

/* Drawer Content */
.drawer-content {
    padding: 0 24px 32px;
    max-height: calc(80vh - 60px);
    overflow-y: auto;
}

.drawer-content h2 {
    font-size: 24px;
    font-weight: 600;
    margin-bottom: 20px;
    color: #222;
}

.impressum-text p {
    margin-bottom: 16px;
    font-size: 15px;
    color: #555;
}

.impressum-text strong {
    color: #333;
}

/* Drawer Close Button */
.drawer-close {
    position: absolute;
    top: 16px;
    right: 16px;
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    background-color: #f5f5f5;
    border: none;
    border-radius: 50%;
    cursor: pointer;
    transition: background-color 0.2s ease, transform 0.2s ease;
    z-index: 10;
}

.drawer-close:hover {
    background-color: #e5e5e5;
    transform: scale(1.05);
}

.drawer-close:focus-visible {
    outline: 2px solid #4A90D9;
    outline-offset: 2px;
}

.drawer-close svg {
    color: #666;
    transition: color 0.2s ease;
}

.drawer-close:hover svg {
    color: #333;
}

/* Kita Info Drawer */
.kita-drawer .drawer-content {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
}

.kita-info {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 16px;
    margin-bottom: 24px;
}

.kita-logo {
    width: 200px;
    height: auto;
    object-fit: contain;
    border-radius: 16px;
    background-color: #f5f5f5;
}

.kita-info h2 {
    margin: 0;
    font-size: 22px;
}

#kitaTitle2 {
    margin-top: -12px;
}

.kita-address {
    color: #555;
    font-size: 15px;
    line-height: 1.5;
}

.kita-address p {
    margin: 0;
}

.kita-contact {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
}

.kita-tel {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    color: #2563eb;
    text-decoration: none;
    font-size: 15px;
    padding: 8px 16px;
    border-radius: 8px;
    transition: background-color 0.2s ease;
}

.kita-tel:hover {
    background-color: #f0f4ff;
}

.kita-tel svg {
    flex-shrink: 0;
}

.kita-link {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 14px 32px;
    background-color: #2563eb;
    color: #fff;
    text-decoration: none;
    border-radius: 10px;
    font-size: 16px;
    font-weight: 500;
    cursor: pointer;
    transition: background-color 0.2s ease, transform 0.2s ease, box-shadow 0.2s ease;
    width: 100%;
    max-width: 280px;
}

.kita-link:hover {
    background-color: #1d4ed8;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(37, 99, 235, 0.4);
}

.kita-link:focus-visible {
    outline: 2px solid #4A90D9;
    outline-offset: 2px;
}

.kita-link:active {
    transform: translateY(0);
    box-shadow: none;
}

.kita-link svg {
    stroke: currentColor;
    transition: transform 0.2s ease;
}

.kita-link:hover svg {
    transform: translateX(2px);
}

/* Responsive Adjustments */
@media (max-width: 480px) {
    .headline-overlay {
        top: 12px;
        padding: 12px 20px;
        border-radius: 16px;
        width: calc(100% - 24px);
    }

    .headline-overlay h1 {
        font-size: 1.3rem;
    }

    .headline-overlay .subtitle {
        font-size: 0.8rem;
    }

    .social-links {
        bottom: 50px;
        gap: 8px;
        padding: 10px 18px;
    }

    .impressum-trigger {
        bottom: 12px;
        right: auto;
        left: 50%;
        transform: translateX(-50%);
    }

    .hashtag {
        font-size: 0.85rem;
    }

    .social-link {
        width: 32px;
        height: 32px;
    }

    .social-link svg {
        width: 18px;
        height: 18px;
    }

    .marker-arrow {
        width: 50px;
    }

    .marker-logo {
        max-width: 70px;
        max-height: 56px;
        padding: 5px;
    }

    @keyframes float {
        0%, 100% {
            transform: translateY(0);
        }
        50% {
            transform: translateY(-5px);
        }
    }
}

@media (min-width: 481px) and (max-width: 768px) {
    .marker-arrow {
        width: 65px;
    }

    .marker-logo {
        max-width: 85px;
        max-height: 68px;
        padding: 6px;
    }
}

@media (max-width: 768px) {

    .impressum-trigger {
        bottom: 16px;
        right: 16px;
        padding: 10px 20px;
        font-size: 13px;
    }

    .drawer-content {
        padding: 0 20px 24px;
    }

    .drawer-content h2 {
        font-size: 20px;
    }

    .impressum-text p {
        font-size: 14px;
    }
}

@media (min-width: 769px) {
    .drawer {
        max-width: 600px;
        left: 50%;
        transform: translate(-50%, 100%);
        border-radius: 20px 20px 0 0;
    }

    .drawer.active {
        transform: translate(-50%, 0);
    }
}

/* Accessibility */
@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        transition-duration: 0.01ms !important;
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
    }

    .marker-arrow {
        animation: none;
    }
}

/* Focus styles for keyboard navigation */
.impressum-trigger:focus-visible,
.drawer-close:focus-visible,
.marker:focus-visible {
    outline: 2px solid #4A90D9;
    outline-offset: 2px;
}
