/* Video Moments Timeline */
.video-moments-container {
    position: fixed;
    bottom: 60px;
    left: 50%;
    transform: translateX(-50%);
    background: rgba(0, 0, 0, 0.8);
    backdrop-filter: blur(10px);
    border-radius: 12px;
    padding: 15px 20px;
    z-index: 1000;
    max-width: 90%;
    width: 800px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.3);
    transition: all 0.3s ease;
    opacity: 0;
    visibility: hidden;
}

.video-moments-container.visible {
    opacity: 1;
    visibility: visible;
}

.video-moments-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 12px;
    color: #00ff4c;
    font-family: 'Courier New', monospace;
    font-size: 14px;
}

.video-moments-close {
    background: none;
    border: none;
    color: #00ff4c;
    font-size: 18px;
    cursor: pointer;
    padding: 5px;
    line-height: 1;
}

.video-moments-scroll {
    display: flex;
    overflow-x: auto;
    padding: 5px 0;
    scrollbar-width: thin;
    scrollbar-color: #00ff4c rgba(255, 255, 255, 0.1);
}

.video-moments-scroll::-webkit-scrollbar {
    height: 4px;
}

.video-moments-scroll::-webkit-scrollbar-thumb {
    background-color: #00ff4c;
    border-radius: 4px;
}

.video-moment {
    flex: 0 0 auto;
    margin-right: 15px;
    text-align: center;
    cursor: pointer;
    transition: all 0.2s ease;
    padding: 8px 12px;
    border-radius: 6px;
    background: rgba(0, 255, 76, 0.1);
    border: 1px solid rgba(0, 255, 76, 0.3);
    white-space: nowrap;
}

.video-moment:last-child {
    margin-right: 0;
}

.video-moment:hover {
    background: rgba(0, 255, 76, 0.2);
    transform: translateY(-2px);
}

.video-moment-time {
    display: block;
    font-size: 12px;
    color: #00ff4c;
    margin-bottom: 4px;
    font-family: 'Courier New', monospace;
}

.video-moment-label {
    font-size: 13px;
    color: #fff;
    display: block;
}

.video-moments-toggle {
    position: fixed;
    bottom: 20px;
    left: 50%;
    transform: translateX(-50%);
    background: rgba(0, 0, 0, 0.8);
    color: #00ff4c;
    border: 1px solid #00ff4c;
    border-radius: 20px;
    padding: 8px 20px;
    font-family: 'Courier New', monospace;
    font-size: 14px;
    cursor: pointer;
    z-index: 1001;
    display: flex;
    align-items: center;
    transition: all 0.3s ease;
}

.video-moments-toggle:hover {
    background: rgba(0, 255, 76, 0.2);
}

.video-moments-toggle::before {
    content: '⏱️';
    margin-right: 8px;
    font-size: 16px;
}

/* Responsive adjustments */
@media (max-width: 768px) {
    .video-moments-container {
        width: 95%;
        padding: 12px 15px;
    }
    
    .video-moment {
        padding: 6px 10px;
        margin-right: 10px;
    }
    
    .video-moment-time {
        font-size: 11px;
    }
    
    .video-moment-label {
        font-size: 12px;
    }
    
    .chapters-btn-container {
        margin-bottom: 5px;
    }
}

/* Animation */
@keyframes fadeIn {
    from { opacity: 0; transform: translateY(10px); }
    to { opacity: 1; transform: translateY(0); }
}

.video-moments-container.visible {
    animation: fadeIn 0.3s ease-out forwards;
}

/* 章节按钮容器 */
.chapters-btn-container {
    position: relative;
    text-align: right;
    margin-bottom: 8px;
    z-index: 10;
}

/* Top-right chapters button */
.chapters-toggle-btn {
    position: relative;
    display: inline-flex;
    background: rgba(0, 0, 0, 0.7);
    color: #00ff4c;
    border: 1px solid #00ff4c;
    border-radius: 30px;
    padding: 8px 16px;
    font-size: 14px;
    cursor: pointer;
    align-items: center;
    gap: 8px;
    transition: all 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    backdrop-filter: blur(5px);
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.3), 0 0 10px rgba(0, 255, 76, 0.2);
}

.chapters-toggle-btn:hover {
    background: rgba(0, 255, 76, 0.15);
    transform: translateY(-2px) scale(1.05);
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.4), 0 0 15px rgba(0, 255, 76, 0.3);
}

.chapters-toggle-btn:active {
    transform: translateY(1px);
}

.chapters-toggle-btn i {
    font-size: 16px;
    text-shadow: 0 0 8px rgba(0, 255, 76, 0.6);
}

.chapters-toggle-btn span {
    font-family: 'Courier New', monospace;
    font-weight: bold;
    letter-spacing: 0.5px;
}

/* Bottom-right floating button */
.floating-moments-btn {
    position: absolute;
    bottom: 20px;
    right: 20px;
    background: rgba(0, 0, 0, 0.7);
    color: #00ff4c;
    border: 1px solid #00ff4c;
    border-radius: 30px;
    padding: 10px 18px;
    font-size: 15px;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 8px;
    z-index: 100;
    transition: all 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    backdrop-filter: blur(5px);
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.3), 0 0 10px rgba(0, 255, 76, 0.2);
}

.floating-moments-btn:hover {
    background: rgba(0, 255, 76, 0.15);
    transform: translateY(-3px) scale(1.05);
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.4), 0 0 15px rgba(0, 255, 76, 0.3);
}

