@import url('https://fonts.googleapis.com/css2?family=Work+Sans:wght@400;500;600;700&display=swap');

/* ==================== RESET & BASE STYLES ==================== */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

:root {
    --primary-color: #2c3e50;
    --secondary-color: #e74c3c;
    --text-light: #ffffff;
    --text-dark: #333333;
    --nav-height: 80px;
    --mobile-nav-height: 60px;
}

body {
    font-family: 'Work Sans', 'Helvetica Neue', Arial, sans-serif;
    overflow-x: hidden;
    line-height: 1.6;
    background-color: #1a1a1a;
}

/* ==================== ANIMATIONS ==================== */
@keyframes fadeOut {
    from {
        opacity: 1;
    }
    to {
        opacity: 0;
    }
}

@keyframes fadeIn {
    from {
        opacity: 0;
    }
    to {
        opacity: 1;
    }
}

.fade-out {
    animation: fadeOut 0.8s ease-out forwards;
}

.fade-in {
    animation: fadeIn 1.2s ease-in forwards;
}

.hidden {
    opacity: 0;
}

/* Hide stations and description during page transition from index */
html.transition-from-index .station,
html.transition-from-index .station-quad,
html.transition-from-index .performance-description {
    opacity: 0;
}

/* ==================== AUTH OVERLAY ==================== */
.auth-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100vh;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 10000;
}

.auth-container {
    background: white;
    padding: 3rem;
    border-radius: 15px;
    box-shadow: 0 20px 60px rgba(0,0,0,0.3);
    max-width: 400px;
    width: 90%;
    text-align: center;
}

.auth-container h1 {
    font-size: 2.5rem;
    margin-bottom: 1rem;
    color: var(--primary-color);
}

#authForm input {
    width: 100%;
    padding: 1rem;
    border: 2px solid #ddd;
    border-radius: 8px;
    font-size: 1rem;
    margin-bottom: 1rem;
}

#authForm button {
    width: 100%;
    padding: 1rem;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border: none;
    border-radius: 8px;
    font-size: 1.1rem;
    font-weight: 600;
    cursor: pointer;
}

.error {
    color: var(--secondary-color);
    display: none;
    margin-top: 1rem;
}

.error.show {
    display: block;
}

/* ==================== NAVIGATION ==================== */
.navbar {
    position: fixed;
    top: 0;
    width: 100%;
    background: rgba(30, 30, 30, 0.95);
    backdrop-filter: blur(10px);
    height: var(--nav-height);
    z-index: 1000;
    box-shadow: 0 2px 10px rgba(0,0,0,0.3);
}

