/* ======================================================
   Global Reset & Variables
   ====================================================== */

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

/* CSS Variables for Color Scheme and Font */
:root {
    /* Font */
    --font-family-primary: 'Roboto', sans-serif;
    
    /* Light Mode Colors */
    --color-background: #f4f4f4;            /* Main background */
    --color-content-bg: #f9f9f9;            /* Cards/talk items background */
    --color-text: #333;                   /* Main text color */
    --color-border: #ddd;                 /* Borders */
    --color-shadow: rgba(0, 0, 0, 0.1);     /* Shadow for subtle depth */
    --color-primary: #0F7173;             /* Primary color (buttons, etc.) */
    --color-primary-dark: #1F8189;        /* Hover/active primary */
    --color-accent-claims: #E7ECEF;         /* Accent for claims state */
    --color-hover: #f0f0f0;               /* Hover background */
    --color-muted: #888;                  /* Muted text/timestamps */
    --color-modal-bg: #fefefe;             /* Modal light background */
    --color-highlight: #FBB13C;           /* Highlight color */

    /* Dark Mode Colors */
    --dark-bg: #121212;                  /* Dark overall background */
    --dark-content-bg: #1e1e1e;           /* Dark content areas (video, modal, etc.) */
    --dark-header-bg: #333;              /* Header background in dark mode */
    --dark-speech-bg: #333;              /* Sidebar / speaker list background in dark mode */
    --dark-options-popup-bg: #1e1e1e;     /* Options popup background in dark mode */
    --dark-options-popup-border: #444;    /* Options popup border in dark mode */
    --dark-talk-item-bg: #555;            /* Dark talk items background */
    --dark-talk-item-border: #666;        /* Border for dark talk items */
    --dark-text: #ffffff;                /* Light text on dark backgrounds */
    --dark-button-bg: #333;              /* Dark mode button background */
    --dark-container-bg: #444;           /* Main container dark background */
}


/* ======================================================
   Base Styles
   ====================================================== */

body {
    overflow: hidden;
    background-color: var(--color-background);
    font-family: var(--font-family-primary);
    line-height: 1.6;
    color: var(--color-text);
}

iframe {
    border: none;
}

.container {
    width: 100%;
    height: 100%;
    display: flex;
    flex-direction: column;
    align-items: flex-start;
}


/* ======================================================
   Header Section
   ====================================================== */

.header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.75rem 1.5rem;
    width: 100%;
    background-color: var(--color-background);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
    position: sticky;
    top: 0;
    z-index: 100;
    transition: all 0.3s ease;
}

.header-left {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.header-center {
    flex: 1;
    max-width: 600px;
    margin: 0 1rem;
}

.header-right {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.header input {
    width: 100%;
    padding: 0.75rem 1rem;
    font-size: 0.95rem;
    border: 1px solid var(--color-border);
    border-radius: 8px;
    box-shadow: 0 2px 4px var(--color-shadow);
    transition: all 0.2s ease;
}

.header input:focus {
    border-color: var(--color-primary);
    outline: none;
    box-shadow: 0 0 0 2px rgba(15, 113, 115, 0.2);
}

.logo {
    width: 40px;
    height: 40px;
    color: var(--color-primary);
    transition: transform 0.3s ease, color 0.3s ease;
}

.logo:hover {
    color: var(--color-primary-dark);
    transform: scale(1.05);
}


/* ======================================================
   Button & Dropdown Styles
   ====================================================== */

/* Header Buttons */
.header-button {
    background-color: transparent;
    color: var(--color-primary);
    border: 1px solid var(--color-border);
    padding: 0.5rem;
    border-radius: 8px;
    cursor: pointer;
    font-size: 1.2rem;
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
}

.header-button:hover {
    background-color: var(--color-hover);
    transform: translateY(-2px);
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.1);
}

.header-button:active {
    transform: translateY(0);
}

.header-button.active {
    background-color: var(--color-primary);
    color: white;
}

/* Assign Speakers Button */
.assign-speakers-button {
    background-color: var(--color-primary);
    color: var(--color-background);
    border: none;
    padding: 12px 15px;
    border-radius: 5px;
    cursor: pointer;
    transition: background-color 0.3s;
}

.assign-speakers-button:hover {
    background-color: var(--color-primary-dark);
}

/* Filter Dropdown */
.filter-dropdown {
    position: relative;
}

#common-filter-dropdown {
    position: absolute;
    z-index: 1001;
}

#filterOptions {
    border: 1px solid var(--color-border);
    border-radius: 8px;
    box-shadow: 0 2px 8px var(--color-shadow);
    margin-top: 5px;
    padding: 8px;
    background-color: var(--color-background);
    max-height: 300px;
    overflow-y: auto;
    width: 200px;
    display: none;
}

#filterOptions.active {
    display: block;
}

#filterOptions button {
    display: block;
    width: 100%;
    padding: .5rem;
    border: none;
    border-radius: 5px;
    text-align: left;
    background: none;
    cursor: pointer;
    color: var(--color-text);
    transition: all 0.2s ease;
}

#filterOptions button:hover {
    background-color: var(--color-hover);
}

/* Selected state for filter options */
#filterOptions button.selected {
    background-color: var(--color-primary-dark);
    color: var(--color-background);
}

.dark-mode #filterOptions {
    background-color: var(--dark-options-popup-bg);
    border-color: var(--dark-options-popup-border);
}

.dark-mode #filterOptions button {
    color: var(--dark-text);
}

.dark-mode #filterOptions button:hover {
    background-color: rgba(255, 255, 255, 0.1);
}