.floating-moments-btn:active {
    transform: translateY(1px);
}

.floating-moments-btn i {
    font-size: 18px;
    text-shadow: 0 0 8px rgba(0, 255, 76, 0.6);
}

.floating-moments-btn span {
    font-family: 'Courier New', monospace;
    font-weight: bold;
    letter-spacing: 0.5px;
}

/* Video chapters overlay */
.video-chapters-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.85);
    display: none;
    justify-content: center;
    align-items: center;
    z-index: 200;
    backdrop-filter: blur(8px);
    opacity: 0;
    transition: opacity 0.3s ease;
}

.video-chapters-overlay.active {
    display: flex;
    opacity: 1;
    animation: fadeInOverlay 0.3s forwards;
}

@keyframes fadeInOverlay {
    from { opacity: 0; }
    to { opacity: 1; }
}

.overlay-content {
    width: 90%;
    max-width: 700px;
    max-height: 90%;
    background: rgba(15, 15, 15, 0.95);
    border-radius: 12px;
    border: 2px solid rgba(0, 255, 76, 0.3);
    display: flex;
    flex-direction: column;
    overflow: hidden;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.5), 0 0 20px rgba(0, 255, 76, 0.2);
    animation: scaleIn 0.3s forwards;
    transform: scale(0.95);
}

@keyframes scaleIn {
    from { transform: scale(0.95); }
    to { transform: scale(1); }
}

.overlay-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 18px 25px;
    background: rgba(0, 255, 76, 0.08);
    border-bottom: 1px solid rgba(0, 255, 76, 0.3);
}

.overlay-header h3 {
    color: #00ff4c;
    margin: 0;
    font-family: 'Courier New', monospace;
    font-size: 1.4rem;
    font-weight: bold;
    text-transform: uppercase;
    letter-spacing: 1px;
    text-shadow: 0 0 10px rgba(0, 255, 76, 0.4);
}

.overlay-close-btn {
    background: transparent;
    border: none;
    color: #00ff4c;
    font-size: 22px;
    cursor: pointer;
    transition: all 0.3s ease;
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
}

.overlay-close-btn:hover {
    background: rgba(0, 255, 76, 0.15);
    transform: rotate(90deg);
}

.overlay-body {
    padding: 20px;
    overflow-y: auto;
    max-height: 70vh;
    scrollbar-width: thin;
    scrollbar-color: #00ff4c rgba(0, 0, 0, 0.3);
}

/* Custom scrollbar */
.overlay-body::-webkit-scrollbar {
    width: 8px;
}

.overlay-body::-webkit-scrollbar-track {
    background: rgba(0, 0, 0, 0.3);
    border-radius: 10px;
}

.overlay-body::-webkit-scrollbar-thumb {
    background: rgba(0, 255, 76, 0.5);
    border-radius: 10px;
}

.chapter-list {
    list-style: none;
    padding: 0;
    margin: 0;
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 15px;
}

.chapter-list li {
    margin: 0;
}

.chapter-link {
    display: flex;
    align-items: center;
    padding: 15px;
    background: rgba(0, 255, 76, 0.05);
    border-left: 3px solid #00ff4c;
    border-radius: 6px;
    transition: all 0.3s ease;
    text-decoration: none;
    color: #e0e0e0;
    position: relative;
    overflow: hidden;
}

.chapter-link::before {
    content: "";
    position: absolute;
    left: 0;
    top: 0;
    width: 5px;
    height: 100%;
    background: #00ff4c;
    transform: scaleY(0);
    transform-origin: bottom;
    transition: transform 0.3s ease;
}

.chapter-link:hover {
    background: rgba(0, 255, 76, 0.15);
    transform: translateX(5px);
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.3);
}

.chapter-link:hover::before {
    transform: scaleY(1);
}

.chapter-time {
    display: inline-block;
    min-width: 70px;
    font-family: 'Courier New', monospace;
    color: #00ff4c;
    margin-right: 15px;
    font-weight: bold;
    font-size: 1.1rem;
}

/* 移动端优化 */
@media (max-width: 768px) {
    .chapters-toggle-btn,
    .floating-moments-btn {
        padding: 6px 12px;
        font-size: 13px;
    }
    
    .chapters-btn-container {
        margin-bottom: 5px;
    }
    
    .chapters-toggle-btn i,
    .floating-moments-btn i {
        font-size: 15px;
    }
    
    .chapters-toggle-btn span,
    .floating-moments-btn span {
        font-size: 12px;
    }
    
    .overlay-content {
        padding: 15px;
        width: 100%;
        height: 90%;
        max-height: 90%;
        overflow-y: auto;
    }
    
    .overlay-header {
        margin-bottom: 15px;
    }
    
    .chapter-link {
        padding: 8px 10px;
        font-size: 13px;
        display: flex;
        flex-direction: column;
        align-items: center;
        text-align: center;
        height: 100%;
    }
    
    .chapter-time {
        margin-bottom: 8px;
    }
    
    .chapter-label {
        font-size: 12px;
        line-height: 1.3;
    }
    
    /* Make overlay fullscreen on mobile */
    .video-chapters-overlay.active {
        position: fixed;
        top: 0;
        left: 0;
        width: 100%;
        height: 100%;
        z-index: 9999;
    }
}
