/* ==================== SOURCE CODE PRO ==================== */
@font-face {
  font-family: 'Source Code Pro';
  src: url('../fonts/adobe-fonts-source-code-pro-a0e3aa1/TTF/SourceCodePro-ExtraLight.ttf')
    format('truetype');
  font-weight: 200;
  font-style: normal;
}

@font-face {
  font-family: 'Source Code Pro';
  src: url('../fonts/adobe-fonts-source-code-pro-a0e3aa1/TTF/SourceCodePro-Light.ttf')
    format('truetype');
  font-weight: 300;
  font-style: normal;
}

@font-face {
  font-family: 'Source Code Pro';
  src: url('../fonts/adobe-fonts-source-code-pro-a0e3aa1/TTF/SourceCodePro-Regular.ttf')
    format('truetype');
  font-weight: 400;
  font-style: normal;
}

@font-face {
  font-family: 'Source Code Pro';
  src: url('../fonts/adobe-fonts-source-code-pro-a0e3aa1/TTF/SourceCodePro-Medium.ttf')
    format('truetype');
  font-weight: 500;
  font-style: normal;
}

@font-face {
  font-family: 'Source Code Pro';
  src: url('../fonts/adobe-fonts-source-code-pro-a0e3aa1/TTF/SourceCodePro-Semibold.ttf')
    format('truetype');
  font-weight: 600;
  font-style: normal;
}

@font-face {
  font-family: 'Source Code Pro';
  src: url('../fonts/adobe-fonts-source-code-pro-a0e3aa1/TTF/SourceCodePro-Bold.ttf')
    format('truetype');
  font-weight: 700;
  font-style: normal;
}

@font-face {
  font-family: 'Source Code Pro';
  src: url('../fonts/adobe-fonts-source-code-pro-a0e3aa1/TTF/SourceCodePro-Black.ttf')
    format('truetype');
  font-weight: 900;
  font-style: normal;
}

/* ==================== SOURCE SANS 3 ==================== */
@font-face {
  font-family: 'Source Sans 3';
  src: url('../fonts/source-sans-release/TTF/SourceSans3-ExtraLight.ttf')
    format('truetype');
  font-weight: 200;
  font-style: normal;
}

@font-face {
  font-family: 'Source Sans 3';
  src: url('../fonts/source-sans-release/TTF/SourceSans3-Light.ttf')
    format('truetype');
  font-weight: 300;
  font-style: normal;
}

@font-face {
  font-family: 'Source Sans 3';
  src: url('../fonts/source-sans-release/TTF/SourceSans3-Regular.ttf')
    format('truetype');
  font-weight: 400;
  font-style: normal;
}

@font-face {
  font-family: 'Source Sans 3';
  src: url('../fonts/source-sans-release/TTF/SourceSans3-Medium.ttf')
    format('truetype');
  font-weight: 500;
  font-style: normal;
}

@font-face {
  font-family: 'Source Sans 3';
  src: url('../fonts/source-sans-release/TTF/SourceSans3-Semibold.ttf')
    format('truetype');
  font-weight: 600;
  font-style: normal;
}

@font-face {
  font-family: 'Source Sans 3';
  src: url('../fonts/source-sans-release/TTF/SourceSans3-Bold.ttf')
    format('truetype');
  font-weight: 700;
  font-style: normal;
}

@font-face {
  font-family: 'Source Sans 3';
  src: url('../fonts/source-sans-release/TTF/SourceSans3-Black.ttf')
    format('truetype');
  font-weight: 900;
  font-style: normal;
}

/* ==================== LIBERATION SANS ==================== */
@font-face {
  font-family: 'Liberation Sans';
  src: url('../fonts/liberation-fonts-ttf-2.1.5/LiberationSans-Regular.ttf')
    format('truetype');
  font-weight: 400;
  font-style: normal;
}

@font-face {
  font-family: 'Liberation Sans';
  src: url('../fonts/liberation-fonts-ttf-2.1.5/LiberationSans-Bold.ttf')
    format('truetype');
  font-weight: 700;
  font-style: normal;
}

/* ==================== LIBERATION SERIF ==================== */
@font-face {
  font-family: 'Liberation Serif';
  src: url('../fonts/liberation-fonts-ttf-2.1.5/LiberationSerif-Regular.ttf')
    format('truetype');
  font-weight: 400;
  font-style: normal;
}

@font-face {
  font-family: 'Liberation Serif';
  src: url('../fonts/liberation-fonts-ttf-2.1.5/LiberationSerif-Bold.ttf')
    format('truetype');
  font-weight: 700;
  font-style: normal;
}

/* ==================== LIBERATION MONO ==================== */
@font-face {
  font-family: 'Liberation Mono';
  src: url('../fonts/liberation-fonts-ttf-2.1.5/LiberationMono-Regular.ttf')
    format('truetype');
  font-weight: 400;
  font-style: normal;
}

@font-face {
  font-family: 'Liberation Mono';
  src: url('../fonts/liberation-fonts-ttf-2.1.5/LiberationMono-Bold.ttf')
    format('truetype');
  font-weight: 700;
  font-style: normal;
}