.nav-container {
    max-width: 1400px;
    margin: 0 auto;
    padding: 0 2rem;
    height: 100%;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.nav-logo a {
    font-size: 1.8rem;
    font-weight: bold;
    color: #ffffff;
    text-decoration: none;
}

.nav-menu {
    display: flex;
    list-style: none;
    gap: 2rem;
}

.nav-menu a {
    color: #ffffff;
    font-weight: 500;
    text-decoration: none;
    position: relative;
}

.nav-menu a::after {
    content: '';
    position: absolute;
    bottom: -5px;
    left: 0;
    width: 0;
    height: 2px;
    background: #ffffff;
    transition: width 0.3s;
}

.nav-menu a:hover::after {
    width: 100%;
}

.lang-toggle {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.lang-option {
    font-weight: 600;
    color: #888;
    cursor: pointer;
}

.lang-option.active {
    color: #ffffff;
}

.switch {
    position: relative;
    width: 50px;
    height: 24px;
}

.switch input {
    opacity: 0;
    width: 0;
    height: 0;
}

.slider {
    position: absolute;
    cursor: pointer;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: #555;
    border-radius: 24px;
    transition: 0.4s;
}

.slider:before {
    content: "";
    position: absolute;
    height: 18px;
    width: 18px;
    left: 3px;
    bottom: 3px;
    background-color: white;
    border-radius: 50%;
    transition: 0.4s;
}

input:checked + .slider {
    background-color: #ffffff;
}

input:checked + .slider:before {
    transform: translateX(26px);
    background-color: #333;
}

.hamburger {
    display: none;
    flex-direction: column;
    cursor: pointer;
    gap: 5px;
}

.hamburger span {
    width: 25px;
    height: 3px;
    background: #ffffff;
    border-radius: 3px;
    transition: 0.3s;
}

.hamburger.active span:nth-child(1) {
    transform: rotate(45deg) translate(8px, 8px);
}

.hamburger.active span:nth-child(2) {
    opacity: 0;
}

.hamburger.active span:nth-child(3) {
    transform: rotate(-45deg) translate(7px, -7px);
}

/* ==================== HERO ==================== */
.hero {
    position: relative;
    width: 100%;
    min-height: 100vh;
    padding-top: var(--nav-height);
    overflow: hidden;
}

.hero-image {
    width: 100%;
    height: auto;
    position: relative;
}

.hero-image img {
    width: 100%;
    height: auto;
    display: block;
    object-fit: cover;
    object-position: top center;
}

.hero-content {
    position: absolute;
    top: 55%;
    left: 50%;
    transform: translate(-50%, -50%);
    text-align: center;
    z-index: 10;
    width: 90%;
}

.hero-title {
    font-size: clamp(3rem, 10vw, 8rem);
    color: white;
    text-shadow: 3px 3px 15px rgba(0,0,0,0.8);
    margin-bottom: 1rem;
    font-weight: bold;
    letter-spacing: 3px;
}

.hero-subtitle {
    font-size: clamp(1.2rem, 3vw, 2.5rem);
    color: white;
    text-shadow: 2px 2px 8px rgba(0,0,0,0.8);
    margin-bottom: 3rem;
    letter-spacing: 1px;
}

.btn-performance {
    display: inline-block;
    padding: 1.2rem 3.5rem;
    background: rgba(255, 255, 255, 0.5);
    color: white;
    text-decoration: none;
    font-size: 1.3rem;
    font-weight: 600;
    border-radius: 50px;
    border: 2px solid rgba(255, 255, 255, 0.8);
    box-shadow: 0 8px 20px rgba(255, 255, 255, 0.2);
    transition: all 0.3s;
    backdrop-filter: blur(5px);
}

.btn-performance:hover {
    background: rgba(255, 255, 255, 0.7);
    transform: translateY(-3px);
    box-shadow: 0 12px 30px rgba(255, 255, 255, 0.3);
}

/* ==================== CONTENT PAGES ==================== */
.content-page {
    min-height: 100vh;
    padding-top: var(--nav-height);
    position: relative;
}


.page-background {
    position: fixed;
    top: var(--nav-height);
    left: 0;
    width: 100%;
    height: calc(100vh - var(--nav-height));
    z-index: -1;
}

.page-background img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    filter: brightness(0.6);
}

.content-container {
    max-width: 1000px;
    margin: 0 auto;
    padding: 4rem 2rem;
}

.content-box {
    background: rgba(255, 255, 255, 0);
    padding: 3rem;
    border-radius: 15px;
    box-shadow: 0 10px 40px rgba(0,0,0,0.3);
    margin-bottom: 2rem;
    transition: background 0.1s ease;
}

/* Mobile: Immer 50% Transparenz */
@media (max-width: 768px) {
    .content-box {
        background: rgba(255, 255, 255, 0.5) !important;
    }

    #projektContent {
        background: rgba(0, 0, 0, 0.5) !important;
    }

    #contributorsContent {
        position: static !important;
        width: auto !important;
        left: auto !important;
        top: auto !important;
        transform: none !important;
        margin: 0 1.5rem !important;
    }
}

.content-box.draggable {
    cursor: move;
    border: 2px dashed transparent;
}

.content-box.draggable:hover {
    border-color: var(--secondary-color);
}

.content-box h1 {
    font-size: 2.8rem;
    color: var(--primary-color);
    margin-bottom: 1.5rem;
}

#projektContent {
    background: rgba(0, 0, 0, 0.15);
    max-width: 1200px;
    min-width: 300px;
    margin-left: 50%;
    transform: translateX(-50%);
    padding: 0 2rem;
}

#projektContent h1,
#projektContent p {
    color: white;
}

#contributorsContent {
    max-width: 1200px;
    min-width: 300px;
    margin-left: 5%;
    margin-right: 5%;
    transform: translateX(-50%);
    padding: 0 2rem;
}

