:root {
    --background-color: #f8f8f8;
    --background-secondary: #ffffff;
    --text-color: #333;
    --text-secondary: #666;
    --border-color: #e0e0e0;
    --highlight-color: #007bff;
}

body.dark-mode {
    --background-color: #121212;
    --background-secondary: #1e1e1e;
    --text-color: #e0e0e0;
    --text-secondary: #a0a0a0;
    --border-color: #333;
    --highlight-color: #4dabf7;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
    margin: 0;
    background-color: var(--background-color);
    color: var(--text-color);
    transition: background-color 0.3s, color 0.3s;
}
.sticky-menu-container {
    position: sticky;
    top: 0;
    z-index: 100;
}
/* --- Top Header & Icons --- */
.main-menu a h1 {
    display: inline; /* Stellt sicher, dass es sich wie Text verhält */
    font-weight: 700; /* Macht die Schrift fetter (z.B. 600 oder 700) */
    font-size: inherit; /* SEHR WICHTIG: Vererbt die Schriftgröße des Links */
    margin: 0; /* Entfernt Standard-Abstände der Überschrift */
}



.top-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1rem 2rem;
    border-bottom: 1px solid var(--border-color);
    background-color: var(--background-color); /* Behalten, um Durchscheinen zu verhindern */
}

.main-menu a {
    color: var(--text-secondary);
    text-decoration: none;
    margin-right: 1.5rem;
    font-weight: 500;
    transition: color 0.2s;
}

.main-menu a:hover, .main-menu a.active {
    color: var(--text-color);
    border-bottom: 2px solid var(--text-color);
    padding-bottom: 4px;
}

.controls {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.icon-btn {
    background: none;
    border: none;
    padding: 0.5rem;
    cursor: pointer;
    color: var(--text-secondary);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
}

.icon-btn:hover {
    color: var(--text-color);
    background-color: rgba(0,0,0,0.05);
}

body.dark-mode .icon-btn:hover {
     background-color: rgba(255,255,255,0.1);
}

/* --- Navigationsleiste --- */
#gallery-view {
    border-bottom: 1px solid var(--border-color);
}

.series-nav {
    display: flex;
    align-items: center;
    padding: 1.5rem 2rem;
    background-color: var(--background-secondary);
    transition: padding 0.4s ease-in-out, max-height 0.4s ease-in-out, opacity 0.3s ease-in-out;
    overflow: hidden; /* Wichtig, damit Inhalt beim Einfahren nicht überlappt */
    max-height: 500px; /* Eine ausreichend große Maximalhöhe für den normalen Zustand */
}

.series-nav.hidden {
    height: 0;
    padding-top: 0;
    padding-bottom: 0;
    opacity: 0;
}
#gallery-view.retracted .series-nav {
    max-height: 0;
    padding-top: 0;
    padding-bottom: 0;
    opacity: 0;
}

/* Der Pfeil-Button wird im eingefahrenen Zustand ausgeblendet */
#gallery-view.retracted .toggle-nav-btn {
    opacity: 0; /* Macht den Button unsichtbar */
    pointer-events: none; /* Verhindert, dass man ihn versehentlich klicken kann */
}
/* --- Toggle Button --- */
.nav-toggle-wrapper {
    display: flex;
    justify-content: center;
    background-color: var(--background-secondary);
}

.toggle-nav-btn {
    background: none;
    border: none;
    cursor: pointer;
    width: 100px;
    height: 30px;
    color: var(--border-color);
    transition: color 0.2s, opacity 0.4s ease-in-out;
}

.toggle-nav-btn:hover {
    color: var(--text-secondary);
}

.toggle-nav-btn svg {
    width: 100%;
    height: 100%;
    transition: transform 0.4s ease-in-out;
}

.toggle-nav-btn.toggled svg {
    transform: rotate(180deg);
}


/* --- Karussell & Inhalte --- */
.series-info {
    flex-basis: 25%;
    min-width: 200px;
    padding-right: 2rem;
}

.series-info h2 {
    margin: 0 0 0.5rem 0;
    font-size: 1.2rem;
}

