/* Toolbar Container */
.player-toolbar {
    display: flex;
    align-items: flex-start;
    justify-content: center;
    gap: 32px;
    padding: 24px;
    border-top: 1px solid #eee;
}

/* Toolbar Button */
.toolbar-button {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 48px;
    height: 48px;
    border: none;
    cursor: pointer;
    border-radius: 50%;
    background: #f8f9fa;
    color: #424242;
    transition: all 0.2s ease;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
    -webkit-tap-highlight-color: transparent;
    padding: 12px;
}

/* Toolbar icons */
.toolbar-button .chapters-icon,
.toolbar-button .bookmark-icon,
.toolbar-button .volume-on-icon,
.toolbar-button .volume-off-icon,
.toolbar-button .speed-toggle-icon {
    min-width: 50px;
    min-height: 50px;
    fill: currentColor;
}

.toolbar-button:focus {
    background: #f8f9fa;
    color: #424242;
    outline: none;
}

.toolbar-button:active {
    background: #f8f9fa;
    color: #424242;
    transform: translateY(1px);
    box-shadow: 0 1px 4px rgba(0, 0, 0, 0.1);
}

.toolbar-button:hover {
    background: #e8f0fe;
    color: #1a73e8;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.12);
}

.toolbar-label {
    position: absolute;
    bottom: -24px;
    left: 50%;
    transform: translateX(-50%);
    font-size: 12px;
    font-weight: 500;
    color: #666;
    transition: color 0.2s ease;
    white-space: nowrap;
}

/* Expandable Controls Container */
.expandable-controls > div {
    max-height: 0;
    overflow: hidden;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
    background: #f8f9fa;
    margin: 0 -32px;
    padding: 0 32px;
    border-top: 1px solid transparent;
}

.expandable-controls > div.active {
    max-height: 500px;
    opacity: 1;
    visibility: visible;
    padding: 24px 32px;
    border-top-color: #eee;
}

/* Section Titles */
.control-section-title {
    font-size: 18px;
    font-weight: 500;
    color: #1a1a1a;
    margin: 0 0 16px;
    text-align: center;
}

/* Chapters & Bookmarks Lists */
.chapters-list,
.bookmarks-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
    max-height: 300px;
    overflow-y: auto;
    padding-right: 8px;
}

/* Custom Scrollbar */
.chapters-list::-webkit-scrollbar,
.bookmarks-list::-webkit-scrollbar {
    width: 8px;
}

.chapters-list::-webkit-scrollbar-track,
.bookmarks-list::-webkit-scrollbar-track {
    background: #f1f1f1;
    border-radius: 4px;
}

.chapters-list::-webkit-scrollbar-thumb,
.bookmarks-list::-webkit-scrollbar-thumb {
    background: #c1c1c1;
    border-radius: 4px;
}

.chapters-list::-webkit-scrollbar-thumb:hover,
.bookmarks-list::-webkit-scrollbar-thumb:hover {
    background: #a1a1a1;
}

/* Common styles for expandable item containers */
.chapter-item,
.bookmark-jump {
    display: grid;
    grid-template-columns: 35px 1fr auto;
    align-items: center;
    gap: 12px;
    padding: 12px;
    border: 1px solid #e0e0e0;
    border-radius: 8px;
    background: white;
    cursor: pointer;
    transition: all 0.2s ease;
    color: #424242;
    flex: 1;
}

/* Chapter label styling for desktop */
.chapter-item .chapter-label {
    font-weight: 600;
    color: #1a73e8;
}