@media (max-width: 768px) {
    #filterOptions {
        position: absolute;
        top: 100%;
        left: 0;
        width: 200px;
        max-height: 250px;
        z-index: 1100;
        background-color: var(--color-background);
        border: 1px solid var(--color-border);
        border-radius: 8px;
        box-shadow: 0 2px 8px var(--color-shadow);
    }
    
    .dark-mode #filterOptions {
        background-color: var(--dark-options-popup-bg);
        border-color: var(--dark-options-popup-border);
    }
    
    .filter-dropdown {
        position: relative;
    }
}

/* ======================================================
   Main Container & Sections
   ====================================================== */

/* Main Container */
#main-container {
    width: 100%;
    height: 100%;
    display: flex;
    flex-direction: row;
    align-items: flex-start;
    top: 0;
    background-color: var(--color-background);
    position: relative;
}

.dark-mode #main-container {
    background-color: var(--dark-container-bg);
}

/* Resizable Divider */
.resizable-divider {
    width: 6px;
    height: 90vh;
    background-color: var(--color-border);
    cursor: col-resize;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 30;
    transition: background-color 0.2s ease;
}

.resizable-divider:hover,
.resizable-divider.dragging {
    background-color: var(--color-primary);
}

.divider-handle {
    width: 4px;
    height: 50px;
    background-color: var(--color-primary);
    border-radius: 2px;
    opacity: 0;
    transition: opacity 0.2s ease;
}

.resizable-divider:hover .divider-handle,
.resizable-divider.dragging .divider-handle {
    opacity: 1;
}

.dark-mode .resizable-divider {
    background-color: var(--dark-border);
}

.dark-mode .resizable-divider:hover,
.dark-mode .resizable-divider.dragging {
    background-color: var(--color-primary-dark);
}

.dark-mode .divider-handle {
    background-color: var(--color-primary-dark);
}

/* List Button */
.list-button-container {
    display: flex;
    justify-content: center;
    margin-bottom: 20px;
    width: 100%;
    border-bottom: 1px solid var(--color-border);
    padding: 10px 10px 0;
    overflow: visible;
    background-color: var(--color-background);
    position: sticky;
    top: 0;
    z-index: 20;
}

.dark-mode .list-button-container {
    background-color: var(--dark-header-bg);
    border-bottom-color: var(--dark-talk-item-border);
}

.tab {
    flex: 0 1 250px;
    padding: 12px 0;
    cursor: pointer;
    border: 1px solid var(--color-border);
    border-bottom: none;
    border-radius: 12px 12px 0 0;
    background-color: var(--color-background);
    transition: all 0.3s ease;
    text-align: center;
    margin: 0 10px;
    font-weight: 600;
    font-size: 16px;
    box-shadow: 0 -2px 5px rgba(0, 0, 0, 0.05);
    position: relative;
    overflow: hidden;
    transform-origin: bottom center;
}

.tab:hover {
    background-color: var(--color-hover);
    transform: translateY(-3px);
}

.tab.active {
    background-color: var(--color-primary);
    color: white;
    transform: translateY(-5px);
    box-shadow: 0 -3px 10px rgba(0, 0, 0, 0.1);
    z-index: 1;
}

.tab.active::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
    height: 3px;
    background-color: var(--color-highlight);
}

.tab.inactive {
    background-color: #e0e5e9;
    color: #555;
}

.dark-mode .tab {
    background-color: var(--dark-header-bg);
    border-color: var(--dark-talk-item-border);
}

.dark-mode .tab.active {
    background-color: var(--color-primary-dark);
    color: var(--dark-text);
}

.dark-mode .tab.inactive {
    background-color: #2a2a2a;
    color: #aaa;
}

.hidden {
    display: none !important;
}

#list-button {
    transition: background-color 0.3s, color 0.3s;
    padding: 15px 30px;
    width: 100%;
    border: none;
    border-radius: 8px;
    font-size: 18px;
    cursor: pointer;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.2);
    margin: 10px auto;
    display: block;
    background-color: var(--color-primary);
    color: var(--color-background);
}

#list-button:hover {
    background-color: var(--color-primary-dark);
    color: var(--color-background);
}

#list-button.claims-active {
    background-color: var(--color-accent-claims);
    color: var(--color-background);
}

.dark-mode #list-button.claims-active {
    background-color: var(--color-accent-claims);
    color: var(--color-text);
}

#list-button.transcript-active {
    background-color: var(--color-primary);
    color: var(--color-background);
}

.dark-mode #list-button.transcript-active {
    background-color: var(--color-primary);
    color: var(--color-background);
}

/* Video Section */
#video-section {
    width: 45%;
    height: 90vh;
    display: flex;
    justify-content: center;
    background-color: var(--color-background);
    min-width: 300px; /* Minimum width for video section */
}

#video-section iframe {
    width: 100%;
    height: 90vh;
}

.responsive-video {
    position: relative;
    width: 100%;
    height: 100%;
    overflow: hidden;
}

/* Speaker List Section */
.speaker-list-section {
    width: 55%;
    height: 90vh;
    display: flex;
    flex-direction: column;
    overflow: auto;
    align-items: center;
    position: sticky;
    top: 0;
    background-color: var(--color-background);
    z-index: 10;
    padding: 0 10px;
    scrollbar-width: thin;
    scrollbar-color: var(--color-primary) var(--color-background);
    min-width: 300px; /* Minimum width for speaker list section */
}

.speaker-list-section::-webkit-scrollbar {
    width: 8px;
}

.speaker-list-section::-webkit-scrollbar-track {
    background: var(--color-background);
}

.speaker-list-section::-webkit-scrollbar-thumb {
    background-color: var(--color-primary);
    border-radius: 10px;
    border: 2px solid var(--color-background);
}

.dark-mode .speaker-list-section {
    background-color: var(--dark-header-bg);
    scrollbar-color: var(--color-primary-dark) var(--dark-header-bg);
}

.dark-mode .speaker-list-section::-webkit-scrollbar-track {
    background: var(--dark-header-bg);
}