/* ==================== RESET & BASE STYLES ==================== */
* {
  box-sizing: border-box;
}

body {
  margin: 0;
  font-family: 'Liberation Sans';
  line-height: 1;
  color: #222;
  background: #fcfcfc;
  display: flex;
  flex-direction: column;
  height: 100vh;
  overflow: hidden;
}

/* ==================== HEADER & TOP ELEMENTS ==================== */
.page-header,
h1,
h2,
.section-titles {
  flex-shrink: 0;
}

/* ==================== HEADER ==================== */
.page-header {
  background: transparent; /* ← Removes the white bar */
  border-bottom: none; /* ← Removes the line */
  box-shadow: none; /* ← Removes shadow */
  padding: 0; /* ← Removes padding */
  margin-bottom: 08px; /* ← Space above h1 (adjust as needed) */
  margin-top: 24px;

  display: flex;
  justify-content: center; /* ← Centers everything */
  align-items: center;
  gap: 40px; /* ← Space between Flag / Music / Switch */
}

.header-flag {
  width: 106px;
  height: auto;
  flex-shrink: 0;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.12);
  margin-left: -44px;
  margin-bottom: 11px;
  image-rendering: auto;
  filter: none;
  cursor: help;
}

.header-flag-pole {
  width: 18px;
  height: auto;
  flex-shrink: 0;
  margin-left: 774px;
  transform: translateY(1px);
  image-rendering: auto;
  z-index: 1;
}

.drop-down-image-left {
  width: 19px;
  height: auto;
  flex-shrink: 0;
  margin-left: -2px;
  margin-right: 4px;
  transform: translateY(4px);
  image-rendering: auto;
  z-index: 1;
}

.drop-down-pdf-image-left {
  width: 17px;
  height: auto;
  flex-shrink: 0;
  margin-left: 0px;
  margin-right: 0px;
  margin-top: 4px;
  transform: translateY(2px);
  image-rendering: auto;
  z-index: 1;
}

.drop-down-key-image-left {
  width: 17px;
  height: auto;
  flex-shrink: 0;
  margin-left: 0px;
  margin-right: 0px;
  margin-top: 6px;
  transform: translateY(2px);
  image-rendering: auto;
  z-index: 1;
}

.drop-down-lexicon-image-left {
  width: 17px;
  height: auto;
  flex-shrink: 0;
  margin-left: 0px;
  margin-right: 0px;
  margin-top: 6px;
  transform: translateY(2px);
  image-rendering: auto;
  z-index: 1;
}

.drop-down-info-image-left {
  width: 12px;
  height: auto;
  flex-shrink: 0;
  margin-left: 0px;
  margin-right: 0px;
  transform: translateY(2px);
  image-rendering: auto;
  z-index: 1;
}

.drop-down-folder-image-left {
  width: 16px;
  height: 14px;
  flex-shrink: 0;
  margin-left: -2px;
  margin-right: 0px;
  transform: translateY(1px);
  image-rendering: auto;
  z-index: 1;
}

.header-text {
  flex: 1;
}

h1,
p {
  margin: 0;
}

h1 {
  font-size: 34px;
  font-weight: 300;
  word-spacing: 0px;
  text-align: center;
  margin-top: 0px;
  margin-bottom: 0px;
}

h2 {
  font-size: 17px;
  font-weight: 300;
  word-spacing: 1px;
  text-align: center;
  margin-top: 2px;
  margin-bottom: 4px;
}

p {
  font-size: 14px;
  word-spacing: 0px;
  text-align: left;
  margin-bottom: 2px;
}

.drop-down-entry {
  font-size: 13px;
  font-family: 'Source Code Pro';
  margin-top: 5px;
}

/* ==================== EMBLEMS ==================== */

.drop-down-emblem {
  width: 280px;
  height: auto;
  flex-shrink: 0;
  margin-left: 170px;
  margin-right: 5px;
  transform: translateY(-14px);
  image-rendering: auto;
  z-index: 1;
  border-style: solid;
  border-width: 1px;
}

.drop-down-emblem-2 {
  width: 380px;
  height: auto;
  flex-shrink: 0;
  margin-left: 170px;
  margin-right: 5px;
  transform: translateY(-14px);
  image-rendering: auto;
  z-index: 1;
  border-style: solid;
  border-width: 1px;
}

/* ====================== FLAG POPUP ====================== */
.flag-popup {
  display: none;
  position: fixed;
  width: 800px;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  z-index: 99999;
  background: rgba(255, 255, 255, 0.61);
  border: 1px solid #ececec;
  border-radius: 2px;
  padding: 2px 2px 2px;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.6);
  text-align: center;
  max-width: 90%;
  max-height: 90vh;
  overflow: auto;
}

.flag-popup.show {
  display: flex;
  flex-direction: column;
  align-items: center;
  animation: fadeInPopup 0.3s ease forwards;
}

.flag-large {
  max-width: 100%;
  max-height: 75vh;
  object-fit: contain;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.4);
}