.series-info p {
    margin: 0;
    font-size: 0.9rem;
    color: var(--text-secondary);
}
.carousel-wrapper {
    flex-grow: 1;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    min-width: 0;
}
.carousel-container {
    
    overflow-x: auto; /* Wichtig, wird aber durch JS gesteuert */
    position: relative; /* Anker für die Buttons */
    /* Die sichtbare Scrollleiste ausblenden */
    scrollbar-width: none; /* Firefox */
    min-width: 0;
    
}
.carousel-container::-webkit-scrollbar {
    display: none; /* Chrome, Safari, Edge */
}

/* 2. Styling für die neuen Pfeil-Buttons */
/* Ersetzt die alten Pfeil-Stile */
.carousel-btn {
    background: none;
    border: none;
    cursor: pointer;
    color: var(--border-color);
    padding: 0.5rem;
    transition: color 0.2s;
    flex-shrink: 0; /* Verhindert, dass die Pfeile schrumpfen */
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
}

.carousel-btn:hover {
    color: var(--text-secondary);
    background-color: rgba(0, 0, 0, 0.05);
}

body.dark-mode .carousel-btn:hover {
    background-color: rgba(255, 255, 255, 0.1);
}

.carousel-btn svg {
    width: 28px;
    height: 28px;
}


.series-carousel {
    display: flex;
    gap: 1rem;
    padding-bottom: 1rem;
    cursor: pointer;
    scroll-snap-type: x mandatory; /* Sorgt für schönes Einrasten nach dem Scrollen */
    scroll-behavior: smooth;
}

.carousel-item {
    cursor: pointer;
    border: 3px solid transparent;
    transition: border-color 0.3s, transform 0.3s;
    border-radius: 4px;
    overflow: hidden;
    scroll-snap-align: center; /* Zentriert die Items beim Einrasten */
    flex-shrink: 0; /* Unbedingt erforderlich, um das Schrumpfen zu verhindern! */
}

.carousel-item:hover {
    transform: scale(1.05);
}

.carousel-item.active {
    border-color: var(--highlight-color);
}

.carousel-item img {
    display: block;
    width: 120px;
    height: 120px;
    object-fit: cover;
    pointer-events: none;
}
.series-carousel.grabbing {
    cursor: grabbing;
    scroll-snap-type: none; /* Deaktiviert das Einrasten während des Ziehens */
    scroll-behavior: auto;
}
#content-container {
    padding: 2rem;
}

.content-section {
    display: none;
}

.content-section.active {
    display: block;
}

#artwork-grid.active { /* <-- Nur anwenden, wenn die Klasse .active vorhanden ist */
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
    gap: 1.5rem;
}

#artwork-grid img {
    width: 100%;
    height: auto;
    object-fit: cover;
    border-radius: 4px;
}

h1 {
    font-weight: 600;
    border-bottom: 1px solid var(--border-color);
    padding-bottom: 0.5rem;
    margin-bottom: 2rem;
}

.vita-content { display: flex; gap: 2rem; }
.vita-content img { max-width: 250px; height: auto; border-radius: 4px; }
.contact-details a { color: var(--highlight-color); text-decoration: none; }
.contact-details a:hover { text-decoration: underline; }
.gallery-3d-container {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: #000;
    z-index: 200;
    display: none; /* Standardmäßig versteckt */
    opacity: 0;
    transition: opacity 0.4s ease-in-out;
}

.gallery-3d-container.visible {
    display: block;
    opacity: 1;
}

#c-3d {
    display: block;
    width: 100%;
    height: 100%;
    touch-action: none
}

#info-overlay-3d {
    position: absolute;
    top: 0; left: 0; width: 100%; height: 100%;
    background-color: rgba(0,0,0,0.7);
    color: white;
    display: flex;
    justify-content: center;
    align-items: center;
    text-align: center;
    font-family: sans-serif;
    font-size: 1.5em;
    cursor: pointer;
    transition: opacity 0.5s ease-in-out;
    display: none !important;
}
#info-overlay-3d.hidden {
    opacity: 0;
    pointer-events: none; /* Macht das unsichtbare Overlay nicht mehr klickbar */
}
#info-overlay-3d > div {
    cursor: default;
}
#close-3d-gallery-btn {
    margin-top: 2rem;
    padding: 0.8rem 1.5rem;
    font-size: 0.8em;
    background-color: transparent;
    border: 2px solid white;
    color: white;
    cursor: pointer;
    transition: background-color 0.2s, color 0.2s;
}