.dark-mode .speaker-list-section::-webkit-scrollbar-thumb {
    background-color: var(--color-primary-dark);
    border: 2px solid var(--dark-header-bg);
}

/* Speaker List */
.speaker-list {
    width: 100%;
    display: flex;
    overflow-y: auto;
    margin-bottom: 10px;
    padding: 0 5px;
}

.speaker-list ul {
    list-style-type: none;
    padding: 0;
    margin: 0;
    width: 100%;
}

.speaker-list li {
    padding: 10px;
    border-bottom: 1px solid var(--color-border);
}

.speaker-list li:hover {
    background-color: var(--color-hover);
    cursor: pointer;
}

.tool-button {
    background-color: var(--color-primary);
    color: white;
    border: none;
    padding: 10px 15px;
    border-radius: 8px;
    cursor: pointer;
    font-size: 0.9rem;
    width: 100%;
    font-family: var(--font-family-primary);
    transition: all 0.2s ease;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
    display: flex;
    align-items: center;
    justify-content: center;
    text-align: center;
}

.tool-button:hover {
    background-color: var(--color-primary-dark);
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.15);
}

.tool-button:active {
    transform: translateY(0);
}

#extra-tools {
    display: flex;
    flex-direction: row;
    justify-content: space-between;
    width: 90%;
    max-width: 800px;
    margin: 0 auto 15px;
    padding: 15px 0;
    gap: 15px;
}

#extra-tools > div {
    flex: 1;
}

.dark-mode .tool-button {
    background-color: var(--color-primary-dark);
    color: var(--dark-text);
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
}

/* ======================================================
   Talk List & Options Popup
   ====================================================== */

/* Options Button */
.options-button {
    background-color: transparent;
    color: var(--color-primary);
    border: none;
    padding: 5px;
    font-size: 18px;
    font-weight: bold;
    cursor: pointer;
    border-radius: 50%;
    width: 30px;
    height: 30px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background-color 0.2s ease;
}

.options-button:hover {
    background-color: rgba(0, 0, 0, 0.05);
}

.dark-mode .options-button:hover {
    background-color: rgba(255, 255, 255, 0.1);
}

/* Talk Actions */
.talk-actions {
    position: relative;
    display: flex;
    flex-direction: row;
    align-items: center;
    gap: 8px;
    margin-top: 5px;
}

/* Options Popup */
.options-popup {
    position: absolute;
    background-color: var(--color-background);
    border: 1px solid var(--color-border);
    border-radius: 5px;
    box-shadow: 0 2px 4px var(--color-shadow);
    z-index: 1002;
    display: none;
    top: 100%;
    left: 0;
}

.options-popup button {
    display: block;
    width: 100%;
    padding: 10px 15px;
    border: none;
    text-align: left;
    background: none;
    cursor: pointer;
    color: black;
}

.options-popup button:hover {
    background-color: var(--color-hover);
}

/* Talk List */
.talk-list {
    list-style: none;
    padding: 0;
    padding-bottom: 2rem;
    width: 100%;
}

.talk-item {
    display: flex;
    padding: 0.75rem 1rem;
    margin-bottom: 0.5rem;
    background-color: var(--color-content-bg);
    border-radius: 8px;
    box-shadow: 0 1px 3px var(--color-shadow);
    transition: all 0.2s ease;
    position: relative;
    border-left: 3px solid transparent;
}

.talk-item:hover {
    background-color: var(--color-hover);
    transform: translateY(-1px);
    box-shadow: 0 2px 5px var(--color-shadow);
}

/* Style for focused item (keyboard navigation) */
.focused-item {
    border-left: 3px solid var(--color-primary);
    background-color: rgba(15, 113, 115, 0.1);
    box-shadow: 0 2px 8px rgba(15, 113, 115, 0.2);
}

/* Style for current timestamp item (matches video position) */
.current-timestamp-item {
    border-left: 3px solid var(--color-highlight);
    background-color: rgba(251, 177, 60, 0.2);
    box-shadow: 0 2px 8px rgba(251, 177, 60, 0.3);
}

/* When an item is both focused and current timestamp */
.focused-item.current-timestamp-item {
    border-left: 3px solid var(--color-primary);
    background: linear-gradient(90deg, rgba(15, 113, 115, 0.1) 0%, rgba(251, 177, 60, 0.1) 100%);
    box-shadow: 0 2px 8px rgba(15, 113, 115, 0.2), 0 2px 8px rgba(251, 177, 60, 0.2);
}

/* Dark mode styles for highlighted items */
.dark-mode .focused-item {
    background-color: rgba(15, 113, 115, 0.3);
}

.dark-mode .current-timestamp-item {
    background-color: rgba(15, 113, 115, 0.4);
    border: 1px solid var(--color-primary);
    border-left: 6px solid #00BFFF;
    box-shadow: 0 0 10px rgba(0, 191, 255, 0.7);
}

.dark-mode .focused-item.current-timestamp-item {
    background: linear-gradient(90deg, rgba(15, 113, 115, 0.3) 0%, rgba(251, 177, 60, 0.35) 100%);
    border: 1px solid #FFC107;
    border-left: 6px solid #FFC107;
}

.talk-content {
    flex: 1;
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    position: relative;
    overflow: visible;
    max-width: 100%;
}

.talk-text {
    margin-right: 10px;
    flex: 1;
    overflow-wrap: break-word;
    line-height: 1.5;
}

.talk-item .badge {
    display: inline-block;
    min-width: 80px;
    max-width: 120px;
    height: auto;
    font-size: 14px;
    font-weight: bold;
    color: white;
    padding: 5px 10px;
    border-radius: 20px;
    margin-right: 15px;
    margin-bottom: 10px;
    background-color: inherit;
    text-align: center;
    overflow: hidden;
    white-space: nowrap;
    text-overflow: ellipsis;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
    align-self: flex-start;
    flex-shrink: 0;
}