#contributorsContent h1 {
    font-size: 2rem;
    margin-bottom: 2rem;
    text-align: center;
}

.contributors-columns {
    column-count: 2;
    column-gap: 3rem;
    column-rule: 1px solid rgba(255, 255, 255, 0.3);
}

.contributors-columns p {
    font-size: 1rem;
    line-height: 1.4;
    margin-bottom: 0.6rem;
    color: white;
    page-break-inside: avoid;
}

.contributors-columns p strong {
    display: inline;
}

.content-box p {
    font-size: 1.15rem;
    line-height: 1.9;
    color: var(--text-dark);
    margin-bottom: 1.2rem;
}

/* Contributors: tighter spacing than default content paragraphs */
.content-box .contributors-columns p {
    line-height: 1.15;
    margin-bottom: 0.6rem;
    color: black;
}

#geschichteContent {
    max-width: 800px;
    min-width: 300px;
    margin-left: 50%;
    transform: translateX(-50%);
    padding: 0 2rem;
}

/* ==================== PERFORMANCE ==================== */
.performance-container {
    width: 100%;
    min-height: 100vh;
    padding-top: var(--nav-height);
    position: relative;
    display: flex;
    flex-direction: column;
    align-items: center;
    background: #1a1a1a;
}

.performance-wrapper {
    position: relative;
    width: 100%;
    max-width: 100%;
    margin: 0 auto;
    display: flex;
    flex-direction: column;
    gap: 0;  /* Kein Abstand - Description klebt direkt am Bild */
}

.performance-image {
    position: relative;
    width: 100%;
    height: auto;
}

.performance-image img {
    width: 100%;
    height: auto;
    display: block;
    object-fit: cover;
    object-position: top center;
}

.stations-container {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
}

.station {
    position: absolute;
    background: rgba(255, 255, 255, 0.9);
    border: none;
    border-radius: 50%;
    cursor: pointer;
    box-shadow: 0 5px 20px rgba(0,0,0,0.4);
    width: 60px;
    height: 60px;
    transition: all 0.3s;
    transform-origin: center;
    pointer-events: auto;
    transform: translate(-50%, -50%);
}

.station:hover {
    background: rgba(255, 255, 255, 1);
    transform: translate(-50%, -50%) scale(1.2);
}

.station.dev-mode {
    cursor: move;
    pointer-events: auto;
}

.station.dev-mode:hover {
    background: rgba(255, 255, 255, 0.9);
    width: 60px;
    height: 60px;
    margin-left: 0;
    margin-top: 0;
}

body.dev-mode-active .station {
    pointer-events: none;
}

body.dev-mode-active .station.dev-mode {
    pointer-events: auto;
}

body.dev-mode-active .station-quad {
    pointer-events: auto;  /* Viereck ist draggable im DevMode */
    cursor: move;
}

body.dev-mode-active .station-quad .quad-frame,
body.dev-mode-active .station-quad .quad-frame polygon {
    pointer-events: none !important;  /* SVG und Polygon nicht klickbar im DevMode */
}

body.dev-mode-active .station-quad .quad-corner {
    pointer-events: auto;  /* Ecken bleiben draggable */
}

.station-label {
    position: fixed;
    background: rgba(0, 0, 0, 0.85);
    color: white;
    padding: 0.6rem 1.2rem;
    border-radius: 8px;
    white-space: nowrap;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.3s;
    backdrop-filter: blur(5px);
    z-index: 1000;
    transform: translate(-50%, -100%);
}

/* Touch devices use external labels positioned via JS, not inline labels */

.station:hover .station-label {
    opacity: 1;
}

/* ==================== STATION QUAD (Viereck) ==================== */
.station-quad {
    position: absolute;
    left: 50%;
    top: 50%;
    width: 36%;  /* Relativ zur Container-Breite */
    aspect-ratio: 1;  /* Quadratisch */
    transform: translate(-50%, -50%);
    cursor: default;  /* Kein pointer cursor auf div */
    pointer-events: none;  /* Das div selbst ist nicht klickbar */
    z-index: 10;
}

.station-quad .quad-frame {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;  /* SVG ist durchlässig */
}

.station-quad .quad-frame polygon {
    cursor: pointer;
    pointer-events: all;  /* Nur das Polygon fängt Klicks ab */
}

