/* Base Styles */
:root {
    --primary-color: #007bff;
    --text-color: #333;
    --bg-color: #f8f9fa;
    --nav-bg-color: #e9ecef;
    --border-color: #dee2e6;
}

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

body {
    font-family: Arial, sans-serif;
    line-height: 1.6;
    color: var(--text-color);
    background-color: var(--bg-color);
}

.page {
    display: none;
    padding: 20px;
    max-width: 1200px;
    margin: 0 auto;
}

.page.active {
    display: block;
}

h1, h2 {
    margin-bottom: 20px;
    text-align: center;
}

/* Language Selection Page */
.language-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
    gap: 20px;
    justify-content: center;
}

.language-btn {
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 10px;
    border: 1px solid var(--border-color);
    border-radius: 5px;
    background-color: white;
    cursor: pointer;
    transition: background-color 0.3s;
}

.language-btn:hover:not(:disabled) {
    background-color: var(--nav-bg-color);
}

.language-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.flag-icon {
    width: 60px;
    height: 40px;
    margin-bottom: 10px;
}

/* Main Course Page */
.chapter-list {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.chapter-btn {
    padding: 15px;
    border: none;
    background-color: var(--nav-bg-color);
    color: var(--text-color);
    text-align: left;
    cursor: pointer;
    transition: background-color 0.3s;
}

.chapter-btn:hover {
    background-color: var(--primary-color);
    color: white;
}

/* Chapter Page */
.chapter-header {
    display: flex;
    align-items: center;
    margin-bottom: 20px;
}

.chapter-title {
    flex-grow: 1;
    text-align: center;
}

.video-container {
    margin-bottom: 20px;
}

video {
    width: 100%;
    max-width: 800px;
    display: block;
    margin: 0 auto;
}

.chapter-description {
    margin-bottom: 20px;
}

.chapter-nav {
    display: flex;
    justify-content: space-between;
    padding: 20px 0;
}

.nav-btn {
    background: none;
    border: none;
    cursor: pointer;
    padding: 10px;
}

.nav-btn img {
    width: 24px;
    height: 24px;
}

/* Side Navigation */
.side-nav {
    position: fixed;
    top: 0;
    left: -250px;
    width: 250px;
    height: 100%;
    background-color: white;
    box-shadow: 2px 0 5px rgba(0, 0, 0, 0.1);
    transition: left 0.3s;
    z-index: 1000;
}

.side-nav.open {
    left: 0;
}

.side-nav h2 {
    padding: 20px;
    background-color: var(--primary-color);
    color: white;
}

.side-nav ul {
    list-style-type: none;
}

.side-nav-btn {
    display: block;
    width: 100%;
    padding: 15px 20px;
    border: none;
    background: none;
    text-align: left;
    cursor: pointer;
    transition: background-color 0.3s;
}

.side-nav-btn:hover {
    background-color: var(--nav-bg-color);
}

.close-btn {
    position: absolute;
    top: 10px;
    right: 10px;
    font-size: 24px;
    background: none;
    border: none;
    color: white;
    cursor: pointer;
}

/* Responsive Design */
@media (min-width: 768px) {
    .page {
        padding: 40px;
    }

    .chapter-nav {
        position: fixed;
        bottom: 20px;
        left: 50%;
        transform: translateX(-50%);
        background-color: rgba(255, 255, 255, 0.8);
        padding: 10px;
        border-radius: 30px;
        box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
    }

    .side-nav {
        left: 0;
        width: 300px;
        transform: translateX(-100%);
    }

    .side-nav.open {
        transform: translateX(0);
    }

    #app {
        margin-left: 0;
        transition: margin-left 0.3s;
    }

    #app.nav-open {
        margin-left: 300px;
    }
}

@media (min-width: 1024px) {
    .page {
        display: flex;
        flex-direction: column;
        min-height: 100vh;
    }

    .video-container {
        flex-grow: 1;
        display: flex;
        align-items: center;
        justify-content: center;
    }

    .chapter-nav {
        position: static;
        transform: none;
        background-color: transparent;
        box-shadow: none;
    }
}

@media (max-width: 480px) {
    .language-grid {
        grid-template-columns: repeat(2, 1fr);
    }

    .chapter-nav {
        flex-direction: column;
        align-items: stretch;
    }

    .nav-btn {
        margin-bottom: 10px;
    }
}

@media (min-width: 1200px) {
    .page {
        max-width: 1000px;
    }

    .video-container {
        max-width: 800px;
        margin: 0 auto;
    }
}

.download-btn {
    display: inline-block;
    padding: 10px 20px;
    background-color: var(--primary-color);
    color: white;
    text-decoration: none;
    border-radius: 5px;
    transition: background-color 0.3s;
}

.download-btn:hover {
    background-color: #0056b3;
}

footer {
    text-align: center;
    padding: 20px;
    background-color: var(--nav-bg-color);
    margin-top: 20px;
}