.talk-item .time {
    color: var(--color-muted);
    font-size: 12px;
    margin-left: 10px;
    white-space: nowrap;
}

.talk-item a {
    color: var(--color-primary);
    text-decoration: none;
    font-weight: bold;
    transition: color 0.3s;
    padding: 5px;
}

.talk-item a:hover {
    color: var(--color-primary-dark);
}

/* Close button hover (if applied to a close-button) */
.close-button:hover {
    background-color: red;
}


/* ======================================================
   Dark Mode Overrides
   ====================================================== */

.dark-mode {
    background-color: var(--dark-bg);
    color: var(--dark-text);
}

.dark-mode .header {
    background-color: var(--dark-header-bg);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
}

.dark-mode #list-button {
    background-color: var(--color-primary);
    color: var(--color-background);
}

.dark-mode #video-section {
    background-color: var(--dark-content-bg);
}

.dark-mode .speaker-list li {
    border-bottom: 1px solid #444;
}

.dark-mode .options-button {
    color: #66b3ff;
}

.dark-mode .options-popup {
    background-color: var(--dark-options-popup-bg);
    border: 1px solid var(--dark-options-popup-border);
}

.dark-mode .options-popup button {
    color: var(--dark-text);
}

.dark-mode .talk-item {
    background: var(--dark-talk-item-bg);
    border: 1px solid var(--dark-talk-item-border);
}

.dark-mode .talk-item:hover {
    background: #666;
}

.dark-mode .modal-content {
    background-color: var(--dark-content-bg);
    border-color: var(--dark-talk-item-border);
    color: var(--dark-text);
}

.dark-mode .modal .close {
    color: #ccc;
}

.dark-mode .modal .close:hover {
    color: #fff;
}


/* ======================================================
   Dark Mode Button
   ====================================================== */

#dark-mode-toggle {
    background-color: transparent;
    color: var(--color-primary);
    border: 1px solid var(--color-border);
    padding: 8px;
    border-radius: 8px;
    cursor: pointer;
    font-size: 1.2rem;
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
}

#dark-mode-toggle:hover {
    background-color: var(--color-hover);
    transform: translateY(-2px);
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.1);
}

.dark-mode #dark-mode-toggle {
    color: var(--dark-text);
    border-color: var(--dark-border);
}

.dark-mode #dark-mode-toggle:hover {
    background-color: rgba(255, 255, 255, 0.1);
}

/* Mobile dark mode button */
.dark-mode-button-mobile {
    display: none;
}

