/* Grundlegendes Styling & Reset */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: Arial, sans-serif;
}

body {
    color: white;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    overflow-x: hidden;
    position: relative;
    background-color: #000;
}

/* Video Container im Vollbild */
.video-container {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    z-index: 1;
    pointer-events: none;
    overflow: hidden;
}

.bg-video {
    width: 100vw;
    height: 100vh;
    position: absolute;
    top: 0;
    left: 0;
    object-fit: cover;
    filter: brightness(0.7);
}

/* YouTube Player Leiste unten */
.yt-player-bar {
    position: absolute;
    bottom: 38px;
    left: 0;
    width: 100%;
    background: linear-gradient(to top, rgba(0,0,0,0.9) 0%, rgba(0,0,0,0.5) 70%, transparent 100%);
    display: flex;
    flex-direction: column;
    padding-bottom: 8px;
    z-index: 100;
    pointer-events: auto;
}

/* Rote Fortschrittsleiste */
.yt-progress-container {
    width: 100%;
    height: 4px;
    background: rgba(255, 255, 255, 0.3);
    cursor: pointer;
    position: relative;
    transition: height 0.1s ease;
}

.yt-progress-container:hover {
    height: 7px;
}

.yt-progress-bar {
    width: 0%;
    height: 100%;
    background-color: #f00;
    position: relative;
}

/* Controls Layout */
.yt-controls {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 8px 20px 0 20px;
    flex-wrap: wrap;
    gap: 10px;
}

.yt-controls-left, .yt-controls-right {
    display: flex;
    align-items: center;
    gap: 15px;
    flex-wrap: wrap;
}

.yt-btn {
    background: transparent;
    border: none;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 4px;
    opacity: 0.9;
    transition: opacity 0.2s, transform 0.1s;
}

.yt-btn:hover {
    opacity: 1;
    transform: scale(1.1);
}

.yt-volume-container {
    display: flex;
    align-items: center;
    gap: 5px;
}

.yt-volume-slider {
    width: 60px;
    height: 3px;
    accent-color: white;
    cursor: pointer;
}

.yt-time {
    font-size: 13px;
    color: #eee;
    user-select: none;
}

/* Dropdowns im YouTube-Stil */
.yt-custom-select-group {
    display: flex;
    align-items: center;
    gap: 5px;
    font-size: 13px;
    color: #ccc;
    position: relative;
    z-index: 105;
}

.yt-select {
    background: rgba(30, 30, 30, 0.95);
    color: white;
    border: 1px solid rgba(255, 255, 255, 0.3);
    padding: 5px 10px;
    border-radius: 4px;
    outline: none;
    font-size: 13px;
    cursor: pointer;
    pointer-events: auto !important;
}

.yt-select option {
    background: #222;
    color: white;
}

/* Navigationsleiste */
.navbar {
    background-color: rgba(34, 34, 34, 0.85);
    backdrop-filter: blur(8px);
    height: 60px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 20px;
    position: fixed;
    top: 0;
    width: 100%;
    z-index: 1000;
}

.nav-left, .nav-right {
    display: flex;
    align-items: center;
    gap: 15px;
}

.menu-btn {
    width: 30px;
    height: 20px;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    cursor: pointer;
}

.menu-btn .bar {
    width: 100%;
    height: 3px;
    background-color: white;
    border-radius: 2px;
    transition: all 0.3s ease;
}

.menu-btn.open .bar:nth-child(1) { transform: translateY(8.5px) rotate(45deg); }
.menu-btn.open .bar:nth-child(2) { opacity: 0; }
.menu-btn.open .bar:nth-child(3) { transform: translateY(-8.5px) rotate(-45deg); }

.logo { height: 40px; width: auto; object-fit: contain; cursor: pointer; }

.nav-center { flex-grow: 1; max-width: 400px; margin: 0 20px; }

.search-input {
    width: 100%;
    padding: 8px 15px;
    border-radius: 20px;
    border: none;
    outline: none;
    background-color: #333;
    color: white;
}