/* Video Player Styles */
.video-container {
    position: relative;
    background: #000;
    width: 720px;
    height: 1280px;
    margin: 0 auto;
}

.plyr {
    width: 100%;
    height: auto;
}

video {
    width: auto;
    height: auto;
    max-width: 100%;
}

/* Language Overlay */
.overlay {
    display: none;
    position: fixed;
    width: 100%;
    height: 100%;
    top: 0;
    left: 0;
    background: rgba(0, 0, 0, 0.9);
    z-index: 1000;
}

.overlay-content {
    position: relative;
    top: 50%;
    transform: translateY(-50%);
    text-align: center;
    padding: 20px;
    color: white;
}

.flag-container {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 20px;
    max-width: 600px;
    margin: 0 auto;
}

.flag-item {
    cursor: pointer;
    transition: transform 0.2s;
}

.flag-item:hover {
    transform: scale(1.1);
}

.flag-item img {
    width: 100px;
    height: 75px;
    border-radius: 8px;
    margin-bottom: 10px;
}

.flag-item span {
    display: block;
    color: white;
    font-size: 14px;
}

/* Chapter Navigation */
.chapter-nav {
    flex: 1;
    padding: 15px;
    background-color: #f8f9fa;
    border-radius: 8px;
    cursor: pointer;
    transition: background-color 0.3s;
}

.chapter-nav:hover {
    background-color: #e9ecef;
}

.chapter-nav.disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.chapter-label {
    display: block;
    font-size: 0.9em;
    color: #6c757d;
    margin-bottom: 5px;
}

.chapter-title {
    display: block;
    font-weight: bold;
    color: #2c3e50;
}

.prev-chapter {
    text-align: left;
}

.next-chapter {
    text-align: right;
}

/* Mobile Anpassungen */
@media (max-width: 768px) {
    .navigation {
        flex-direction: column;
    }
    
    .prev-chapter, .next-chapter {
        text-align: center;
    }

    .video-container {
        width: 100%;
        height: auto;
        aspect-ratio: 9/16;
    }
}

/* Container für das gesamte Layout */
.container {
    display: grid;
    grid-template-columns: 10% 80% 10%;
    gap: 20px;
    max-width: 1200px;
    margin: 0 auto;
    padding: 20px;
}

/* Video-Container in der mittleren Spalte */
.video-container {
    grid-column: 2;
    position: relative;
    background: #000;
    width: 720px;
    height: 1280px;
    margin: 0 auto 20px auto;
}

/* Menü-Container in der mittleren Spalte */
.menu {
    grid-column: 2;
    display: flex;
    flex-direction: column;
    gap: 10px;
    margin: 20px 0;
}

/* Styling für Menü-Items */
.menu-item {
    padding: 15px;
    background-color: #f8f9fa;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.3s ease;
    text-align: left;
    font-size: 1rem;
}

.menu-item:hover {
    background-color: #e9ecef;
    transform: translateX(5px);
}

.menu-item.active {
    background-color: #007bff;
    color: white;
}

/* Navigation Styling */
.navigation {
    display: contents; /* Erlaubt den Kindern, direkt im Grid platziert zu werden */
}

/* Prev Chapter Button */
.prev-chapter {
    grid-column: 1;
    grid-row: 1 / span 2; /* Erstreckt sich über Video und Menü */
    align-self: center;
}

/* Next Chapter Button */
.next-chapter {
    grid-column: 3;
    grid-row: 1 / span 2; /* Erstreckt sich über Video und Menü */
    align-self: center;
}

/* Styling für die Navigationspfeile */
.chapter-nav {
    background: none;
    border: none;
    cursor: pointer;
    padding: 20px;
    transition: transform 0.3s ease;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 10px;
}

.chapter-nav:not(.disabled):hover {
    transform: scale(1.1);
}

.chapter-nav.disabled {
    opacity: 0.3;
    cursor: not-allowed;
}

/* Pfeil-Icons */
.chapter-nav::before {
    content: '';
    width: 20px;
    height: 20px;
    border-top: 3px solid #333;
    border-right: 3px solid #333;
}

.prev-chapter::before {
    transform: rotate(-135deg); /* Pfeil nach links */
}

.next-chapter::before {
    transform: rotate(45deg); /* Pfeil nach rechts */
}

/* Kapitel-Titel in der Navigation */
.chapter-title {
    font-size: 0.8rem;
    text-align: center;
    max-width: 100px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

/* Mobile Anpassungen */
@media (max-width: 768px) {
    .container {
        grid-template-columns: 15% 70% 15%;
        padding: 10px;
    }

    .video-container {
        width: 100%;
        height: auto;
        aspect-ratio: 9/16;
    }

    .menu-item {
        padding: 12px;
        font-size: 0.9rem;
    }

    .chapter-nav {
        padding: 10px;
    }

    .chapter-title {
        display: none; /* Verstecke Titel auf mobilen Geräten */
    }
}