@media (max-width: 768px) {
    .dark-mode-button-mobile {
        display: block;
        position: fixed;
        bottom: 20px;
        left: 20px;
        z-index: 99;
    }
    
    .dark-mode-button-mobile button {
        background-color: transparent;
        color: var(--color-primary);
        border: 1px solid var(--color-border);
        width: 50px;
        height: 50px;
        border-radius: 50%;
        box-shadow: 0 2px 5px rgba(0, 0, 0, 0.1);
        cursor: pointer;
        font-size: 1.2rem;
        display: flex;
        align-items: center;
        justify-content: center;
        transition: all 0.2s ease;
    }
    
    .dark-mode-button-mobile button:hover {
        transform: translateY(-2px);
        box-shadow: 0 4px 8px rgba(0, 0, 0, 0.15);
    }
    
    .dark-mode .dark-mode-button-mobile button {
        color: var(--dark-text);
        border-color: var(--dark-border);
        background-color: rgba(51, 51, 51, 0.8);
    }
    
    .dark-mode .dark-mode-button-mobile button:hover {
        background-color: rgba(255, 255, 255, 0.1);
    }
    
    #dark-mode-toggle {
        display: none !important;
    }

    body {
        overflow: visible;
        height: 100vh;
        position: fixed;
        width: 100%;
    }

    .container {
        height: 100vh;
        overflow: hidden;
    }

    .header {
        padding: 0.75rem;
        flex-wrap: wrap;
        position: relative;
        box-shadow: 0 1px 4px rgba(0, 0, 0, 0.1);
    }
    
    .header-left {
        order: 1;
        width: auto;
        margin-right: 15px;
    }
    
    .header-right {
        order: 2;
        width: auto;
    }
    
    .header-center {
        order: 3;
        width: 100%;
        max-width: 100%;
        margin: 0.75rem 0 0 0;
    }

    #main-container {
        flex-direction: column;
        margin-top: 0;
        height: calc(100vh - 130px);
        overflow: hidden;
    }

    .speaker-list-section {
        order: 2;
        width: 100%;
        height: auto;
        max-height: none;
        overflow-y: auto;
        padding: 0 5px;
        flex: 1;
        position: relative;
        min-width: unset;
    }

    .speaker-list {
        padding: 0;
        height: 100%;
        overflow-y: auto;
    }

    #video-section {
        order: 1;
        width: 100%;
        height: 40vh;
        min-height: 40vh;
        max-height: 40vh;
        position: sticky;
        top: 0;
        z-index: 30;
        min-width: unset;
    }
    
    #video-section iframe {
        height: 40vh;
    }

    .help-button-container {
        bottom: 15px;
        right: 15px;
    }
    
    #help-button {
        width: 45px;
        height: 45px;
        font-size: 1.3rem;
    }

    .header-button {
        width: 40px;
        height: 40px;
        font-size: 1.2rem;
    }

    .assign-speakers-button {
        width: auto;
        padding: 0.5rem 0.75rem;
        font-size: 0.9rem;
    }

    /* Collapsible tools section */
    .tools-toggle {
        display: flex !important;
        align-items: center;
        justify-content: center;
        width: 95%;
        margin: 0 auto 10px;
        opacity: 1;
        visibility: visible;
        z-index: 10;
        box-shadow: 0 2px 5px rgba(0, 0, 0, 0.15);
        font-weight: 500;
        position: relative;
    }
    
    .dark-mode .tools-toggle {
        background-color: var(--color-primary-dark);
        color: var(--dark-text);
        box-shadow: 0 2px 5px rgba(0, 0, 0, 0.3);
    }

    #extra-tools {
        width: 95%;
        flex-direction: column;
        gap: 10px;
        margin-bottom: 20px;
        padding: 10px 0;
        max-height: 0;
        overflow: hidden;
        transition: max-height 0.3s ease, opacity 0.3s ease, margin 0.3s ease, padding 0.3s ease;
        opacity: 0;
        margin: 0 auto;
    }
    
    #extra-tools.expanded {
        max-height: 200px;
        opacity: 1;
        margin-bottom: 20px;
        overflow-y: auto;
        padding: 10px 0;
        -webkit-overflow-scrolling: touch;
        scrollbar-width: thin;
    }
    
    #extra-tools.expanded::-webkit-scrollbar {
        width: 4px;
    }
    
    #extra-tools.expanded::-webkit-scrollbar-track {
        background: rgba(0, 0, 0, 0.05);
        border-radius: 10px;
    }
    
    #extra-tools.expanded::-webkit-scrollbar-thumb {
        background-color: var(--color-primary);
        border-radius: 10px;
    }
    
    .dark-mode #extra-tools.expanded::-webkit-scrollbar-thumb {
        background-color: var(--color-primary-dark);
    }
    
    #extra-tools > div {
        width: 100%;
        min-height: 45px;
    }
    
    #extra-tools .tool-button {
        width: 100%;
        padding: 8px 12px;
        font-size: 0.85rem;
        border-radius: 8px;
        margin-bottom: 5px;
        white-space: nowrap;
        overflow: hidden;
        text-overflow: ellipsis;
    }
    
    /* Alternative layout for wider mobile screens */
    @media (min-width: 480px) and (max-width: 768px) {
        #extra-tools.expanded {
            flex-direction: row;
            flex-wrap: wrap;
            justify-content: space-between;
            max-height: none;
            overflow-y: visible;
        }
        
        #extra-tools > div {
            width: 48%;
            min-height: auto;
        }
        
        #extra-tools .tool-button {
            font-size: 0.8rem;
            padding: 8px 10px;
        }
    }

    .talk-content {
        flex-direction: column;
        align-items: flex-start;
        padding: 0;
    }

    .talk-text {
        font-size: 15px;
        margin-bottom: 12px;
        width: 100%;
        line-height: 1.4;
    }

    .talk-actions {
        flex-direction: row;
        align-items: center;
        justify-content: space-between;
        width: 100%;
        margin-top: 8px;
        flex-wrap: wrap;
    }

    .talk-item .time {
        font-size: 12px;
    }

    .talk-item .badge {
        font-size: 13px;
        text-align: center;
        margin: 0 0 12px 0;
        width: auto;
        max-width: 120px;
        padding: 4px 12px;
        border-radius: 15px;
        height: auto;
        min-height: unset;
        display: inline-block;
        align-self: flex-start;
        flex-shrink: 0;
        line-height: 1.2;
    }

    .talk-item {
        flex-direction: column;
        align-items: flex-start;
        padding: 12px;
        margin: 0 5px 15px 5px;
        border-radius: 10px;
        width: calc(100% - 10px);
        box-shadow: 0 2px 6px rgba(0, 0, 0, 0.08);
    }
    
    .talk-item:active {
        background-color: var(--color-hover);
        transform: translateY(0);
    }
    
    .options-popup {
        right: 0;
        left: auto;
        width: 200px;
        border-radius: 8px;
        overflow: hidden;
    }
    
    .options-popup button {
        padding: 12px 15px;
        font-size: 14px;
    }
    
    /* Improve scrolling experience on mobile */
    .speaker-list-section {
        -webkit-overflow-scrolling: touch;
        overflow-y: auto;
        height: calc(60vh - 50px);
    }
    
    /* Add some space at the bottom for better scrolling */
    .speaker-list ul {
        padding-bottom: 80px;
    }

    /* Add touch-friendly styles */
    .tool-button:active {
        background-color: var(--color-primary-dark);
        transform: scale(0.98);
    }

    .list-button-container {
        padding: 10px 5px 0;
        margin-bottom: 15px;
        position: sticky;
        top: 0;
        z-index: 20;
    }
    
    .tab {
        flex: 1;
        padding: 10px 0;
        font-size: 15px;
        border-radius: 10px 10px 0 0;
        margin: 0 5px;
    }
    
    .tab.active {
        transform: translateY(-3px);
    }
    
    .tab:active {
        background-color: var(--color-hover);
    }
}

/* ======================================================
   Help Button
   ====================================================== */

.help-button-container {
    position: fixed;
    bottom: 20px;
    right: 20px;
    z-index: 1500;
}

#help-button {
    background-color: var(--color-primary);
    color: white;
    border: none;
    width: 50px;
    height: 50px;
    border-radius: 50%;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.2);
    cursor: pointer;
    font-size: 1.5rem;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
}

#help-button:hover {
    background-color: var(--color-primary-dark);
    transform: translateY(-3px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
}

.dark-mode #help-button {
    background-color: var(--color-primary-dark);
    color: var(--dark-text);
}

/* ======================================================
   Help Modal Styles
   ====================================================== */

/* Modal base styles */
.modal {
    display: none;
    position: fixed;
    z-index: 2000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    overflow: auto;
    background-color: rgba(0, 0, 0, 0.4);
}

.modal-content {
    background-color: var(--color-modal-bg);
    margin: 10vh auto;
    padding: 20px;
    border: 1px solid var(--color-border);
    border-radius: 8px;
    width: 80%;
    max-width: 800px;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.2);
    position: relative;
}