/* Sidebar */
.sidebar {
    position: fixed;
    top: 60px;
    left: -250px;
    width: 250px;
    height: calc(100vh - 60px);
    background-color: #222;
    transition: left 0.3s ease;
    z-index: 999;
}
.sidebar.active { left: 0; }
.sidebar ul { list-style: none; padding: 20px; }
.sidebar ul li { margin-bottom: 15px; }
.sidebar ul li a { color: white; text-decoration: none; font-size: 18px; display: block; padding: 8px; border-radius: 4px; }
.sidebar ul li a:hover { background-color: #333; }

.page-content { flex: 1; }

/* Fehlermeldung Overlay */
.error-overlay {
    position: fixed;
    top: 0; left: 0; width: 100vw; height: 100vh;
    background: rgba(0, 0, 0, 0.85);
    display: flex; justify-content: center; align-items: center;
    z-index: 2000;
    opacity: 0; visibility: hidden;
    transition: opacity 0.4s ease;
}
.error-overlay.visible { opacity: 1; visibility: visible; }

.error-box {
    background: #222; border: 2px solid #e74c3c;
    padding: 30px; border-radius: 12px; text-align: center;
    max-width: 450px; width: 90%;
    transform: scale(0.8);
    animation: popIn 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275) forwards;
}
@keyframes popIn { to { transform: scale(1); } }
.error-box h2 { color: #e74c3c; margin-bottom: 15px; }
.error-box p { color: #ccc; margin-bottom: 25px; font-size: 15px; }
.error-buttons { display: flex; gap: 15px; justify-content: center; }
.error-btn { background: #e74c3c; color: white; text-decoration: none; padding: 10px 18px; border-radius: 6px; border: none; font-weight: bold; cursor: pointer; transition: background 0.2s; }
.error-btn:hover { background: #c0392b; }
.hidden { display: none !important; }

/* Footer */
footer {
    width: 100%; 
    text-align: center; 
    padding: 10px;
    font-size: 11px; 
    color: #aaa;
    background-color: rgba(0, 0, 0, 0.95);
    position: fixed; 
    bottom: 0; 
    left: 0;
    height: 38px;
    z-index: 101;
    display: flex;
    align-items: center;
    justify-content: center;
    pointer-events: auto;
}

/* Vollbild-Ausblendung */
:fullscreen .navbar,
:fullscreen footer,
:fullscreen .sidebar,
:-webkit-full-screen .navbar,
:-webkit-full-screen footer,
:-webkit-full-screen .sidebar {
    display: none !important;
}

/* ==========================================
   RESPONSIVE MEDIA QUERIES (Tablet & Handy)
   ========================================== */

/* Tablet (Bildschirme bis 1024px) */
@media screen and (max-width: 1024px) {
    .yt-controls {
        padding: 6px 12px 0 12px;
    }
    
    .yt-controls-left, .yt-controls-right {
        gap: 10px;
    }

    .nav-center {
        max-width: 250px;
    }
}

/* Handy (Bildschirme bis 768px) */
@media screen and (max-width: 768px) {
    .nav-center {
        display: none; /* Suchleiste ausblenden auf kleinen Handys, um Platz zu sparen */
    }

    .yt-controls {
        flex-direction: column;
        align-items: stretch;
        gap: 8px;
        padding: 6px 10px 4px 10px;
    }

    .yt-controls-left, .yt-controls-right {
        justify-content: space-between;
        width: 100%;
    }

    .yt-volume-slider {
        width: 45px;
    }

    .yt-player-bar {
        bottom: 35px; /* Footer Platz anpassen falls nötig */
    }

    .logo {
        height: 32px;
    }
}

/* Kleine Handys (Bildschirme bis 480px) */
@media screen and (max-width: 480px) {
    .yt-time {
        font-size: 11px;
    }

    .yt-select {
        font-size: 11px;
        padding: 3px 6px;
    }

    .yt-custom-select-group label {
        font-size: 11px;
    }

    footer {
        font-size: 9px;
        height: 32px;
    }

    .yt-player-bar {
        bottom: 32px;
    }
}