/* Episode Menu Styles */

/* Hamburger Menu Toggle Button (Mobile Only) */
.episode-menu-toggle {
    display: flex;
    align-items: center;
    justify-content: center;
    background: none;
    border: none;
    color: #333;
    cursor: pointer;
    padding: 0.75rem;
    min-width: 48px;
    min-height: 48px;
    border-radius: 8px;
    transition: background-color 0.2s;
    flex-shrink: 0;
}

.episode-menu-toggle:hover {
    background-color: rgba(0, 0, 0, 0.05);
}

.episode-menu-toggle:active {
    background-color: rgba(0, 0, 0, 0.1);
}

/* Hide hamburger button on desktop */
@media (min-width: 768px) {
    .episode-menu-toggle {
        display: none;
    }
}

/* Episode Sidebar */
.episode-sidebar {
    position: fixed;
    top: 0;
    left: 0;
    width: 280px;
    height: 100vh;
    background: #ffffff;
    box-shadow: 2px 0 12px rgba(0, 0, 0, 0.1);
    z-index: 999;
    display: flex;
    flex-direction: column;
    transform: translateX(-100%);
    transition: transform 0.3s ease;
}

/* Mobile: Show sidebar when active */
.episode-sidebar.show {
    transform: translateX(0);
}

/* Desktop: Always visible sidebar */
@media (min-width: 768px) {
    .episode-sidebar {
        transform: translateX(0);
        width: 260px;
    }

    /* Adjust body to account for sidebar */
    body.player-page {
        padding-left: 260px;
    }
}

/* Episode Sidebar Header */
.episode-sidebar-header {
    padding: 1.5rem 1.25rem;
    border-bottom: 1px solid #e0e0e0;
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-shrink: 0;
}

.episode-sidebar-title {
    font-size: 1.1rem;
    font-weight: 600;
    color: #2c3e50;
    margin: 0;
}

.episode-sidebar-close {
    display: flex;
    align-items: center;
    justify-content: center;
    background: none;
    border: none;
    color: #666;
    cursor: pointer;
    padding: 0.5rem;
    border-radius: 8px;
    transition: background-color 0.2s;
    min-width: 36px;
    min-height: 36px;
}

.episode-sidebar-close:hover {
    background-color: rgba(0, 0, 0, 0.05);
}

.episode-sidebar-close:active {
    background-color: rgba(0, 0, 0, 0.1);
}

/* Hide close button on desktop */
@media (min-width: 768px) {
    .episode-sidebar-close {
        display: none;
    }
}

/* Scrollable wrapper for episode list + footer */
.episode-sidebar-scroll {
    flex: 1;
    overflow-y: auto;
    overflow-x: hidden;
}

/* Episode List */
.episode-list {
    list-style: none;
    padding: 0.5rem 0;
    margin: 0;
}

.episode-item {
    padding: 0.875rem 1.25rem;
    cursor: pointer;
    transition: background-color 0.2s;
    display: flex;
    align-items: center;
    gap: 0.75rem;
    color: #333;
    font-size: 0.95rem;
    position: relative;
}

.episode-item:hover {
    background-color: rgba(60, 75, 251, 0.08);
}

.episode-item:active {
    background-color: rgba(60, 75, 251, 0.12);
}

.episode-item.active {
    background-color: #C5E67380; /* Primary dialogue green */
    color: #2c3e50;
    font-weight: 600;
}

.episode-item.active:hover {
    background-color: #C5E673A0;
}

.episode-number {
    flex-shrink: 0;
    width: 28px;
    height: 28px;
    border-radius: 50%;
    background: rgba(60, 75, 251, 0.1);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.85rem;
    font-weight: 600;
    color: #3C4BFB;
}

.episode-item.active .episode-number {
    background: #3C4BFB;
    color: white;
}

.episode-title {
    flex: 1;
}

/* Checkmark icon for completed episodes */
.episode-checkmark {
    flex-shrink: 0;
    width: 20px;
    height: 20px;
    color: #4CAF50;
    margin-left: auto;
}

/* Sidebar Footer */
.episode-sidebar-footer {
    padding: 1rem 1.25rem;
}

.back-to-all-books-btn {
    width: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    padding: 0.75rem 1rem;
    background: #f5f5f5;
    color: #333;
    border: none;
    border-radius: 8px;
    font-size: 0.95rem;
    font-weight: 500;
    cursor: pointer;
    transition: background-color 0.2s;
}

.back-to-all-books-btn:hover {
    background-color: #e8e8e8;
}

.back-to-all-books-btn:active {
    background-color: #dcdcdc;
}

/* Mobile Overlay */
.episode-menu-overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    z-index: 998;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.episode-menu-overlay.show {
    display: block;
    opacity: 1;
}

/* Hide overlay on desktop */
@media (min-width: 768px) {
    .episode-menu-overlay {
        display: none !important;
    }
}

/* Scrollbar styling for episode list */
.episode-sidebar-scroll::-webkit-scrollbar {
    width: 6px;
}

.episode-sidebar-scroll::-webkit-scrollbar-track {
    background: transparent;
}

.episode-sidebar-scroll::-webkit-scrollbar-thumb {
    background: #d0d0d0;
    border-radius: 3px;
}

.episode-sidebar-scroll::-webkit-scrollbar-thumb:hover {
    background: #b0b0b0;
}
