/* Basic Body and Layout */
body {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
    margin: 0;
    padding: 0;
    background-color: #f4f4f4;
    color: #333;
    display: flex;
    flex-direction: column;
    height: 100vh; /* Full viewport height */
    overflow: hidden; /* No main scrollbar */
}

#main-content {
    width: 100%;
    max-width: 1400px;
    margin: 0 auto;
    padding: 1rem;
    flex-grow: 1; /* Allows this container to fill available space */
    display: flex;
    flex-direction: column;
    overflow-y: auto; /* In case content overflows on smaller viewports */
}

#content-container {
    display: flex;
    gap: 1.5rem;
    margin-top: 1.5rem;
    flex-grow: 1;
    overflow-y: hidden;
}

#transcript-pane {
    width: 65%;
    display: flex;
    flex-direction: column;
    height: 100%;
    overflow: hidden;          /* prevent whole pane from scrolling */
}

#transcript-container {
    flex: 1 1 auto;
    overflow-y: auto;          /* make only transcript text scroll */
}


#meeting-list-container, #agenda-display {
    overflow-y: auto;
    max-height: 75vh;
    background: #fff;
    padding: 1rem;
    border-radius: 8px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

#meeting-list-container {
    width: 40%;
}

#agenda-display {
    width: 60%;
}

/* Media Query for smaller screens */
@media (max-width: 768px) {
    body {
        height: auto;
        overflow: auto; /* Re-enable scrolling for the whole page */
    }

    #content-container {
        flex-direction: column;
        overflow: visible;
    }

    #left-pane, #transcript-pane {
        width: 100%;
        max-height: none; /* Remove height constraints */
    }
}


#background-container {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: -1;
    background-image: url('background.png');
    background-size: cover;
    background-position: center;
    opacity: 0.1;
}



header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1rem 0;
    border-bottom: 1px solid #ddd;
}

#viewer-menu {
    display: flex;
    gap: 0.5rem;
}

#viewer-menu button {
    background-color: #005a9c;
    color: white;
    border: none;
    padding: 0.6rem 1rem;
    border-radius: 5px;
    cursor: pointer;
    font-size: 0.9rem;
}

#viewer-menu button:hover {
    background-color: #00487a;
}

header h1 {
    margin: 0;
    font-size: 1.8rem;
    color: #005a9c;
}

.page-header h1 a {
    color: inherit;
    text-decoration: none;
}

#main-content h2 {
    font-weight: normal;
    color: #333;
}

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



#navigation-pane {
    width: 40%;
    background: #fff;
    padding: 1rem;
    border-radius: 8px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
    max-height: 75vh;
    overflow-y: auto;
}

#display-pane {
    width: 60%;
    background: #fff;
    padding: 1.5rem;
    border-radius: 8px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

/* Navigation Tree Styles */
.nav-body, .nav-subcommittee, .nav-meeting {
    margin-left: 1rem;
}

.nav-header {
    cursor: pointer;
    font-weight: bold;
    padding: 0 0.5rem;
    position: relative;
}

.nav-header h3 {
    margin: 0;
    padding: 0.5rem;
    font-size: 1rem;
}

.nav-header::before {
    content: '►'; /* Collapsed icon */
    position: absolute;
    left: -10px;
    font-size: 0.8em;
    transition: transform 0.2s;
}

.nav-header.expanded::before {
    transform: rotate(90deg);
}

.nav-items {
    display: none; /* Hidden by default */
    padding-left: 1rem;
    border-left: 1px solid #eee;
}

.nav-meeting {
    cursor: pointer;
    padding: 0.4rem;
    border-radius: 4px;
    margin-left: -0.4rem; /* Align text with parent */
}

.nav-meeting:hover {
    background-color: #f0f0f0;
}

/* Display Pane Styles */
.welcome-message {
    display: flex;
    justify-content: center;
    align-items: center;
    height: 100%;
    text-align: center;
    color: #777;
}

#summary-content h3 {
    margin-top: 0;
}

#summary-content p {
    white-space: pre-wrap; /* Respects newlines in the summary text */
}

.links-container {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: 1.5rem;
    border-top: 1px solid #eee;
    padding-top: 1rem;
}

.info-link {
    display: inline-block;
    font-weight: bold;
    text-decoration: none;
    color: #005a9c;
    padding: 0.5rem 1rem;
    border: 1px solid #005a9c;
    border-radius: 5px;
    transition: background-color 0.2s, color 0.2s;
}

.info-link:hover {
    background-color: #005a9c;
    color: #fff;
}

.transcript-link {
    background-color: #005a9c;
    color: #fff;
}

.transcript-link:hover {
    background-color: #00487a;
}


/* Search Box */
#search-container form {
    display: flex;
    border: 1px solid #ccc;
    border-radius: 20px;
    overflow: hidden;
}

#search-box {
    border: none;
    padding: 0.5rem 1rem;
    outline: none;
}

#search-button {
    background: #005a9c;
    border: none;
    cursor: pointer;
    padding: 0.5rem;
}

#search-button img {
    height: 16px;
    width: 16px;
    filter: invert(1);
}


/* Modal Styles */
.modal {
    position: fixed;
    z-index: 100;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    overflow: auto;
    background-color: rgba(0,0,0,0.5);
}

