html {
    width: 100%;
    height: 100%;
}

body {
    width: 100%;
    height: 100%;
    margin: 0;
    font-family: Arial, sans-serif;
    background-color: #ffffff;
    overflow: hidden;
}

#page_wrapper {
    display: flex;
    flex-direction: column;
    width: 100%;
    height: 100%;
    overflow: hidden;
}

#player_wrapper {
    position: relative;
    width: 100%;
    aspect-ratio: 16/9;
    box-sizing: border-box;
}

#player_wrapper video {
    width: 100%;
    height: 100%;
    object-fit: contain;
    display: block;
}

#chapters_container {
    width: 100%;
    padding: 20px;
    box-sizing: border-box;
    overflow-y: auto;
    flex: 1;
}

#video_section {
    display: flex;
    flex-direction: column;
}

/* Landscape orientation - chapters on the right */
@media (orientation: landscape) and (min-width: 768px) {
    #page_wrapper {
        flex-direction: row;
        gap: 20px;
        padding: 20px;
    }

    #video_section {
        flex: 2;
        display: flex;
        flex-direction: column;
    }

    #player_wrapper {
        /* flex: 1; */
        height: auto;
    }

    #skip_controls {
        flex-shrink: 0;
        padding: 15px 20px;
        background-color: #f5f5f5;
        border-bottom: 1px solid #e0e0e0;
    }

    #chapters_container {
        flex: 1;
        width: auto;
        padding: 0;
        max-height: 100%;
        overflow-y: auto;
    }
}

#chapters_list {
    list-style: none;
    padding: 0;
    margin: 0;
}

.chapter_item {
    padding: 12px 16px;
    margin-bottom: 8px;
    border-radius: 4px;
    cursor: pointer;
    transition: background-color 0.2s;
    display: flex;
    align-items: center;
    gap: 12px;
}

.chapter_item.topic {
    background-color: #e3f2fd;
    border-left: 4px solid #1976d2;
    font-weight: 600;
    color: #1565c0;
    margin-bottom: 0;
    border-radius: 4px 4px 0 0;
}

.chapter_item.topic.collapsed {
    border-radius: 4px;
    margin-bottom: 8px;
}

.chapter_item.speech {
    background-color: #f5f5f5;
    border-left: 4px solid #757575;
    color: #424242;
    margin-left: 20px;
    margin-bottom: 4px;
}

.chapter_item.speech:last-child {
    margin-bottom: 12px;
    border-radius: 0 0 4px 4px;
}

.chapter_item:hover {
    background-color: #bbdefb;
}

.chapter_item.speech:hover {
    background-color: #e0e0e0;
}

.chapter_timestamp {
    font-family: 'Courier New', monospace;
    font-size: 14px;
    min-width: 60px;
    opacity: 0.7;
}

.chapter_title {
    flex: 1;
}

.speech_count {
    background-color: rgba(25, 118, 210, 0.2);
    padding: 2px 8px;
    border-radius: 12px;
    font-size: 12px;
    font-weight: normal;
    display: flex;
    align-items: center;
    gap: 4px;
}

.expand_icon {
    width: 20px;
    height: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: transform 0.2s;
    font-size: 16px;
}

.expand_icon.expanded {
    transform: rotate(90deg);
}

.speeches_container {
    display: none;
}

.speeches_container.expanded {
    display: block;
}

#skip_controls {
    display: flex;
    justify-content: center;
    gap: 20px;
    padding: 15px 20px;
    background-color: #f5f5f5;
    border-bottom: 1px solid #e0e0e0;
}

.skip_btn {
    background-color: #ffffff;
    color: #424242;
    border: 1px solid #e0e0e0;
    border-radius: 8px;
    padding: 10px 16px;
    display: flex;
    align-items: center;
    gap: 8px;
    cursor: pointer;
    transition: all 0.2s;
    font-size: 14px;
    font-weight: 500;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.skip_btn:hover {
    background-color: #f0f0f0;
    border-color: #bdbdbd;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.15);
}

.skip_btn:active {
    transform: translateY(1px);
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.1);
}

.skip_btn .material-icons {
    font-size: 20px;
    color: #1976d2;
}

.skip_label {
    color: #424242;
    font-size: 14px;
}

/* Skip controls positioning in camera-only layout */
.camera-only-layout #skip_controls {
    flex-shrink: 0;
    order: 2;
}

/* Camera-only layout styles */
.camera-only-layout {
    width: 100%;
    height: 100vh;
    overflow: hidden;
    box-sizing: border-box;
}

.camera-only-layout #video_section {
    width: 100%;
    height: 100%;
    display: flex;
    flex-direction: column;
}

.camera-only-layout #player_wrapper {
    position: relative;
    width: 100%;
    aspect-ratio: 16/9;
    max-height: calc(100vh - 60px);
    box-sizing: border-box;
}

.camera-only-layout #player_wrapper video {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
    position: absolute;
    top: 0;
    left: 0;
}

/* Responsive adjustments for camera-only layout */
/* Mobile portrait adjustments */
@media (orientation: portrait) {
    .camera-only-layout #player_wrapper {
        aspect-ratio: 16/9;
        max-height: 56.25vw; /* 16:9 aspect ratio based on width */
    }
}

/* Landscape and desktop adjustments */
@media (orientation: landscape) and (min-width: 768px) {
    .camera-only-layout {
        padding: 0;
    }
    
    .camera-only-layout #player_wrapper {
        aspect-ratio: 16/9;
        max-height: calc(100vh - 80px);
        width: 100%;
    }
}