.modal .close {
    color: #aaa;
    float: right;
    font-size: 28px;
    font-weight: bold;
    cursor: pointer;
    transition: color 0.2s ease;
}

.modal .close:hover {
    color: #555;
}

/* Assign Speakers Modal Styles */
#assignSpeakersModal .modal-content {
    max-width: 600px;
    max-height: 80vh;
    overflow-y: auto;
    padding: 30px;
}

#assignSpeakersModal .modal-header {
    margin-bottom: 20px;
    border-bottom: 1px solid var(--color-border);
    padding-bottom: 10px;
}

#assignSpeakersModal .modal-header h2 {
    color: var(--color-primary);
    margin: 0;
    font-size: 1.5rem;
}

.dark-mode #assignSpeakersModal .modal-header h2 {
    color: var(--color-highlight);
}

#speaker-inputs {
    display: flex;
    flex-direction: column;
    gap: 15px;
    margin-bottom: 20px;
    max-height: 50vh;
    overflow-y: auto;
    padding-right: 10px;
}

.speaker-input-container {
    display: flex;
    align-items: center;
    gap: 15px;
    padding: 10px;
    border-radius: 6px;
    background-color: rgba(0, 0, 0, 0.03);
    transition: all 0.2s ease;
}

.dark-mode .speaker-input-container {
    background-color: rgba(255, 255, 255, 0.05);
}

.speaker-input-container:hover {
    background-color: rgba(0, 0, 0, 0.05);
}

.dark-mode .speaker-input-container:hover {
    background-color: rgba(255, 255, 255, 0.08);
}

.speaker-label {
    flex: 1;
    font-weight: 500;
    color: var(--color-text);
    min-width: 120px;
}

.dark-mode .speaker-label {
    color: var(--dark-text);
}

.speaker-input {
    flex: 2;
    padding: 8px 12px;
    border: 1px solid var(--color-border);
    border-radius: 4px;
    font-size: 0.95rem;
    background-color: var(--color-content-bg);
    color: var(--color-text);
    transition: all 0.2s ease;
}

.dark-mode .speaker-input {
    background-color: var(--dark-button-bg);
    border-color: var(--dark-talk-item-border);
    color: var(--dark-text);
}

.speaker-input:focus {
    border-color: var(--color-primary);
    outline: none;
    box-shadow: 0 0 0 2px rgba(15, 113, 115, 0.2);
}

.dark-mode .speaker-input:focus {
    border-color: var(--color-highlight);
    box-shadow: 0 0 0 2px rgba(251, 177, 60, 0.2);
}

#speaker-form button[type="submit"] {
    background-color: var(--color-primary);
    color: white;
    border: none;
    padding: 10px 20px;
    border-radius: 4px;
    font-size: 1rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
    margin-top: 10px;
}

.speaker-form-actions {
    display: flex;
    gap: 10px;
    margin-top: 20px;
}

.speaker-form-actions button {
    flex: 1;
    background-color: var(--color-primary);
    color: white;
    border: none;
    padding: 10px 20px;
    border-radius: 4px;
    font-size: 1rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
}

.speaker-form-actions button.export-button {
    background-color: #6c757d;
}

.speaker-form-actions button.export-button:hover {
    background-color: #5a6268;
}

.dark-mode .speaker-form-actions button {
    background-color: var(--color-highlight);
    color: #333;
}

.dark-mode .speaker-form-actions button:hover {
    background-color: #e6a00d;
}

.dark-mode .speaker-form-actions button.export-button {
    background-color: #6c757d;
    color: white;
}

.dark-mode .speaker-form-actions button.export-button:hover {
    background-color: #5a6268;
}

#speaker-form button[type="submit"]:hover {
    background-color: var(--color-primary-dark);
}

/* Mobile styles for assign speakers modal */
@media (max-width: 768px) {
    #assignSpeakersModal .modal-content {
        width: 95%;
        padding: 20px;
        margin: 5vh auto;
    }
    
    .speaker-input-container {
    flex-direction: column;
        align-items: flex-start;
        gap: 8px;
    }
    
    .speaker-label {
        width: 100%;
    }
    
    .speaker-input {
        width: 100%;
    }
}

#helpModal .modal-content {
    max-width: 700px;
    max-height: 80vh;
    overflow-y: auto;
    padding: 30px;
}

#helpModal h3 {
    color: var(--color-primary);
    margin-bottom: 15px;
    font-size: 1.5rem;
}

#helpModal h4 {
    color: var(--color-primary-dark);
    margin: 20px 0 10px;
    font-size: 1.2rem;
    border-bottom: 1px solid var(--color-border);
    padding-bottom: 5px;
}

#helpModal p {
    margin-bottom: 15px;
    line-height: 1.6;
}

#helpModal ul {
    margin-left: 20px;
    margin-bottom: 15px;
}

#helpModal li {
    margin-bottom: 8px;
    line-height: 1.4;
}

#helpModal li ul {
    margin-top: 5px;
}

.dark-mode #helpModal h3,
.dark-mode #helpModal h4 {
    color: var(--color-highlight);
}

.dark-mode #helpModal .modal-content {
    color: var(--dark-text);
}

/* Ensure the help modal scrolls properly on mobile */
@media (max-width: 768px) {
    #helpModal .modal-content {
        width: 90%;
        max-height: 80vh;
        margin: 5vh auto;
        padding: 15px;
    }
    
    #helpModal h3 {
        font-size: 1.3rem;
    }
    
    #helpModal h4 {
        font-size: 1.1rem;
    }
    
    /* Ensure modal is above all other elements */
    .modal {
        z-index: 2000;
    }
    
    /* Ensure help button is visible */
    .help-button-container {
        z-index: 1500;
        position: fixed;
        bottom: 15px;
        right: 15px;
    }
}

