/* 
========================================================================
PROJECT CORE - DESIGN SYSTEM & LAYOUT ENGINE
========================================================================
*/

:root {
    /* Theme Obsidian (Default) */
    --bg-dark: #0b0e14;
    --text-dark: #c9d1d9;
    --accent-dark: #58a6ff;

    /* Theme White (Praxis) */
    --bg-light: #ffffff;
    --text-light: #1a1a1a;
    --accent-light: #005ea2;

    /* SAFE ZONES für das UI-Overlay */
    --ui-top-height: 140px;
    --ui-bottom-height: 120px;

    --transition-speed: 0.6s;
    --transition-curve: cubic-bezier(0.4, 0, 0.2, 1);
}

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

body,
html {
    height: 100%;
    width: 100%;
    overflow: hidden;
    font-family: 'Inter', -apple-system, system-ui, sans-serif;
    background-color: var(--bg-dark);
    color: var(--text-dark);
    transition: background-color 0.5s ease, color 0.5s ease;
}

/* --- THEME SWITCHING --- */
body.theme-dark {
    background-color: var(--bg-dark);
    color: var(--text-dark);
    --active-accent: var(--accent-dark);
}

body.theme-light {
    background-color: var(--bg-light) !important;
    color: var(--text-light) !important;
    --active-accent: var(--accent-light);
}

/* --- LAYOUT STRUCTURE --- */

#viewport {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    perspective: 1000px;
}

#slide-stage {
    width: 100%;
    height: 100%;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    /* Vertikale Zentrierung */
    padding: 140px 100px 120px 100px;
    text-align: center;
    box-sizing: border-box;
}

/* --- UI OVERLAY (TOP & BOTTOM) --- */

#ui-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    /* Klicks gehen durch das Overlay zu den Nav-Zonen */
    z-index: 9999;
}

/* Interaktive UI-Elemente wieder klickbar machen */
#block-nav,
#ui-controls,
#ui-footer,
.ctrl-btn {
    pointer-events: auto;
}

#block-nav {
    display: flex;
    gap: 15px;
    padding: 30px 50px;
}

.block-seg {
    flex: 1;
    opacity: 0.2;
    transition: opacity 0.4s;
}

.block-seg.active {
    opacity: 1;
}

.block-seg .line {
    height: 3px;
    background: var(--active-accent);
    border-radius: 2px;
}

.block-seg span {
    font-size: 10px;
    letter-spacing: 2px;
    font-weight: 800;
    display: block;
    margin-top: 8px;
}

#ui-footer {
    position: absolute;
    bottom: 0;
    width: 100%;
    padding: 30px 50px;
}

#global-progress-container {
    width: 100%;
    height: 2px;
    background: rgba(128, 128, 128, 0.1);
    margin-bottom: 15px;
}

#global-progress-bar {
    height: 100%;
    width: 0%;
    background: var(--active-accent);
    transition: width 0.3s ease;
}

.footer-meta {
    display: flex;
    justify-content: space-between;
    font-family: 'Courier New', monospace;
    font-size: 11px;
    opacity: 0.5;
}

/* --- NAVIGATION TRIGGERS (SIDE CLICK ZONES) --- */

.nav-trigger {
    position: absolute;
    top: 140px;
    /* Beginnt unter der Top-Nav */
    bottom: 120px;
    /* Endet über der Bottom-Nav */
    width: 15%;
    z-index: 10;
    /* Niedriger als der Fullscreen Button! */
    pointer-events: auto;
    cursor: pointer;
}

#nav-trigger-right {
    right: 0;
}

#nav-trigger-left {
    left: 0;
}

#ui-controls {
    position: absolute;
    top: 40px;
    right: 50px;
    pointer-events: auto;
    /* Macht den Bereich klickbar */
    z-index: 100000;
    /* Höchster Z-Index */
    opacity: 0.8;
}

#btn-fullscreen {
    position: relative;
    pointer-events: auto !important;
    cursor: pointer !important;
    background: rgba(11, 14, 20, 0.8);
    /* Obsidian BG für Sichtbarkeit */
    border: 1px solid var(--active-accent);
    padding: 5px 10px;
    color: var(--active-accent);
    font-size: 1.2rem;
    border-radius: 4px;
    transition: 0.3s;
}

#btn-fullscreen:hover {
    background: var(--active-accent);
    color: #fff;
}

.ctrl-btn {
    background: none;
    border: 1px solid rgba(128, 128, 128, 0.3);
    color: inherit;
    padding: 8px 12px;
    border-radius: 4px;
    cursor: pointer;
    opacity: 0.5;
    transition: 0.3s;
}

.ctrl-btn:hover {
    opacity: 1;
    border-color: var(--active-accent);
}

/* --- OPTIMIERTE TRANSITIONS (HARDWARE ACCELERATED) --- */

/* 1. Morph (Theorie) */
.t-morph-enter {
    animation: morphIn var(--transition-speed) var(--transition-curve) forwards;
}

@keyframes morphIn {
    0% {
        opacity: 0;
        transform: translateY(40px) scale(0.95);
    }

    100% {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

/* 2. Glitch (Tech) */
.t-glitch-enter {
    animation: glitchIn 0.3s steps(2) forwards;
}

@keyframes glitchIn {
    0% {
        opacity: 0;
        transform: translateX(-20px) skewX(10deg);
    }

    50% {
        opacity: 0.5;
        transform: translateX(10px);
    }

    100% {
        opacity: 1;
        transform: translateX(0) skewX(0);
    }
}

/* 3. Deep Zoom (Future) */
.t-deep-enter {
    animation: deepIn 0.8s var(--transition-curve) forwards;
}

@keyframes deepIn {
    0% {
        opacity: 0;
        transform: scale(1.2);
    }

    100% {
        opacity: 1;
        transform: scale(1);
    }
}

/* 4. Radial Wipe (Praxis Switch) */
.t-wipe-enter {
    animation: wipeIn 0.6s ease-in-out forwards;
}

@keyframes wipeIn {
    0% {
        clip-path: inset(0 100% 0 0);
        opacity: 0;
    }

    100% {
        clip-path: inset(0 0 0 0);
        opacity: 1;
    }
}

/* Fallback Fade */
.t-fade-enter {
    animation: fadeIn 0.5s ease forwards;
}

@keyframes fadeIn {
    from {
        opacity: 0;
    }

    to {
        opacity: 1;
    }
}

.block-seg {
    flex: 1;
    opacity: 0.2;
    transition: all 0.4s ease;
    cursor: pointer;
    /* Klickbar machen */
}

.block-seg:hover {
    opacity: 0.8 !important;
}

.block-seg.active {
    opacity: 1;
}

/* In style.css ergänzen */
.fullscreen-mode {
    position: fixed !important;
    top: 0 !important;
    left: 0 !important;
    width: 100vw !important;
    height: 100vh !important;
    padding: 0 !important;
    margin: 0 !important;
    z-index: 1;
}

/* Verhindert, dass das UI (Header/Footer) von der Folie überlagert wird, 
   aber die Folie trotzdem dahinter Fullscreen ist */
#slide-stage {
    z-index: 2;
}
#ui-overlay {
    z-index: 9999;
}