/* Common icon styles for expanded areas */
.chapter-item .chapter-icon-wrapper,
.bookmark-jump .bookmark-icon-wrapper {
    flex: 0 0 35px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.chapter-item .chapter-icon-wrapper img,
.bookmark-jump .bookmark-icon-wrapper img {
    width: 32px;
    height: 32px;
    display: block;
}

/* Center content area */
.chapter-item .chapter-content,
.bookmark-jump .bookmark-title {
    text-align: center;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

/* Timestamp styling */
.chapter-item .chapter-timestamp,
.bookmark-jump .bookmark-timestamp {
    padding: 4px 12px;
    background: #e8f0fe;
    color: #1a73e8;
    border-radius: 16px;
    font-size: 0.9em;
    white-space: nowrap;
}

/* Hover states */
.chapter-item:hover,
.bookmark-jump:hover {
    background: #e8f0fe;
    border-color: #1a73e8;
    color: #1a73e8;
}

.chapter-item:hover .chapter-timestamp,
.bookmark-jump:hover .chapter-timestamp {
    background: #1a73e8;
    color: white;
}

/* Active states */
.chapter-item.active,
.bookmark-jump.active {
    background: #e8f0fe;
    border-color: #1a73e8;
    color: #1a73e8;
}

.chapter-item.active .chapter-timestamp,
.bookmark-jump.active .chapter-timestamp {
    background: #1a73e8;
    color: white;
}

/* Volume Controls */
.volume-controls {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 16px;
    padding: 8px 32px;
}

.volume-slider {
    width: 100%;
    height: 4px;
    -webkit-appearance: none;
    background: #e0e0e0;
    border-radius: 2px;
    outline: none;
}

.volume-slider::-webkit-slider-thumb {
    -webkit-appearance: none;
    width: 16px;
    height: 16px;
    background: #1a73e8;
    border-radius: 50%;
    cursor: pointer;
    border: none;
}

.volume-slider::-moz-range-thumb {
    width: 16px;
    height: 16px;
    background: #1a73e8;
    border-radius: 50%;
    cursor: pointer;
    border: none;
}

/* Speed Controls */
.speed-controls {
    padding: 8px 24px;
}

.speed-options {
    display: flex;
    justify-content: center;
    gap: 8px;
    flex-wrap: wrap;
}

.speed-option {
    padding: 8px 16px;
    border: 1px solid #e0e0e0;
    border-radius: 20px;
    background: white;
    color: #424242;
    cursor: pointer;
    transition: all 0.2s ease;
    font-size: 14px;
    font-weight: 500;
    -webkit-tap-highlight-color: transparent;
}

.speed-option:hover {
    border-color: #1a73e8;
    color: #1a73e8;
}

.speed-option.active {
    background: #1a73e8;
    color: white;
    border-color: #1a73e8;
}

/* Bookmark Form */
.bookmark-controls {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.bookmark-form {
    display: flex;
    gap: 12px;
    align-items: center;
    padding-bottom: 12px;
    border-bottom: 1px solid #eee;
    margin-bottom: 8px;
}

.bookmark-title-input {
    flex: 1;
    padding: 12px 16px;
    border: 1px solid #e0e0e0;
    border-radius: 8px;
    font-size: 14px;
    background: white;
    color: #424242;
}

.bookmark-title-input:focus {
    border-color: #1a73e8;
    outline: none;
    box-shadow: 0 0 0 2px rgba(26, 115, 232, 0.2);
}

.bookmark-submit {
    background: #1a73e8;
    border: none;
    border-radius: 50%;
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.2s ease;
    color: white;
    flex-shrink: 0;
}

.bookmark-submit:hover {
    background: #1557b0;
    transform: scale(1.05);
}

/* Bookmark Item */
.bookmark-item {
    display: flex;
    align-items: center;
    gap: 8px;
    width: 100%;
}

/* Remove Bookmark Button */
.remove-bookmark {
    padding: 8px;
    background: none;
    border: none;
    color: #666;
    cursor: pointer;
    border-radius: 4px;
    transition: all 0.2s ease;
    opacity: 0.7;
    display: flex;
    align-items: center;
    justify-content: center;
    -webkit-tap-highlight-color: transparent;
    flex-shrink: 0;
    margin-left: auto;
}

.bookmark-item:hover .remove-bookmark {
    opacity: 1;
}

.remove-bookmark:hover {
    color: #d32f2f;
    background: #fee7e7;
}

/* Mobile Optimization */
@media (max-width: 768px) {
    /* Stack chapter label and title on mobile */
    .chapter-item .chapter-content {
        display: flex;
        flex-direction: column;
        align-items: center;
        text-align: center;
        gap: 4px;
    }
    
    .chapter-item .separator {
        display: none; /* Hide separator on mobile */
    }
    
    .chapter-item .chapter-label {
        font-weight: 600;
        color: #1a73e8;
    }
    
    .chapter-item .chapter-title {
        font-size: 0.9em;
        color: #666;
        white-space: normal; /* Allow wrapping */
        display: -webkit-box;
        -webkit-line-clamp: 2; /* Limit to 2 lines */
        -webkit-box-orient: vertical;
        overflow: hidden;
    }

    /* Make timestamp more compact */
    .chapter-item .chapter-timestamp {
        padding: 2px 8px;
        font-size: 0.85em;
    }

    .player-toolbar {
        padding: 16px;
    }

    .toolbar-button {
        width: 40px;
        height: 40px;
    }

    .toolbar-label {
        font-size: 10px;
        bottom: -20px;
    }

    .expandable-controls > div.active {
        padding: 16px;
    }

    .speed-options {
        gap: 4px;
    }

    .speed-option {
        padding: 6px 12px;
        font-size: 12px;
    }
}