.station-quad .quad-frame polygon:hover {
    stroke: rgba(255, 255, 255, 1);
    stroke-width: 1;
    fill: rgba(255, 255, 255, 0.1);
}

.quad-corner {
    position: absolute;
    width: 10px;
    height: 10px;
    background: rgba(255, 255, 255, 0.8);
    border-radius: 50%;
    transform: translate(-50%, -50%);
    cursor: grab;
    z-index: 20;
    display: none;
}

body.dev-mode-active .quad-corner {
    display: block;
}

.quad-corner:active {
    cursor: grabbing;
}

/* Label wird über JavaScript gesteuert bei polygon hover */

body.dev-mode-active .performance-description {
    cursor: move;
}

.performance-description {
    max-width: 950px;
    margin: 0 auto;
    padding: 2rem;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 15px;
    text-align: center;
    margin-top: 0rem;  /* Abstand zur Bild-Unterkante (negativ = näher, positiv = weiter) */
    position: relative;  /* Bleibt im Flow */
    transform: translateY(var(--perf-desc-shift, 0px));
}

.performance-description p {
    color: white;
    font-size: 1.15rem;
    line-height: 1.9;
    margin: 0;
}

.dev-mode-toggle {
    position: fixed;
    bottom: 80px;
    right: 20px;
    z-index: 999;
    background: rgba(44, 62, 80, 0.9);
    color: white;
    border: none;
    padding: 1rem 1.5rem;
    border-radius: 50px;
    cursor: pointer;
    font-weight: 600;
    box-shadow: 0 5px 20px rgba(0, 0, 0, 0.3);
}

.dev-mode-toggle.active {
    background: #27ae60;
}

.position-info {
    position: fixed;
    top: 100px;
    right: 20px;
    background: rgba(0, 0, 0, 0.8);
    color: white;
    padding: 1rem;
    border-radius: 8px;
    font-family: 'Work Sans', 'Helvetica Neue', Arial, sans-serif;
    font-size: 0.9rem;
    z-index: 1000;
    display: none;
}

.position-info.show {
    display: block;
}

/* ==================== RESPONSIVE ==================== */
@media (max-width: 768px) {
    :root {
        --nav-height: var(--mobile-nav-height);
    }
    
    .navbar {
        height: var(--mobile-nav-height);
    }
    
    .nav-menu {
        position: fixed;
        left: -100%;
        top: var(--mobile-nav-height);
        flex-direction: column;
        background: rgba(30, 30, 30, 0.98);
        width: 100%;
        padding: 2rem 0;
        transition: 0.3s;
        box-shadow: 0 5px 20px rgba(0,0,0,0.5);
    }
    
    .nav-menu.active {
        left: 0;
    }
    
    .hamburger {
        display: flex;
    }
    
    .hero-title {
        font-size: 2.5rem;
    }
    
    .content-box {
        padding: 2rem 1.5rem;
    }
    
    .contributors-columns {
        column-count: 1;
    }
    
    #contributorsContent h1 {
        font-size: 1.6rem;
    }
    
    /* Performance page: vertical-filling image with horizontal scroll */
    .performance-container {
        overflow-x: auto;
        overflow-y: auto;
        height: 100vh;
        padding-top: var(--nav-height);
    }
    
    .performance-wrapper {
        display: block;
        min-width: max-content;
    }
    
    .performance-image {
        height: calc(100vh - var(--nav-height));
        width: auto;
        min-width: 100vw;
    }
    
    .performance-image img {
        height: 100%;
        width: auto;
        min-width: 100vw;
        object-fit: cover;
        object-position: center center;
    }
    
    .stations-container {
        height: 100%;
    }
    
    .performance-description {
        max-width: 90vw;
        margin: 2rem auto;
        padding: 1.5rem;
        font-size: 0.95rem;
    }
    
    .performance-description p {
        font-size: 1rem;
        line-height: 1.6;
    }
    
    /* Index page: vertical-filling hero image */
    .hero {
        height: 100vh;
        min-height: 100vh;
        overflow: hidden;
    }
    
    .hero-image {
        height: 100%;
        width: auto;
    }
    
    .hero-image img {
        height: 100%;
        width: 100%;
        object-fit: cover;
        object-position: center center;
    }
}