#close-3d-gallery-btn:hover {
    background-color: white;
    color: black;
}
/* --- Lightbox --- */
.lightbox-container {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 1000;
    display: flex;
    justify-content: center;
    align-items: center;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s ease, visibility 0.3s ease;
}

.lightbox-container.active {
    opacity: 1;
    visibility: visible;
}

.lightbox-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.85);
    backdrop-filter: blur(5px);
}

.lightbox-content {
    position: relative;
    z-index: 1001;
    display: flex;
    flex-direction: column;
    max-width: 90vw;
    max-height: 90vh;
}

#lightbox-image {
    max-width: 100%;
    max-height: 80vh; /* Etwas Platz für die Details lassen */
    object-fit: contain;
    border-radius: 4px;
    box-shadow: 0 10px 30px rgba(0,0,0,0.5);
}

#lightbox-details {
    color: white;
    padding: 1rem;
    max-width: 70ch;
    margin: 0 auto;
    text-align: center;
    background: linear-gradient(to top, rgba(0,0,0,0.7), transparent);
}

#lightbox-details h3 {
    margin: 0 0 0.5rem;
}

#lightbox-details p {
    margin: 0.25rem 0;
    color: var(--background-color);
}

.lightbox-btn {
    position: absolute;
    z-index: 1002;
    background: rgba(30, 30, 30, 0.5);
    border: 1px solid rgba(255, 255, 255, 0.2);
    color: white;
    cursor: pointer;
    border-radius: 50%;
    width: 50px;
    height: 50px;
    font-size: 2rem;
    display: flex;
    justify-content: center;
    align-items: center;
    transition: background-color 0.2s;
}

.lightbox-btn:hover {
    background: rgba(0, 0, 0, 0.7);
}

.lightbox-btn.close { top: 20px; right: 20px; }
.lightbox-btn.prev { top: 50%; left: 20px; transform: translateY(-50%); }
.lightbox-btn.next { top: 50%; right: 20px; transform: translateY(-50%); }

.lightbox-btn.teleport {
    bottom: 20px;
    left: 50%;
    transform: translateX(-50%);
    width: auto;
    height: auto;
    padding: 0.5rem 1rem;
    font-size: 0.9rem;
    border-radius: 20px;
}
.lightbox-btn.teleport svg { width: 20px; height: 20px; margin-right: 0.5rem; }
/* style.css */
.config-manager-container {
    display: flex;
    height: 100vh;
}
.app-content {
    flex-grow: 1;
    overflow-y: auto; /* Erlaubt Scrollen für den Hauptinhalt */
    height: 100vh;
}
.editor-pane {
    flex-basis: 40%;
    min-width: 400px;
    padding: 1rem;
    background-color: var(--background-secondary);
    border-left: 1px solid var(--border-color);
    display: flex;
    flex-direction: column;
}
.editor-pane h2 {
    margin-top: 0;
}
.editor-pane textarea {
    width: 100%;
    height: 100%;
    flex-grow: 1;
    font-family: monospace;
    font-size: 14px;
    border: 2px solid var(--border-color);
    border-radius: 4px;
    padding: 0.5rem;
    background-color: var(--background-color);
    color: var(--text-color);
}
.resizer-handle {
    flex-basis: 6px;
    background-color: var(--border-color);
    cursor: col-resize;
    transition: background-color 0.2s;
}

.resizer-handle:hover {
    background-color: var(--highlight-color);
}

.app-content {
    flex-grow: 1;
    overflow-y: auto; /* Erlaubt Scrollen für den Hauptinhalt */
    height: 100vh;
}
@media (max-width: 768px) {
    .series-nav { flex-direction: column; align-items: flex-start; gap: 1.5rem; }
    .carousel-wrapper { width: 100%; }
    .vita-content { flex-direction: column; }
    .top-header, #content-container { padding: 1rem; }
    .main-menu a { margin-right: 1rem; line-height: 1.8; }
}