.modal-content {
    background-color: #fefefe;
    margin: 15% auto;
    padding: 20px;
    border: 1px solid #888;
    width: 80%;
    max-width: 600px;
    border-radius: 8px;
    position: relative;
}

.close-button {
    color: #aaa;
    position: absolute;
    top: 10px;
    right: 20px;
    font-size: 28px;
    font-weight: bold;
    cursor: pointer;
}

.modal-footer {
    margin-top: 1rem;
    text-align: right;
}

/* Share Modal Specifics */
#share-buttons {
    margin-top: 1rem;
    display: flex;
    gap: 0.5rem;
}

#share-buttons button {
    padding: 0.5rem 1rem;
    cursor: pointer;
}

/* Link-styled button */
.link-button {
    background: none;
    border: none;
    color: #005a9c;
    text-decoration: underline;
    cursor: pointer;
    padding: 0;
    font-size: inherit;
    font-family: inherit;
}

.link-button:hover {
    color: #00487a;
}

/* About Modal Specifics */
#about-modal-content h1 {
    margin-top: 0;
}

/* Standard Button Style */
.standard-button {
    background-color: #005a9c;
    color: white;
    border: none;
    padding: 0.6rem 1rem;
    border-radius: 5px;
    cursor: pointer;
    font-size: 0.9rem;
    text-decoration: none;
}

.standard-button:hover {
    background-color: #00487a;
}

/* Page Footer */
.page-footer {
    text-align: center;
    padding: 2rem 0;
    margin-top: 2rem;
    border-top: 1px solid #ddd;
}

/* Viewer-specific layout */
#left-pane { 
    width: 35%; 
    display: flex;
    flex-direction: column;
    max-height: 100%; /* Ensure it doesn't overflow the content container */
}
#agenda { 
    border: 1px solid #ddd; 
    padding: 0 1rem 1rem 1rem; 
    border-radius: 8px; 
    margin-bottom: 1rem;
    flex-grow: 1;
    flex-shrink: 1;
    overflow-y: auto; /* Allow agenda to scroll if it's too long */
}
#video-pane { 
    flex-shrink: 0; /* Prevent the video player from shrinking */
}
#player-wrapper { padding-top: 56.25%; background-color: #000; border-radius: 8px; position: relative; }
#videoElement { position: absolute; top: 0; left: 0; width: 100%; height: 100%; }
#text-container { white-space: pre-wrap; }
#text-container p { margin: 0; padding: 0; }
.control-button { margin: 5px; padding: 10px 15px; border: 1px solid #005a9c; background-color: #f0f8ff; color: #005a9c; border-radius: 5px; cursor: pointer; }
.control-button:disabled { opacity: 0.5; cursor: not-allowed; }
#agenda ul { list-style: none; padding-left: 0; }
#agenda li { margin-bottom: 0.75rem; }
#agenda li a { text-decoration: none; color: #005a9c; font-weight: bold; }
.agenda-summary { font-size: 0.9em; color: #555; padding-left: 1rem; }
.utterance { display: inline; }

/* New Navigation Pane Styles */
#navigation-pane {
    display: flex;
    flex-direction: column;
    width: 35%; /* Or as needed */
    max-height: 80vh;
    background: #f9f9f9;
    border: 1px solid #ddd;
    border-radius: 8px;
}

.nav-tabs {
    display: flex;
    border-bottom: 1px solid #ddd;
}

.nav-tab-button {
    flex-grow: 1;
    padding: 0.75rem 0.5rem;
    background: #eee;
    border: none;
    border-right: 1px solid #ddd;
    cursor: pointer;
    font-size: 0.8rem;
    color: #333;
    transition: background-color 0.2s;
}

.nav-tab-button:last-child {
    border-right: none;
}

.nav-tab-button.active {
    background: #fff;
    font-weight: bold;
    color: #005a9c;
}

.nav-tab-button:hover:not(.active) {
    background: #e0e0e0;
}

#nav-content {
    flex-grow: 1;
    overflow-y: auto;
    padding: 0.5rem;
}

.nav-tab-content {
    display: none;
}

.nav-tab-content.active {
    display: block;
}

#text-search-input, #speaker-search-input {
    width: calc(100% - 1rem);
    padding: 0.5rem;
    margin: 0.5rem;
    border: 1px solid #ccc;
    border-radius: 5px;
    box-sizing: border-box;
}

.search-results {
    padding: 0 0.5rem;
}

/* Replacing old #agenda styles with new ones for the tab */
#agenda-tab ul {
    list-style: none;
    padding-left: 0;
    margin: 0;
}

#agenda-tab li {
    margin-bottom: 0.75rem;
}

#agenda-tab li a {
    text-decoration: none;
    color: #005a9c;
    font-weight: bold;
}

#agenda-tab .agenda-summary {
    font-size: 0.9em;
    color: #555;
    padding-left: 1rem;
}

#agenda .nav-header::before {
    content: none;
}
.search-results li {
  cursor: pointer;
  padding: 0.3rem;
  border-radius: 4px;
  transition: background-color 0.2s;
}
.search-results li:hover {
  background-color: #f0f0f0;
}
.search-results li:active {
  background-color: #e0e0e0;
}