/* Add this class to body when modal is open */
body.modal-open {
    overflow: hidden;
}

/* Claim Badge Styling */
.claim-badge {
    display: inline-block;
    padding: 3px 8px;
    border-radius: 4px;
    font-size: 0.75rem;
    font-weight: bold;
    color: white;
    margin-right: 8px;
    text-shadow: 0 0 2px rgba(0, 0, 0, 0.5); /* Add text shadow for better readability on light backgrounds */
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.2); /* Add subtle shadow for depth */
}

@media (max-width: 768px) {
    .claim-badge {
        font-size: 11px;
        margin-right: 5px;
    }
}

/* Adjust the talk-actions to accommodate the new badge */
.talk-actions {
    display: flex;
    align-items: center;
    gap: 8px;
}

.dark-mode .header-button {
    background-color: transparent;
    color: var(--dark-text);
    border-color: var(--dark-talk-item-border);
}

.dark-mode .header-button:hover {
    background-color: rgba(255, 255, 255, 0.1);
}

.dark-mode .header-button.active {
    background-color: var(--color-primary-dark);
    color: var(--dark-text);
}

.dark-mode .header input {
    background-color: var(--dark-header-bg);
    color: var(--dark-text);
    border-color: var(--dark-talk-item-border);
}

.dark-mode .header input::placeholder {
    color: rgba(255, 255, 255, 0.6);
}

/* Remove modal backdrop for filters on mobile */
.modal-backdrop {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.5);
    z-index: 1050;
    display: none;
}

.filter-close {
    display: none;
}

@media (max-width: 768px) {
    .filter-close {
        display: none;
    }
}

/* Highlight for search results */
.highlight {
    background-color: var(--color-highlight);
    color: var(--color-text);
    padding: 0 3px;
    border-radius: 3px;
    font-weight: bold;
    box-shadow: 0 0 2px rgba(0, 0, 0, 0.2);
    display: inline-block;
    animation: pulse 1.5s infinite;
}

@keyframes pulse {
    0% {
        box-shadow: 0 0 0 0 rgba(251, 177, 60, 0.4);
    }
    70% {
        box-shadow: 0 0 0 5px rgba(251, 177, 60, 0);
    }
    100% {
        box-shadow: 0 0 0 0 rgba(251, 177, 60, 0);
    }
}

.dark-mode .highlight {
    background-color: var(--color-highlight);
    color: var(--dark-bg);
    box-shadow: 0 0 3px rgba(255, 255, 255, 0.3);
}

/* Tool buttons collapsible container */
.tools-toggle {
    display: none;
    width: 100%;
    padding: 8px 12px;
    background-color: var(--color-primary);
    color: white;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    font-size: 0.9rem;
    margin-bottom: 10px;
    text-align: center;
    transition: all 0.3s ease;
}

.tools-toggle:hover {
    background-color: var(--color-primary-dark);
}

.tools-toggle i {
    margin-left: 5px;
    transition: transform 0.3s ease;
}

.tools-toggle.collapsed i {
    transform: rotate(180deg);
}

.dark-mode .tools-toggle {
    background-color: var(--color-primary-dark);
}

/* ======================================================
   Keyboard Shortcuts Styles
   ====================================================== */

/* Focused item styles */
.focused-item {
    border-left: 4px solid var(--color-primary) !important;
    background-color: rgba(15, 113, 115, 0.05) !important;
    position: relative;
    transition: all 0.2s ease;
}

.dark-mode .focused-item {
    background-color: rgba(251, 177, 60, 0.1) !important;
    border-left: 4px solid var(--color-highlight) !important;
}

/* Video focus indicator */
.video-focused {
    outline: 3px solid var(--color-primary);
    outline-offset: 3px;
    border-radius: 8px;
    transition: all 0.2s ease;
}

.dark-mode .video-focused {
    outline-color: var(--color-highlight);
}

/* Keyboard shortcuts modal */
#keyboardShortcutsModal .modal-content {
    max-width: 800px;
    max-height: 90vh;
    overflow-y: auto;
}

.keyboard-shortcuts-container {
    display: flex;
    flex-wrap: wrap;
    gap: 20px;
    padding: 10px 0;
}

.shortcuts-column {
    flex: 1;
    min-width: 300px;
}

.shortcuts-column h3 {
    color: var(--color-primary);
    margin: 20px 0 10px;
    font-size: 1.2rem;
    border-bottom: 1px solid var(--color-border);
    padding-bottom: 5px;
}

.dark-mode .shortcuts-column h3 {
    color: var(--color-highlight);
    border-bottom-color: var(--dark-talk-item-border);
}

.shortcut-item {
    display: flex;
    align-items: center;
    margin-bottom: 8px;
    padding: 5px 0;
}

.shortcut-item .key {
    background-color: #f5f5f5;
    border: 1px solid #ddd;
    border-radius: 4px;
    padding: 2px 8px;
    margin-right: 10px;
    font-family: monospace;
    font-size: 0.9rem;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.1);
    min-width: 20px;
    text-align: center;
    display: inline-block;
}

.dark-mode .shortcut-item .key {
    background-color: #444;
    border-color: #555;
    color: #fff;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.3);
}

.shortcut-item .description {
    font-size: 0.95rem;
    color: var(--color-text);
}

.dark-mode .shortcut-item .description {
    color: var(--dark-text);
}

/* Responsive styles for keyboard shortcuts modal */
@media (max-width: 768px) {
    .keyboard-shortcuts-container {
        flex-direction: column;
    }
    
    .shortcuts-column {
        min-width: 100%;
    }
    
    #keyboardShortcutsModal .modal-content {
        width: 95%;
        max-height: 80vh;
    }
}

/* ======================================================
   Focus Notification
   ====================================================== */