/* Hover text styling */
.flag-popup .hover-text-2 {
  font-size: 28px;
  font-family: Arial, Helvetica, sans-serif;
  font-weight: 700;
  color: #222;
  margin-bottom: 2px;
  background-color: #ffffffde;
  padding-left: 12px;
  padding-right: 12px;
}

/* Page Blur with Active Flag */
body:has(#flag-popup.show) .page-header,
body:has(#flag-popup.show) h1,
body:has(#flag-popup.show) h2,
body:has(#flag-popup.show) .section-titles,
body:has(#flag-popup.show) .view-toggle,
body:has(#flag-popup.show) .container,
body:has(#flag-popup.show) .page-footer {
  filter: blur(3px);
  transition: filter 0.4s ease;
}

.flag-popup,
.flag-popup * {
  filter: none !important;
}

/* ==================== MAIN LAYOUT ==================== */
.container {
  display: flex;
  flex: 1;
  width: 99%;
  margin: 0 auto 20px auto;
  min-height: 0;
  overflow: auto;
}

.pdf-section {
  flex: 0.8;
  padding: 0 0 8px 8px;
}

.pdf-viewer {
  width: 100%;
  height: 100%;
  border: 1px solid #333;
  border-radius: 3px;
}

/* ==================== COLUMN SIZES ==================== */
:root {
  --col-toggle: 30px;
  --col-date: 120px;
  --col-claimant: 160px;
  --col-vassalee: 170px;
  --col-performance: 290px;
  --col-concern: minmax(300px, 1fr);
}

/* ==================== MASTER HEADER & ROWS ==================== */
.master-header,
.entry-header {
  display: grid;
  grid-template-columns:
    var(--col-toggle) var(--col-date) var(--col-claimant)
    var(--col-vassalee) var(--col-performance) var(--col-concern);
  align-items: center;
  gap: 0;
  padding: 0;
  min-width: 1060px;
}

.master-header {
  background: #303030;
  color: rgb(255, 255, 255);
  margin-top: 1px;
  margin-bottom: 1px;
  position: sticky;
  top: 0;
  z-index: 30;
  margin-bottom: 8px;
  font-weight: bold;
  font-size: 14px;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.15);
}

.header-spacer {
  width: var(--col-toggle);
}

.header-cell {
  padding: 0 3px;
  text-align: left;
  border-right: 1px solid transparent;
}

.header-cell:last-child {
  border-right: none;
}

.entry-header {
  background: white;
  border: 1px solid #dddddd;
  border-radius: 4px;
  cursor: pointer;
  padding: 0 2px;
  margin-bottom: 2px;
  overflow: visible;
}

.toggle {
  justify-self: center;
  font-size: 14px;
  margin-bottom: 2px;
  transition: transform 0.4s ease;
  color: #333;
  font-weight: bold;
}

.toggle.rotated {
  transform: rotate(90deg);
}

.entry-date {
  font-size: 14px;
  margin-bottom: 1px;
  font-weight: bold;
  white-space: nowrap;
}

.entry-data {
  font-size: 12px;
  font-weight: 600;
  margin-top: 2px;
  color: #333;
  white-space: nowrap;
}

.entry-flags {
  width: 20px;
  height: 15px;
  object-fit: contain;
  object-position: center center;
  vertical-align: middle;
  display: inline-block;
  flex-shrink: 0;
  margin-left: 4px;
  margin-right: 4px;
  transform: translateY(-1px);
  image-rendering: auto;
  z-index: 1;
}

.entry-flags-2 {
  width: 32px;
  height: 15px;
  object-fit: contain;
  object-position: center center;
  vertical-align: middle;
  display: inline-block;
  flex-shrink: 0;
  margin-left: 4px;
  margin-right: 4px;
  transform: translateY(-1px);
  image-rendering: auto;
  z-index: 1;
}

.entry-flags-3 {
  width: 32px;
  height: 15px;
  object-fit: contain;
  object-position: center center;
  vertical-align: middle;
  display: inline-block;
  flex-shrink: 0;
  margin-left: 4px;
  margin-right: 4px;
  transform: translateY(-1px);
  image-rendering: auto;
  z-index: 1;
}

/* ==================== ENTRY DETAIL ==================== */
.entry-detail {
  margin-left: 17px;
  border-left: 2px solid #666;
  margin-top: 8px;
  margin-bottom: 8px;
  padding: 6px 15px 6px 15px;
  background: #fff9c879;
  display: none;
  width: calc(100% - 17px);
  max-width: calc(100% - 17px);
  box-sizing: border-box;
}

.entry-detail:not(.hidden) {
  display: block;
}

.label {
  font-size: 13px;
  font-family: 'Source Code Pro';
  font-weight: 800;
  display: block;
  margin-top: 0;
  margin-bottom: 6px;
}

.pdf-link {
  color: #09578b;
  font-family: 'Source Code Pro';
  font-weight: bold;
  font-size: 12px;
  text-decoration: none;
  display: block;
  margin-bottom: 4px;
}

.pdf-link:hover {
  text-decoration: underline;
  color: #5b0077;
}

.description {
  display: block;
  color: #000;
  font-family: 'Source Code Pro';
  font-size: 12px;
  line-height: 1.4;
  text-align: left;
  white-space: normal;
  overflow-wrap: break-word;
  word-wrap: break-word;
  max-width: calc(50vw - 0px);
}

.description .claim-section {
  display: inline;
  cursor: text;
  transition: color 0s ease;
}

.description .claim-section:hover {
  color: #000000 !important;
  background: rgba(255, 237, 79, 0.753);
  text-decoration: underline;
  text-decoration-color: rgb(190, 2, 40);
  padding: 0px;
  font-weight: 600;
}

/* ==================== MISC ==================== */
.chronology-list {
  flex: none;
  min-height: 0;
  overflow: visible;
  background: #ffffff;
  min-width: 1060px;
}

.entry {
  margin-bottom: 4px;
}

.entry-header:hover {
  background: #f0f4ff;
  border-color: #a0b8e0;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.08);
}

.synopsis-label {
  margin-top: 12px;
}

.key-label {
  margin-top: 12px;
}

.file-header {
  display: flex;
  align-items: flex-start;
  gap: 236px;
}

.vassalee-personal-name {
  font-size: 12px;
  color: #000000;
  white-space: nowrap;
}

/* ==================== FOOTER ==================== */
.page-footer {
  background: #ffffff;
  padding: 4px 8px 8px 8px;
  border-top: 1px solid #cecece;
  box-shadow: 0 -6px 18px rgba(0, 0, 0, 0.1);
  margin-top: auto;
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
}

.footer-text {
  flex: 1;
  text-align-last: center;
  max-width: 100%;
}

.footer-row1,
.footer-row2 {
  margin: 0;
}

.footer-row1 {
  font-size: 13px;
  word-spacing: 1px;
  margin-bottom: 0px;
}

.footer-wrapper {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
  max-width: 1850px;
  margin: 0 auto;
  padding: 0px 0px;
  box-sizing: border-box;
}

.footer-left,
.footer-right {
  flex: 0 0 auto;
  min-width: 160px;
}

.footer-text {
  flex: 1;
  text-align: center;
}

/* ====================== DISCLAIMER TEXT ====================== */
.disclaimer-text {
  cursor: help;
  font-family: 'Liberation Sans';
  font-size: 15px;
  font-weight: 700;
  color: #333;
  transition: all 0.1s ease;
}

.disclaimer-text:hover {
  color: rgb(63, 0, 0);
}

.disclaimer-icon-left {
  width: 19px;
  height: auto;
  flex-shrink: 0;
  margin-left: -2px;
  margin-right: 5px;
  transform: translateY(3px);
  image-rendering: auto;
  z-index: 1;
}

.disclaimer-popup .hover-text-2 {
  background: transparent !important;
  padding: 0 !important;
  box-shadow: none !important;
  display: block !important;
  text-align: center;
  margin-bottom: 14px;
  font-family: 'Liberation Sans';
  font-size: 26px;
  font-weight: 700;
  color: #222;
  letter-spacing: 1px;
}

/* ====================== DISCLAIMER POPUP ====================== */
.disclaimer-popup {
  display: none;
  position: fixed;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  z-index: 99999;
  background: #ffffffde;
  border: 1px solid #690000ea;
  max-width: 1400px;
  width: 90%;
  padding: 140px 140px;
  line-height: 1.2;
  text-align: justify;
  font-size: 16px;
  color: #222;
  text-align: center;
}

.disclaimer-popup.show {
  display: block;
  animation: fadeInPopup 0.1s ease forwards;
}

@keyframes fadeInPopup {
  from {
    opacity: 0;
    transform: translate(-50%, -50%) scale(0.95);
  }
  to {
    opacity: 1;
    transform: translate(-50%, -50%) scale(1);
  }
}

.disclaimer-content p {
  margin-bottom: 1.2em;
  font-family: 'Liberation Sans';
  font-weight: 600;
  text-align: center;
}

.disclaimer-popup .hover-text {
  font-size: 18px;
  font-family: 'Liberation Sans';
  font-weight: 600;
  margin-bottom: 20px;
  color: #000;
}

/* ==================== SECTION TITLES ==================== */
.section-titles {
  display: flex;
  width: 99%;
  max-width: 99%;
  margin: 0 auto 8px auto;
  padding: 0 20px;
  justify-content: space-between;
  align-items: flex-end;
}

.title-nav,
.title-pdf {
  position: relative;
  flex: 0 0 auto;
  width: fit-content;
  padding: 6px 28px 4px;
  background: #e0b64341;
  border: 1px solid #ece3ba;
  border-bottom: none;
  border-radius: 8px 8px 0 0;
  box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
  font-size: 15px;
  font-weight: bold;
  letter-spacing: 1px;
  color: #000000;
  text-transform: uppercase;
  z-index: unset;
}

/* ==================== SECTION TITLE ICONS ==================== */
.title-icon-nav,
.title-icon-pdf {
  position: absolute;
  top: 5px;
  height: auto;
  object-fit: contain;
  z-index: 10;
  pointer-events: none;
}

/* ───── NAVIGATION TABLE ICON ───── */
.title-icon-nav {
  top: 3.5px;
  left: 12px;
  width: 190px;
}

/* ───── DOCUMENT VIEWER ICON ───── */
.title-icon-pdf {
  top: 3.5px;
  right: 16px;
  width: 190px;
}

.title-nav {
  text-align: left;
}
.title-pdf {
  text-align: right;
}

/* ==================== COMPLEMENTARY MUSIC PLAYER ==================== */
.music-player {
  margin-left: -62px;
  margin-right: 4px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  min-width: 220px;
  height: auto;
  position: relative;
}

.music-title {
  font-size: 15px;
  font-weight: 600;
  word-spacing: 4px;
  margin-right: 0px;
  margin-bottom: 8px;
  color: #333;
  text-align: right;
}

.player-controls {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-top: 0px;
}

.music-icon {
  width: 38px;
  height: 38px;
  margin-right: -3px;
  transform: translateY(-13px);
}

/* ==================== PLAY/PAUSE BUTTON ==================== */
.play-pause-btn {
  width: 13px;
  height: 13px;
  margin-top: 0px;
  margin-right: 4px;
  padding: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  background: none;
  border: none;
  cursor: pointer;
}

.play-pause-btn img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  pointer-events: none;
}

.play-pause-btn:hover {
  transform: scale(1.04);
}

/* ==================== SKIP BUTTON ==================== */
.skip-btn {
  width: 17px;
  height: 17px;
  margin-right: 4px;
  margin-top: 0px;
  padding: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  background: none;
  border: none;
  cursor: pointer;
}

.skip-btn img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  pointer-events: none;
}

.skip-btn:hover {
  transform: scale(1.04);
}

/* ==================== VOLUME SLIDER ==================== */
.volume-wrapper {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-top: 2px;
}

.volume-slider {
  -webkit-appearance: none;
  appearance: none;
  width: 130px;
  height: 4px;

  /* Thin black outline */
  border: 0px solid #d8d8d8;
  border-radius: 3px;
  outline: none;
  cursor: pointer;
  margin-top: 0px;
  margin-right: 0px;

  /* This creates the black fill effect */
  background: linear-gradient(
    to right,
    #000000 0%,
    #000000 var(--value, 30%),
    #707070 var(--value, 30%),
    #d8d8d8 100%
  );
}

/* Thumb - Black interior */
.volume-slider::-webkit-slider-thumb {
  -webkit-appearance: none;
  appearance: none;
  width: 6px;
  height: 19px;
  background: #000000;
  border: 1px solid #333333;
  border-radius: 2px;
  cursor: pointer;
  margin-top: 0px; /* Centers the thumb on the track */
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.4);
}

.volume-slider::-moz-range-thumb {
  width: 6px;
  height: 19px;
  background: #000000;
  border: 1px solid #333333;
  border-radius: 2px;
  cursor: pointer;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.4);
}

/* ==================== VIDEO CONTAINER ==================== */
.video-container {
  width: 100%;
  height: 100%;
  border: 1px solid #333;
  border-radius: 3px;
  background: #111;
  overflow: hidden;
}

.video-container video {
  width: 100% !important;
  height: 100% !important;
  display: block;
}

.drop-down-mp4-image-left {
  width: 19px;
  height: auto;
  flex-shrink: 0;
  margin-left: 0px;
  margin-right: 0px;
  transform: translateY(2px);
  image-rendering: auto;
  z-index: 1;
}

/* ==================== VIEWPORT BLUR FOR DISCLAIMER ==================== */
body:has(#disclaimer-trigger:hover) .page-header,
body:has(#disclaimer-trigger:hover) h1,
body:has(#disclaimer-trigger:hover) h2,
body:has(#disclaimer-trigger:hover) .section-titles,
body:has(#disclaimer-trigger:hover) .container,
body:has(#disclaimer-trigger:hover) .page-footer {
  filter: blur(2.5px);
  transition: filter 0.35s ease;
}

/* Also blur while the popup is actually visible */
body:has(.disclaimer-popup.show) .page-header,
body:has(.disclaimer-popup.show) h1,
body:has(.disclaimer-popup.show) h2,
body:has(.disclaimer-popup.show) .section-titles,
body:has(.disclaimer-popup.show) .view-toggle,
body:has(.disclaimer-popup.show) .container,
body:has(.disclaimer-popup.show) .page-footer {
  filter: blur(2.5px);
  transition: filter 0.35s ease;
}

/* Keep the popup and its text perfectly sharp */
.disclaimer-popup,
.disclaimer-popup * {
  filter: none !important;
}

/* Optional: keep footer slightly less blurred so the disclaimer text stays readable */
body:has(.disclaimer-popup.show) .page-footer {
  filter: blur(1px);
}

/* ==================== VIEW TOGGLE ==================== */
.view-toggle {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 16px;
  margin-left: 36px;
  margin-top: 0px;
  margin-bottom: 10px;
  padding: 0 0px;
  width: fit-content;
}

.toggle-option {
  display: flex;
  align-items: center;
  gap: 16px;
  flex-direction: row-reverse;
  cursor: pointer;
  user-select: none;
}

.toggle-label {
  font-size: 12px;
  font-family: 'Liberation Sans';
  font-weight: 600;
  letter-spacing: 1px;
  color: #222;
}

.toggle-circle {
  width: 12px; /* outer circle size */
  height: 12px;
  border: 2px solid #616161; /* classic Windows 98 border */
  border-radius: 50%;
  background-color: #ffffff;
  position: relative; /* needed for the inner dot */
  flex-shrink: 0;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.3);
  transition: all 0.2s ease;
}

.toggle-option.active .toggle-circle::after {
  content: '';
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 9px; /* smaller black dot */
  height: 9px;
  background-color: #0c0c0c;
  border-radius: 50%;
}

.toggle-option:hover .toggle-circle {
  box-shadow: 0 2px 5px rgba(0, 0, 0, 0.3);
}

.toggle-label:hover {
  color: #000000;
}

/* ==================== SECTION SWAP ==================== */
.list-section {
  flex: 1.2;
  display: flex;
  flex-direction: column;
  overflow: auto;
  padding: 0 10px 610px 0px;
  background: transparent;
  border-right: 1px solid #ddd;
}

.list-section:not(.active) {
  display: none !important;
}

.list-section.active {
  display: flex !important;
}

/* ==================== RED ROCKER SWITCH ==================== */
.rocker-wrapper {
  display: flex;
  flex-direction: column;
  align-items: center;
  margin-left: -26px;
  margin-right: 776px;
  margin-top: 14px;
}

.rocker-text {
  font-family: 'Liberation Sans';
  font-size: 11px;
  font-weight: 600;
  color: #444;
  margin-top: 10px;
}

.switch {
  background-color: black;
  width: 30px;
  height: 50px;
  box-shadow:
    0 0 10px 2px rgba(0, 0, 0, 0.2),
    0 0 1px 2px black,
    inset 0 2px 2px -2px white,
    inset 0 0 0px 0px #383838,
    inset 0 0 0px 22px black;
  border-radius: 2px;
  padding: 4px;
  padding-bottom: 10px;
  padding-top: 14px;
  perspective: 700px;
}

.switch input {
  display: none;
}

.switch input:checked + .button {
  transform: translateZ(20px) rotateX(25deg);
  box-shadow: 0 -10px 20px #ff1818;
}

.switch input:checked + .button .light {
  animation: flicker 0.2s infinite 0.3s;
}

.switch input:checked + .button .shine {
  opacity: 1;
}

.switch input:checked + .button .shadow {
  opacity: 0;
}

.button {
  transition: all 0.3s cubic-bezier(1, 0, 1, 1);
  transform-origin: center center -20px;
  transform: translateZ(20px) rotateX(-25deg);
  transform-style: preserve-3d;
  background: linear-gradient(
    #9b0621 0%,
    #7a041a 30%,
    #7a041a 70%,
    #9b0621 100%
  );
  width: 100%;
  height: 100%;
  position: relative;
  cursor: pointer;
}

.button::before {
  content: '';
  background:
    linear-gradient(
        rgba(255, 255, 255, 0.8) 10%,
        rgba(255, 255, 255, 0.3) 30%,
        #5c0314 75%,
        #4a0210 100%
      )
      50% 50% / 97% 97%,
    #7a041a;
  background-repeat: no-repeat;
  width: 100%;
  height: 50px;
  transform-origin: top;
  transform: rotateX(-90deg);
  position: absolute;
  top: 0;
}

.button::after {
  content: '';
  background-image: linear-gradient(#5c0314, #4a0210);
  width: 100%;
  height: 50px;
  transform-origin: top;
  transform: translateY(50px) rotateX(-90deg);
  position: absolute;
  bottom: 0;
  box-shadow:
    0 50px 8px 0px black,
    0 80px 20px 0px rgba(0, 0, 0, 0.5);
}

.light {
  opacity: 0;
  animation: light-off 1s;
  position: absolute;
  width: 100%;
  height: 100%;
  background-image: radial-gradient(#ff4d4d, #ff1818 40%, transparent 70%);
  z-index: 1;
}

.dots {
  position: absolute;
  width: 100%;
  height: 100%;
  background-image: radial-gradient(transparent 30%, rgba(92, 3, 20, 0.7) 70%);
  background-size: 10px 10px;
  z-index: 2;
}

.characters {
  position: absolute;
  width: 100%;
  height: 100%;
  background:
    linear-gradient(white, white) 50% 20% / 5% 20%,
    radial-gradient(
        circle,
        transparent 50%,
        white 52%,
        white 70%,
        transparent 72%
      )
      50% 80% / 33% 25%;
  background-repeat: no-repeat;
  z-index: 3;
}

.shine {
  transition: all 0.3s cubic-bezier(1, 0, 1, 1);
  opacity: 0.3;
  position: absolute;
  width: 100%;
  height: 100%;
  background:
    linear-gradient(white, transparent 3%) 50% 50% / 97% 97%,
    linear-gradient(
        rgba(255, 255, 255, 0.5),
        transparent 50%,
        transparent 80%,
        rgba(255, 255, 255, 0.5)
      )
      50% 50% / 97% 97%;
  background-repeat: no-repeat;
  z-index: 4;
}

.shadow {
  transition: all 0.3s cubic-bezier(1, 0, 1, 1);
  opacity: 1;
  position: absolute;
  width: 100%;
  height: 100%;
  background: linear-gradient(transparent 70%, rgba(0, 0, 0, 0.8));
  background-repeat: no-repeat;
  z-index: 5;
}

/* Animations */
@keyframes flicker {
  0% {
    opacity: 1;
  }
  80% {
    opacity: 0.8;
  }
  100% {
    opacity: 1;
  }
}

@keyframes light-off {
  0% {
    opacity: 1;
  }
  80% {
    opacity: 0;
  }
}

/* ==================== DARK MODE STYLES ==================== */
body.dark-mode {
  background: #252525;
  color: #e0e0e0;
}

body.dark-mode h1,
body.dark-mode h2 {
  color: #e4e4e4;
}

body.dark-mode .master-header {
  background: #550101;
  color: #e6a1f7;
}

body.dark-mode .chronology-list {
  background: #2e2e2e; /* ← This fixes the white strips */
}

body.dark-mode .entry {
  background: transparent;
  margin-bottom: 3px;
}

body.dark-mode .entry-header {
  background: #080808;
  border-color: #000000;
  color: #c4e0a0;
}

body.dark-mode .entry-header:hover {
  background: #333;
  border-color: #666;
}

body.dark-mode .entry-detail {
  background: #141414;
  border-left-color: #666;
}

body.dark-mode .entry-data {
  color: #f0c9a9;
}

body.dark-mode .description {
  color: #f1f1f1;
}

body.dark-mode .pdf-link {
  color: #a0baf1;
}

body.dark-mode .pdf-link:hover {
  color: #a8d4ff;
}

body.dark-mode .page-footer {
  background: #222222;
  border-top: 1px solid #131313;
}

body.dark-mode .toggle-circle {
  border-color: #888;
  background: #333;
}

body.dark-mode .toggle-option.active .toggle-circle::after {
  background: #ddd;
}

body.dark-mode .music-title {
  color: #ebebeb;
}

body.dark-mode .toggle {
  color: #ccc;
}

body.dark-mode .disclaimer-text {
  color: #ccc;
}

body.dark-mode .toggle-label {
  color: #e4e4e4;
}

body.dark-mode .rocker-text {
  color: #e4e4e4;
}

body.dark-mode .title-icon-nav,
body.dark-mode .title-icon-pdf {
  filter: invert(1);
}

body.dark-mode .title-nav,
body.dark-mode .title-pdf {
  background: #000;
  border-color: #000;
}

body.dark-mode .play-pause-btn,
body.dark-mode .skip-btn {
  filter: invert(1);
}

body.dark-mode .volume-slider {
  filter: invert(1);
}

body.dark-mode .drop-down-info-image-left {
  filter: invert(1);
}

body.dark-mode .entry-flags-3 {
  filter: invert(1);
}

body.dark-mode .description .claim-section:hover {
  color: #000000 !important;
  background: rgba(218, 192, 46, 0.945);
  text-decoration-color: rgb(190, 2, 40);
}

body.dark-mode .drop-down-lexicon-image-left {
  filter: invert(1);
}

body.dark-mode .disclaimer-popup {
  background: #131313de;
  border: 1px solid #690000ea;
  color: #f7f7f7;
}

body.dark-mode .disclaimer-popup .hover-text-2 {
  color: #f0f0f0;
}

body.dark-mode .flag-popup {
  background: rgba(22, 22, 22, 0.61);
  border: 1px solid #000000;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.6);
}

.flag-popup .hover-text-2 {
  color: #f5f5f5;
  background-color: #0e0e0ede;
}

/* ==================== WARM LIGHT BEAMS ==================== */
body.dark-mode {
  position: relative;
  background: #0e0e0e;
  overflow: hidden;
}

/* Light beams container */
body.dark-mode::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  z-index: 1;
  background: 
    /* Top Right Beam (main realistic beam) */
    linear-gradient(
      145deg,
      rgba(255, 220, 120, 0.22) 0%,
      rgba(255, 200, 80, 0.12) 18%,
      rgba(255, 180, 60, 0.05) 35%,
      transparent 55%
    ),
    /* Top Left Beam */
    linear-gradient(
        35deg,
        rgba(255, 220, 120, 0.18) 0%,
        rgba(255, 200, 80, 0.1) 20%,
        rgba(255, 180, 60, 0.04) 38%,
        transparent 58%
      );
  mix-blend-mode: screen;
}

/* ==================== DARK MODE SCROLLBARS ==================== */
body.dark-mode .list-section {
  /* Modern scrollbar styling (Firefox + some others) */
  scrollbar-color: #777 #161616;
}

/* WebKit browsers (Chrome, Edge, Safari) */
body.dark-mode .list-section::-webkit-scrollbar {
  width: 10px; /* vertical scrollbar width */
  height: 10px; /* horizontal scrollbar height */
}

body.dark-mode .list-section::-webkit-scrollbar-track {
  background: #2a2a2a; /* track color */
  border-radius: 5px;
}

body.dark-mode .list-section::-webkit-scrollbar-thumb {
  background: #666; /* scrollbar color */
  border-radius: 5px;
  border: 2px solid #2a2a2a; /* gives a bit of padding */
}

body.dark-mode .list-section::-webkit-scrollbar-thumb:hover {
  background: #888; /* lighter when hovering */
}

/* ==================== MEDIA QUERIES ==================== */

@media screen and (max-width: 600px) {
  /* === CRITICAL: Disable mobile text inflation === */
  html,
  body,
  .entry-header,
  .entry-detail,
  .description,
  .master-header,
  .pdf-link,
  .label,
  .entry-data,
  .drop-down-entry {
    -webkit-text-size-adjust: 100% !important;
    text-size-adjust: 100% !important;
  }

  /* 1. Hide H1, H2 and Section Titles */
  h1,
  h2,
  .section-titles {
    display: none !important;
  }

  .view-toggle {
    display: flex;
    justify-content: flex-start;
    align-items: center;
    gap: 16px;
    margin-left: 12px;
    margin-bottom: 8px;
    padding: 0;
    width: fit-content;
  }

  /* 3. Main Container */
  .container {
    flex-direction: column;
    width: 100%;
    margin: 0;
    padding: 0 6px;
    gap: 0;
    height: calc(100vh - 140px);
    overflow: hidden;
    min-height: 0;
  }

  /* 4. List Section */
  .list-section {
    flex: 1;
    width: 100%;
    min-width: unset;
    overflow-y: auto;
    overflow-x: auto;
    padding: 0 4px 8px 4px;
    border-right: none;
    border-bottom: 1px solid #ccc;
    margin-bottom: 4px;
  }

  /* 5. PDF / Video Viewer */
  .pdf-section {
    flex: 1;
    width: 100%;
    padding: 0;
    overflow: hidden;
    min-height: 0;
  }

  .pdf-viewer {
    width: 100% !important;
    height: 100% !important;
    max-width: 100%;
    display: block;
    border: 1px solid #333;
    border-radius: 3px;
  }

  .video-container {
    width: 100%;
    height: 100% !important;
    overflow: hidden;
  }

  /* === FONT SIZES - Now with !important === */
  .entry-date {
    font-size: 11px !important;
  }

  .entry-header {
    padding-left: 6px;
  }

  /* Grid columns for narrow view */
  .master-header,
  .entry-header {
    grid-template-columns: 26px 95px 130px 135px 260px 1fr;
    font-size: 11px !important;
  }

  /* Main content scaling - includes .label */
  .master-header,
  .entry-header,
  .entry-detail,
  .description,
  .pdf-link,
  .label,
  .entry-data,
  .drop-down-entry {
    font-size: 11px !important;
  }

  .description {
    font-size: 11px !important;
    line-height: 1.3;
    max-width: calc(82vw - 0px);
  }

  /* Entry Icons - slightly smaller on mobile */
  .drop-down-folder-image-left,
  .drop-down-pdf-image-left,
  .drop-down-key-image-left,
  .drop-down-lexicon-image-left,
  .drop-down-info-image-left,
  .drop-down-image-left,
  .entry-flags,
  .entry-flags-2,
  .entry-flags-3 {
    width: 14px;
    height: auto;
  }

  /* Table minimum width */
  .master-header,
  .entry-header,
  .chronology-list {
    min-width: 1020px;
    width: auto;
  }

  /* Header & Footer */
  .page-header {
    padding: 4px 8px 4px 8px;
    margin-bottom: 8px;
  }

  .page-footer {
    padding: 6px 8px;
    font-size: 11px;
  }

  .footer-row1 {
    font-size: 11px;
  }

  .music-player {
    min-width: 180px;
  }

  .music-title {
    font-size: 13px;
  }

  .drop-down-emblem-2 {
    width: 280px;
    height: auto;
    margin-left: 144px;
  }

  .drop-down-emblem {
    width: 220px;
    height: auto;
    margin-left: 142px;
  }

  .disclaimer-popup {
    display: none;
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    z-index: 99999;
    background: #ffffffde;
    border: 1px solid #690000ea;
    max-width: 1400px;
    width: 90%;
    padding: 50px 50px;
    line-height: 1.2;
    text-align: justify;
    font-size: 16px;
    color: #222;
    text-align: center;
  }

  .page-footer {
    background: #ffffff;
    padding: 0px 4px 4px 4px;
    border-top: 1px solid #cecece;
    box-shadow: 0 -6px 18px rgba(0, 0, 0, 0.1);
    margin-top: 4px;
    display: flex;
    align-items: center;
    justify-content: center;
    text-align: center;
  }

  .volume-slider {
    -webkit-appearance: none;
    appearance: none;
    width: 107px;
    height: 4px;

    /* Thin black outline */
    border: 0px solid #d8d8d8;
    border-radius: 3px;
    outline: none;
    cursor: pointer;
    margin-top: 0px;
    margin-right: 0px;

    /* This creates the black fill effect */
    background: linear-gradient(
      to right,
      #000000 0%,
      #000000 var(--value, 30%),
      #707070 var(--value, 30%),
      #d8d8d8 100%
    );
  }
}