.focus-notification {
    position: fixed;
    bottom: 20px;
    left: 50%;
    transform: translateX(-50%);
    background-color: var(--color-primary);
    color: white;
    padding: 10px 20px;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 500;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.2);
    z-index: 1000;
    opacity: 1;
    transition: opacity 0.5s ease;
    pointer-events: none;
}

.dark-mode .focus-notification {
    background-color: var(--color-highlight);
    color: #333;
}

.focus-notification.fade-out {
    opacity: 0;
}

@media (max-width: 768px) {
    .focus-notification {
        bottom: 60px;
        font-size: 12px;
        padding: 8px 16px;
        max-width: 80%;
        text-align: center;
    }
}

/* ======================================================
   Modal Styles
   ====================================================== */

/* Keyboard Shortcuts in Help Modal */
.keyboard-shortcuts-container {
    display: flex;
    flex-wrap: wrap;
    gap: 1.5rem;
    margin-top: 0.5rem;
}

.shortcuts-column {
    flex: 1;
    min-width: 250px;
}

.shortcuts-column h5 {
    margin-top: 1rem;
    margin-bottom: 0.5rem;
    color: var(--color-primary);
    font-size: 1rem;
}

.shortcuts-column ul {
    list-style-type: none;
    padding-left: 0.5rem;
}

.shortcuts-column li {
    margin-bottom: 0.5rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.shortcuts-column strong {
    display: inline-block;
    padding: 0.2rem 0.5rem;
    background-color: var(--color-content-bg);
    border: 1px solid var(--color-border);
    border-radius: 4px;
    font-family: monospace;
    font-size: 0.9rem;
    min-width: 1.5rem;
    text-align: center;
}

/* Dark mode adjustments for keyboard shortcuts */
.dark-mode .shortcuts-column h5 {
    color: var(--color-highlight);
}

.dark-mode .shortcuts-column strong {
    background-color: var(--dark-button-bg);
    border-color: var(--dark-talk-item-border);
    color: var(--dark-text);
}

/* Mobile adjustments for keyboard shortcuts */
@media (max-width: 768px) {
    .keyboard-shortcuts-container {
        flex-direction: column;
        gap: 0.5rem;
    }
    
    .shortcuts-column {
        min-width: 100%;
    }
}

/* ======================================================
   Resizable Divider Responsive Styles
   ====================================================== */

/* Styles for narrow speaker list view */
.speaker-list-section.narrow-view .talk-item {
    padding: 0.5rem;
}

.speaker-list-section.narrow-view .talk-item .badge {
    min-width: 60px;
    max-width: 80px;
    font-size: 12px;
    padding: 3px 6px;
    margin-right: 8px;
}

.speaker-list-section.narrow-view .talk-text {
    font-size: 14px;
    line-height: 1.4;
}

.speaker-list-section.narrow-view .talk-actions {
    flex-wrap: wrap;
    gap: 4px;
}

.speaker-list-section.narrow-view .options-button {
    padding: 3px;
    width: 24px;
    height: 24px;
}

.speaker-list-section.narrow-view .claim-badge {
    font-size: 10px;
    padding: 2px 5px;
}

/* Styles for extra narrow speaker list view */
.speaker-list-section.extra-narrow-view .talk-item {
    flex-direction: column;
    padding: 0.5rem;
}

.speaker-list-section.extra-narrow-view .talk-content {
    width: 100%;
}

.speaker-list-section.extra-narrow-view .talk-item .badge {
    margin-bottom: 8px;
    align-self: flex-start;
}

.speaker-list-section.extra-narrow-view .talk-text {
    font-size: 13px;
    line-height: 1.3;
}

.speaker-list-section.extra-narrow-view .talk-actions {
    justify-content: flex-start;
    margin-top: 5px;
}

.speaker-list-section.extra-narrow-view .options-popup {
    right: 0;
    left: auto;
}

.speaker-list-section.extra-narrow-view .options-popup button {
    padding: 8px 12px;
    font-size: 13px;
}

/* Adjust tool buttons in narrow view */
.speaker-list-section.narrow-view #extra-tools {
    flex-direction: column;
    gap: 8px;
}

.speaker-list-section.narrow-view .tool-button {
    font-size: 12px;
    padding: 8px 10px;
}

/* Adjust tabs in narrow view */
.speaker-list-section.narrow-view .tab {
    padding: 8px 0;
    font-size: 14px;
    margin: 0 5px;
}

/* Dark mode adjustments for narrow views */
.dark-mode .speaker-list-section.narrow-view .talk-item,
.dark-mode .speaker-list-section.extra-narrow-view .talk-item {
    background: var(--dark-talk-item-bg);
}

.resume-notification {
    position: fixed;
    bottom: 20px;
    left: 50%;
    transform: translateX(-50%);
    background-color: var(--color-primary);
    color: white;
    padding: 15px 20px;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 500;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.2);
    z-index: 1000;
    opacity: 1;
    transition: opacity 0.5s ease;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 10px;
}

.dark-mode .resume-notification {
    background-color: var(--color-highlight);
    color: #333;
}

.resume-message {
    margin-bottom: 5px;
}

.resume-buttons {
    display: flex;
    gap: 10px;
}

.resume-button {
    background-color: rgba(255, 255, 255, 0.2);
    border: none;
    color: white;
    padding: 5px 15px;
    border-radius: 4px;
    cursor: pointer;
    font-weight: 500;
    transition: background-color 0.2s ease;
}

.dark-mode .resume-button {
    background-color: rgba(0, 0, 0, 0.2);
    color: #333;
}

.resume-button:hover {
    background-color: rgba(255, 255, 255, 0.3);
}

.dark-mode .resume-button:hover {
    background-color: rgba(0, 0, 0, 0.3);
}

@media (max-width: 768px) {
    .resume-notification {
        bottom: 60px;
        width: 90%;
        max-width: 300px;
    }
}