body {
  font-family: 'Roboto', sans-serif;
  margin: 0;
  padding: 0;
  display: flex;
  position: relative;
  height: 100vh;
}

.main-content {
  padding: 0;
  position: relative;
  top: 44px; /* Matches navbar height for page load */
  z-index: 800;
  width: 100%;
  height: calc(100vh - 44px); /* Adjusted for navbar */
  overflow-y: auto;
  display: flex;
  flex-direction: column;
}

.main-content::-webkit-scrollbar {
  width: 2px !important;
}

.main-content::-webkit-scrollbar-track {
  background: rgba(255, 255, 255, 0.1) !important;
}

.main-content::-webkit-scrollbar-thumb {
  background: rgba(0, 0, 0, 0.2) !important;
  border-radius: 2px !important;
}

.main-content::-webkit-scrollbar-thumb:hover {
  background: rgba(0, 0, 0, 0.3) !important;
}

.main-content {
  scrollbar-width: thin;
  scrollbar-color: rgba(0, 0, 0, 0.2) rgba(255, 255, 255, 0.1);
}

/* Remove top offset for Apple Music player */
.directory-right-column.apple-music-active .main-content {
  top: 0;
  height: 100vh;
}

.directory-header {
  margin: 0;
  padding: 0;
  width: 100%;
}

.directory-header img {
  width: 100%;
  height: auto;
  display: block;
  border: none;
}

.search-bar {
  position: sticky;
  top: 0; /* Sticky within .main-content on page load */
  width: 100%;
  padding: 10px;
  box-sizing: border-box;
  background-color: #f8f8f8;
  z-index: 10;
  display: flex;
  gap: 0;
}

.search-bar input[type="text"] {
  flex: 1;
  padding: 8px;
  font-size: 16px;
  border: 1px solid #ddd;
  border-radius: 4px 0 0 4px;
  box-sizing: border-box;
  margin-right: -1px;
}

.search-bar button {
  padding: 8px 16px;
  font-size: 16px;
  background-color: #e0e0e0;
  border: 1px solid #ddd;
  border-radius: 0 4px 4px 0;
  cursor: pointer;
  transition: background-color 0.3s;
}

.search-bar button:hover {
  background-color: #d0d0d0;
}

.search-bar #add-to-directory {
  background-color: #007bff;
  color: #fff;
  border: 1px solid #007bff;
  border-radius: 4px;
  margin-left: 8px;
}

.search-bar #add-to-directory:hover {
  background-color: #0056b3;
}

.category-nav {
  width: 100%;
  background-color: #fff;
  padding: 8px 0;
  box-sizing: border-box;
  border-bottom: 1px solid #ccc;
  border-top: 1px solid #ccc;
  position: relative;
  display: flex;
  align-items: center;
  min-height: 42px;
  max-height: 42px;
  overflow: hidden;
  transition: top 0.3s ease;
}

.category-nav-container {
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none;
  -ms-overflow-style: none;
  width: 100%;
  min-height: 0;
}

.category-nav-container::-webkit-scrollbar {
  display: none;
}

.category-nav ul {
  list-style: none;
  margin: 0;
  padding: 0 30px;
  display: flex;
  justify-content: flex-start;
  align-items: center;
  width: max-content;
  min-height: 0;
}

.category-nav li {
  margin: 0;
  white-space: nowrap;
  display: flex;
  align-items: center;
}

.category-nav a {
  text-decoration: none;
  color: #333;
  font-size: 16px;
  padding: 8px 12px;
  transition: color 0.3s, background-color 0.3s;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.category-nav a:hover {
  color: #007bff;
  background-color: #e6f0ff;
}

.category-nav a:active,
.category-nav a.active {
  background-color: #007bff !important;
  color: #fff !important;
  border-radius: 4px !important;
}

.sub-nav {
  width: 100%;
  background-color: #fff;
  padding: 8px 0;
  box-sizing: border-box;
  border-bottom: 1px solid #ccc;
  border-top: 0;
  position: relative;
  display: none;
  min-height: 42px;
  max-height: 42px;
  overflow: hidden;
  overflow-y: clip;
  transition: top 0.3s ease;
  will-change: transform;
}

.sub-nav[style*="display: block"] {
  display: flex !important;
  align-items: center;
}

.sub-nav-container {
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none;
  -ms-overflow-style: none;
  width: 100%;
  min-height: 0;
}

.sub-nav-container::-webkit-scrollbar {
  display: none;
}

.sub-nav ul {
  list-style: none;
  margin: 0;
  padding: 0 30px;
  display: flex;
  justify-content: flex-start;
  align-items: center;
  width: max-content;
  min-height: 0;
}

.sub-nav li {
  margin: 0;
  white-space: nowrap;
  display: flex;
  align-items: center;
}

.sub-nav a {
  text-decoration: none;
  color: #333;
  font-size: 16px;
  padding: 8px 12px;
  transition: color 0.3s, background-color 0.3s;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  line-height: normal;
}

.sub-nav a:hover {
  color: #007bff;
  background-color: #e6f0ff;
}

.sub-nav a:active,
.sub-nav a.active {
  background-color: #007bff !important;
  color: #fff !important;
  border-radius: 4px !important;
}

.scroll-arrow {
  display: none;
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  font-size: 10px;
  color: #666;
  cursor: pointer;
  padding: 5px;
  background-color: #fff;
  z-index: 11;
}

.scroll-arrow.left {
  left: 0;
}

.scroll-arrow.right {
  right: 0;
}

.scroll-arrow:hover {
  color: #007bff;
}

.location-filters {
  width: 100%;
  padding: 10px;
  box-sizing: border-box;
  background-color: #f8f8f8;
  display: none;
  flex-wrap: nowrap;
  justify-content: space-between;
  gap: 10px;
  position: relative;
  border-bottom: 1px solid #ccc;
  min-height: 56px;
  transition: top 0.3s ease;
  will-change: transform;
}

.location-filters select {
  flex: 1;
  padding: 8px;
  font-size: 16px;
  height: 36px;
  line-height: 1.5;
  border: 1px solid #ddd;
  border-radius: 4px;
  box-sizing: border-box;
  min-width: 0;
  background-color: #fff;
  transition: background-color 0.3s;
  appearance: menulist;
  position: relative;
  color: #333;
}

.location-filters select:hover {
  background-color: #e6f0ff;
}

.location-filters select.active {
  background-color: #e6f0ff;
}

.location-filters select.selected {
  background-color: #007bff;
  color: #fff;
}

.location-filters select:focus {
  outline: none;
}

.main-content::after {
  content: '';
  display: block;
  height: 200px;
}

.nav-divider {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 1px;
  height: 24px;
  background-color: #ccc;
  margin: 0 12px;
}

.sub-nav .nav-divider {
  margin: 0 12px;
  align-items: center;
  height: 24px;
}

.category-nav li.nav-divider-li {
  margin: 0;
  padding: 0;
  display: flex;
  align-items: center;
}

.rpp-nation-text {
  display: none;
  width: 100%;
  padding: 10px 30px;
  box-sizing: border-box;
  background-color: #f8f8f8;
  font-family: 'Roboto', sans-serif;
  font-size: 14px;
  color: #333;
  line-height: 1.5;
  border-bottom: 1px solid #ccc;
}

.rpp-nation-text.show {
  display: block;
}

.directory-content {
  display: none;
  flex: 1;
  flex-direction: row;
  width: 100%;
  min-height: calc(100vh - 44px);
  height: 100%;
  overflow-x: hidden;
  overflow-y: clip;
  margin-top: 0px;
}

.directory-left-column {
  flex: 1;
  overflow-y: auto;
  background-color: #fff;
  padding: 0 10px 10px 10px;
  position: relative;
  min-height: 100%;
  scrollbar-width: thin;
}

.directory-left-column::-webkit-scrollbar {
  width: 2px !important;
}

.directory-left-column::-webkit-scrollbar-track {
  background: rgba(255, 255, 255, 0.1) !important;
}

.directory-left-column::-webkit-scrollbar-thumb {
  background: rgba(0, 0, 0, 0.2) !important;
  border-radius: 2px !important;
}

.directory-left-column::-webkit-scrollbar-thumb:hover {
  background: rgba(0, 0, 0, 0.3) !important;
}

.directory-left-column {
  scrollbar-width: thin;
  scrollbar-color: rgba(0, 0, 0, 0.2) rgba(255, 255, 255, 0.1);
}

.sticky-date-header {
  position: sticky;
  top: 0;
  background-color: #ffffff;
  padding: 8px 15px;
  margin: 0;
  border-bottom: 2px solid #007bff;
  z-index: 5;
  font-size: 16px;
  font-weight: bold;
  color: #333;
  display: flex;
  justify-content: flex-end;
  align-items: center;
  min-height: 40px;
  opacity: 1;
  visibility: visible;
}

.sticky-date-header .date {
  display: inline-block;
  color: #000000;
  font-size: 16px;
  line-height: 1.2;
  opacity: 1;
  visibility: visible;
  text-align: right;
}

.directory-list {
  position: relative;
  margin-top: 0;
  scrollbar-width: none;
}

.directory-list::-webkit-scrollbar {
  display: none;
}

.directory-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 12px 15px;
  border-bottom: 1px solid #ddd;
  cursor: pointer;
  transition: background-color 0.3s ease;
}

.directory-item:hover {
  background-color: #e6f0ff;
}

.directory-item.selected {
  background-color: #007bff;
  color: #fff;
}

.festival-name {
  font-size: 14.25px;
  font-weight: bold;
  color: #333;
  flex: 1;
}

.festival-location {
  font-size: 12px;
  color: #666;
  text-align: right;
  flex-shrink: 0;
}

.directory-item.selected .festival-name,
.directory-item.selected .festival-location,
.directory-item.selected .date {
  color: #fff;
}

.date {
  font-size: 10px;
  color: #666;
  min-width: 100px;
  display: inline-block;
  margin-right: 4px;
}

.directory-divider {
  width: 6px;
  background-color: #e0e0e0;
  cursor: ew-resize;
  margin: 0;
}

.directory-divider:hover {
  background-color: #d0d0d0;
}

.directory-right-column {
  flex: 1;
  overflow-y: auto;
  overflow-x: hidden;
  background-color: #f8f8f8;
  padding: 0px;
  padding-bottom: 120px;
  min-height: 1000px;
  box-sizing: border-box;
}

.directory-right-column::-webkit-scrollbar {
  width: 2px !important;
}

.directory-right-column::-webkit-scrollbar-track {
  background: rgba(255, 255, 255, 0.1) !important;
}

.directory-right-column::-webkit-scrollbar-thumb {
  background: rgba(0, 0, 0, 0.2) !important;
  border-radius: 2px !important;
}

.directory-right-column::-webkit-scrollbar-thumb:hover {
  background: rgba(0, 0, 0, 0.3) !important;
}

.directory-right-column {
  scrollbar-width: thin;
  scrollbar-color: rgba(0, 0, 0, 0.2) rgba(255, 255, 255, 0.1);
}

.directory-right-column.apple-music-active {
  width: 100%;
  max-width: 100%;
  overflow-x: hidden;
  padding-bottom: 0;
  margin-bottom: 0;
  min-height: auto;
}

.directory-right-column.apple-music-active::-webkit-scrollbar {
  width: 2px !important;
}

.directory-right-column.apple-music-active::-webkit-scrollbar-track {
  background: rgba(255, 255, 255, 0.1) !important;
}

.directory-right-column.apple-music-active::-webkit-scrollbar-thumb {
  background: rgba(0, 0, 0, 0.2) !important;
  border-radius: 2px !important;
}

.directory-right-column.apple-music-active::-webkit-scrollbar-thumb:hover {
  background: rgba(0, 0, 0, 0.3) !important;
}

.directory-right-column.apple-music-active {
  scrollbar-width: thin;
  scrollbar-color: rgba(0, 0, 0, 0.2) rgba(255, 255, 255, 0.1);
}

.directory-right-column .apple-music-player .main-content {
  padding: 0;
  margin: 0;
  margin-bottom: 0;
}

.directory-right-column .apple-music-player .content-columns {
  height: auto;
  margin-bottom: 0;
}

.directory-right-column .apple-music-player .player {
  position: relative;
  bottom: auto;
  border-radius: 8px;
  box-shadow: none;
  margin-bottom: 0;
}

.directory-details {
  font-size: 14px;
  color: #333;
}

.directory-details img {
  width: 100%;
  height: auto;
  max-width: none;
  object-fit: contain;
  display: block;
  border-radius: 0;
  margin-bottom: 10px;
  margin-top: 3px;
  margin-left: 3px;
  margin-right: 3px;
}

.directory-details h2 {
  font-size: 20px;
  margin-bottom: 25px;
  margin-top: 15px;
  color: #007bff;
  padding-left: 20px;
}

.directory-details h3 {
  font-size: 16px;
  color: #666;
  margin-top: 30px;
  margin-bottom: 8px;
  padding-left: 20px;
}

.directory-details hr {
  border: none;
  border-top: 1px solid #000;
  margin: 8px 10px;
}

.directory-details p {
  margin: 8px 0;
  line-height: 1.5;
  padding-left: 40px;
}

.directory-details .detail-row {
  display: flex;
  align-items: flex-start;
  margin: 8px 0;
  padding-left: 40px;
}

.directory-details .detail-row strong {
  flex: 0 0 120px;
  text-align: left;
  margin-right: 10px;
}

.directory-details .indented-content {
  flex: 1;
}

.directory-details .social-links {
  list-style: none;
  padding: 0;
  margin: 0;
  padding-top: 0;
}

.directory-details .social-links li {
  margin: 2px 0;
  line-height: 1.2;
  padding-left: 40px;
}

.directory-details a {
  color: #007bff;
  text-decoration: none;
  transition: text-decoration 0.3s ease;
}

.directory-details a:hover {
  text-decoration: underline;
}

.error-message {
  display: none;
  position: fixed;
  top: 10px;
  right: 10px;
  background-color: #ffe6e6;
  border: 1px solid #cc0000;
  padding: 10px;
  border-radius: 4px;
  z-index: 1000;
  max-width: 400px;
  font-size: 14px;
  color: #333;
}

.error-message.show {
  display: block;
}

/* -------------------------------------------------
   MEDIA HEADER – Title left, buttons right
   ------------------------------------------------- */
.media-header-container {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding-left: 20px;
  margin-top: 30px;
  margin-bottom: 8px;
  gap: 12px;
}

/* Button group on the far right */
.media-header-container .button-group {
  display: flex;
  align-items: center;
  gap: 8px;
}

/* Media Mode Button */
#media-mode-button {
  padding: 0 12px;
  font-size: 16px;
  color: #333;
  background-color: #fff;
  border: 1px solid #ccc;
  border-radius: 4px;
  cursor: pointer;
  transition: color 0.3s, background-color 0.3s;
  line-height: 1.5;
  height: fit-content;
  align-self: center;
  margin-top: 22px;
}

#media-mode-button:hover {
  color: #007bff;
  background-color: #e6f0ff;
}

#media-mode-button.active {
  background-color: #007bff !important;
  color: #fff !important;
}

/* Eye Preview Button - Only in DOM when Media Mode is ON */
#eye-preview-button {
  padding: 4px 12px;
  font-size: 16px;
  color: #333;
  background-color: #fff;
  border: 1px solid #ccc;
  border-radius: 4px;
  cursor: pointer;
  transition: color 0.3s, background-color 0.3s;
  line-height: 1.5;
  margin-top: 22px;
  height: fit-content;
  align-self: center;
  display: flex;
  align-items: center;
  justify-content: center;
}

#eye-preview-button:hover {
  color: #007bff;
  background-color: #e6f0ff;
}

#eye-preview-button.active {
  background-color: #007bff !important;
  color: #fff !important;
}

/* Thin eye icon */
#eye-preview-button i {
  font-size: 15px;
  opacity: 0.9;
  font-family: 'Font Awesome 6 Free';
  font-weight: 400;
}

#eye-preview-button:hover i {
  opacity: 1;
}

/* Ensure single-item sub-navs have proper spacing */
.sub-nav.festivals-sub-nav ul,
.sub-nav.rpp-nation-sub-nav ul {
  padding: 0 30px;
  display: flex;
  align-items: center;
}

/* Ensure My Favorites link is styled consistently */
.sub-nav a[href="#my-favorites"] {
  font-weight: 500;
  color: #333;
  padding: 8px 12px;
  transition: color 0.3s, background-color 0.3s;
}

.sub-nav a[href="#my-favorites"]:hover {
  color: #007bff;
  background-color: #e6f0ff;
}

.sub-nav a[href="#my-favorites"].active {
  background-color: #007bff !important;
  color: #fff !important;
  border-radius: 4px !important;
}

/* Hide scroll arrows for single-item sub-navs */
.sub-nav.festivals-sub-nav .scroll-arrow,
.sub-nav.rpp-nation-sub-nav .scroll-arrow {
  display: none;
}

/* Mobile adjustments */
@media (max-width: 768px) {
  body {
    flex-direction: column;
    height: auto;
  }

  .main-content {
    width: 100%;
    height: auto;
    overflow-y: auto;
    top: 44px;
  }

  .directory-right-column.apple-music-active .main-content {
    top: 0;
    height: auto;
  }

  .directory-header img {
    width: 100%;
    height: auto;
    display: block;
    border: none;
  }

  .location-filters {
    flex-direction: column;
    gap: 5px;
    min-height: 126px;
  }

  .location-filters select {
    width: 100%;
    height: 42px;
    line-height: 1.5;
    padding: 8px;
    font-size: 16px;
  }

  .search-bar {
    flex-wrap: wrap;
    justify-content: space-between;
  }

  .search-bar input[type="text"] {
    flex: 1 1 100%;
    border-radius: 4px;
    margin-right: 0;
    margin-bottom: 8px;
  }

  .search-bar button {
    flex: 0 0 auto;
    border-radius: 4px;
    padding: 8px 16px;
    line-height: 1.5;
  }

  .search-bar #reset-search {
    margin-right: 8px;
    margin-bottom: 0;
  }

  .search-bar #add-to-directory {
    margin-left: auto;
    margin-bottom: 0;
    padding: 8px 16px;
    line-height: 1.5;
  }

  .nav-divider {
    height: 20px;
    margin: 0 8px;
  }

  .rpp-nation-text {
    padding: 8px 15px;
    font-size: 14px;
  }

  .directory-content {
    flex-direction: column;
  }

  .directory-left-column,
  .directory-right-column {
    flex: none;
    width: 100%;
    max-height: 50vh;
    scrollbar-width: thin;
  }

  .directory-left-column::-webkit-scrollbar,
  .directory-right-column::-webkit-scrollbar {
    width: 2px !important;
  }

  .directory-left-column::-webkit-scrollbar-track,
  .directory-right-column::-webkit-scrollbar-track {
    background: rgba(255, 255, 255, 0.1) !important;
  }

  .directory-left-column::-webkit-scrollbar-thumb,
  .directory-right-column::-webkit-scrollbar-thumb {
    background: rgba(0, 0, 0, 0.2) !important;
    border-radius: 2px !important;
  }

  .directory-left-column::-webkit-scrollbar-thumb:hover,
  .directory-right-column::-webkit-scrollbar-thumb:hover {
    background: rgba(0, 0, 0, 0.3) !important;
  }

  .directory-left-column {
    padding: 0 10px 10px 10px;
  }

  .sticky-date-header {
    font-size: 16px;
    padding: 6px 12px;
    min-height: 36px;
  }

  .sticky-date-header .date {
    font-size: 16px;
  }

  .directory-divider {
    width: 100%;
    height: 6px;
    cursor: ns-resize;
    margin: 10px 0;
  }

  .directory-divider:hover {
    background-color: #d0d0d0;
  }

  .directory-details h2 {
    font-size: 18px;
    padding-left: 20px;
  }

  .directory-details h3 {
    font-size: 14px;
    margin-top: 15px;
    margin-bottom: 6px;
    padding-left: 20px;
  }

  .directory-details hr {
    margin: 6px 0;
  }

  .directory-details p {
    padding-left: 20px;
    font-size: 12px;
  }

  .directory-details .detail-row {
    padding-left: 10px;
  }

  .directory-details .detail-row strong {
    flex: 0 0 100px;
    text-align: left;
    margin-right: 8px;
  }

  .directory-details .social-links {
    padding: 0;
    margin: 0;
    padding-top: 0;
  }

  .directory-details .social-links li {
    margin: 2px 0;
    line-height: 1.2;
  }

  .directory-details img {
    width: 100%;
    height: auto;
    max-width: none;
    object-fit: contain;
    display: block;
    border-radius: 0;
    margin-bottom: 10px;
  }

  .error-message {
    max-width: 90%;
    font-size: 12px;
  }

  .media-header-container {
    padding-left: 20px;
  }

  .category-nav,
  .sub-nav {
    padding: 7px 0;
    min-height: 34px;
    max-height: 34px;
    overflow: hidden;
    overflow-y: clip;
  }

  .category-nav a,
  .sub-nav a {
    font-size: 14px;
    padding: 6px 12px;
  }
}

/* Media Mode Styles */
body.media-mode .main-content {
  top: 0 !important;
  height: 100vh !important;
  padding-top: 148px !important; 
  overflow-y: auto !important;
}

body.media-mode .main-content .search-bar {
  position: fixed !important;
  top: 44px !important; 
  z-index: 12 !important;
  background-color: #f8f8f8 !important;
  width: 100% !important;
}

body.media-mode .main-content .directory-header {
  display: none !important;
}

body.media-mode .main-content .category-nav {
  position: fixed !important;
  top: 106px !important;
  z-index: 11 !important;
  background-color: #fff !important;
  width: 100% !important;
  height: 42px !important;
  min-height: 42px !important;
  max-height: 42px !important;
  overflow: hidden !important;
  contain: strict;
  will-change: transform;
}

.media-tabs li.active {
  background: linear-gradient(320deg, #FF6B6B, #FF3E3E);
  color: white;
  font-weight: 500;
  transform: scale(1.05);
}

body.media-mode .main-content .sub-nav[style*="display: block"] {
  position: fixed !important; 
  z-index: 10 !important;
  background-color: #fff !important;
  height: 42px !important;
  min-height: 42px !important;
  max-height: 42px !important;
  overflow: hidden !important;
  contain: strict;
  will-change: transform;
}

body.media-mode .main-content .location-filters[style*="display: flex"] {
  position: sticky !important;
  top: 42px !important; 
  z-index: 9 !important;
  background-color: #f8f8f8 !important;
  padding: 10px !important;
  min-height: 56px !important;
  will-change: transform;
}

body.media-mode .main-content .directory-content {
  position: fixed !important;
  top: 247px !important;
  margin-top: 0 !important; 
  padding-top: 0 !important;
}

body.media-mode .directory-right-column .directory-details > *:not(.media-tabs, .media-header-container, hr.media-divider) {
  display: none !important;
}

body.media-mode .directory-right-column .media-tab-content.active {
  max-height: none !important;
  height: calc(100vh - 148px) !important;
  overflow-y: auto !important;
}

body.media-mode .media-header-container {
  margin-top: -14px;
}

/* Dynamic adjustments for hidden sub-nav/location-filters */
body.media-mode .main-content:not(:has(.sub-nav[style*="display: block"])):not(:has(.location-filters[style*="display: flex"])) {
  padding-top: 148px !important;
}

body.media-mode .main-content:has(.sub-nav[style*="display: block"]):not(:has(.location-filters[style*="display: flex"])) {
  padding-top: 148px !important; 
}

body.media-mode .directory-right-column .media-tab-content.active:not(:has(.sub-nav[style*="display: block"])):not(:has(.location-filters[style*="display: flex"])) {
  height: calc(100vh - 148px) !important; 
}

body.media-mode .directory-right-column .media-tab-content.active:has(.sub-nav[style*="display: block"]):not(:has(.location-filters[style*="display: flex"])) {
  height: calc(100vh - 148px) !important; 
}

@media (max-width: 768px) {
  body.media-mode .main-content {
    height: auto !important;
    padding-top: 130px !important;
  }

  body.media-mode .main-content .category-nav {
    top: 96px !important; 
    height: 34px !important;
    min-height: 34px !important;
    max-height: 34px !important;
    contain: strict;
  }

  body.media-mode .main-content .sub-nav[style*="display: block"] {
    position: fixed !important; 
    top: -34px !important;
    height: 34px !important;
    min-height: 34px !important;
    max-height: 34px !important;
    contain: strict;
  }

  body.media-mode .main-content .location-filters[style*="display: flex"] {
    top: 130px !important; 
    min-height: 126px !important;
  }

  body.media-mode .main-content .directory-content {
    position: relative !important;
    top: 130px !important;
    margin-top: 0 !important; 
    padding-top: 0 !important; 
  }

  body.media-mode .directory-right-column .media-tab-content.active {
    height: calc(50vh - 130px) !important;
  }

  body.media-mode .main-content:not(:has(.sub-nav[style*="display: block"])):not(:has(.location-filters[style*="display: flex"])) {
    padding-top: 130px !important;
  }

  body.media-mode .main-content:has(.sub-nav[style*="display: block"]):not(:has(.location-filters[style*="display: flex"])) {
    padding-top: 130px !important; 
  }

  body.media-mode .directory-right-column .media-tab-content.active:not(:has(.sub-nav[style*="display: block"])):not(:has(.location-filters[style*="display: flex"])) {
    height: calc(50vh - 130px) !important; 
  }

  body.media-mode .directory-right-column .media-tab-content.active:has(.sub-nav[style*="display: block"]):not(:has(.location-filters[style*="display: flex"])) {
    height: calc(50vh - 130px) !important; 
  }

  body.media-mode .media-header-container {
    /* Add your mobile-specific styles for the existing media-header-container class here */
  }
}
/* -------------------------------------------------
   MEDIA EYE POPUP
   ------------------------------------------------- */
.media-eye-popup {
  position: fixed;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  background: rgba(0, 0, 0, 0.92);
  color: #fff;
  padding: 2.5rem 2rem;
  font-size: 1.5rem;
  font-weight: bold;
  border-radius: 16px;
  box-shadow: 0 12px 40px rgba(0, 0, 0, 0.6);
  z-index: 2000;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.25s ease, visibility 0.25s ease;
  text-align: center;
  pointer-events: none;
  user-select: none;
  min-width: 280px;
  max-width: 90vw;
}

.media-eye-popup.show {
  opacity: 1;
  visibility: visible;
  pointer-events: auto;
}

.media-eye-popup .popup-title {
  margin: 0 0 1.5rem;
  font-size: 1.6rem;
  font-weight: 700;
}

.media-eye-popup .popup-buttons {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.media-eye-popup .popup-btn {
  background: #007bff;
  color: #fff;
  border: none;
  padding: 0.75rem 1rem;
  font-size: 1rem;
  font-weight: 500;
  border-radius: 8px;
  cursor: pointer;
  transition: all 0.2s ease;
  width: 100%;
  box-sizing: border-box;
  position: relative;
}

.media-eye-popup .popup-btn:hover {
  background: #0056b3;
}

.media-eye-popup .popup-btn:active {
  transform: translateY(1px);
}

.media-eye-popup .popup-btn.selected {
  background: #28a745;
  box-shadow: 0 0 0 3px rgba(40, 167, 69, 0.4);
  font-weight: 600;
}

.media-eye-popup .popup-btn.selected:hover {
  background: #218838;
}
/* -------------------------------------------------
   EYE-PREVIEW MODE (Media Mode + Eye button)
   ------------------------------------------------- */
body.media-mode.eye-preview .main-content {
  padding-top: 44px !important;               /* only navbar */
}

/* hide the four blocks */
body.media-mode.eye-preview .search-bar,
body.media-mode.eye-preview .category-nav,
body.media-mode.eye-preview .sub-nav,
body.media-mode.eye-preview .location-filters {
  display: none !important;
}

/* directory-content sticks to the bottom, top glued to navbar */
body.media-mode.eye-preview .directory-content {
  position: fixed !important;
  top: 44px !important;                       /* navbar height */
  bottom: 0 !important;
  left: 0 !important;
  right: 0 !important;
  height: auto !important;
  margin-top: 0 !important;
  overflow-y: hidden !important;
}

/* make the right column fill the new height */
body.media-mode.eye-preview .directory-right-column .media-tab-content.active {
  height: auto !important;
}

body.media-mode.eye-preview .directory-right-column {
  overflow: visible !important;
}

/* mobile – same logic, just a little less height */
@media (max-width: 768px) {
  body.media-mode.eye-preview .directory-content {
    top: 44px !important;
  }
  body.media-mode.eye-preview .directory-right-column .media-tab-content.active {
    height: calc(100vh - 44px) !important;
  }
}

/* Eye button – match Media Mode active style */
#eye-preview-button.active {
  background-color: #007bff !important;
  color: #fff !important;
}

/* Closed eye icon when preview is ON */
#eye-preview-button.active i::before {
  content: "\f070"; /* Font Awesome "eye-slash" */
}
/* Smooth animation when eye-preview toggles */
body.media-mode .main-content,
body.media-mode .directory-content,
body.media-mode .search-bar,
body.media-mode .category-nav,
body.media-mode .sub-nav,
body.media-mode .location-filters {
  transition: all 0.35s ease;
}

/* Ensure fixed-positioned directory-content animates smoothly */
body.media-mode.eye-preview .directory-content {
  transition: top 0.35s ease, padding 0.35s ease;
}
body.media-mode .main-content,
body.media-mode .directory-content {
  transition: all 0.35s cubic-bezier(0.4, 0, 0.2, 1);
}





/* === MEDIA MODE: FIX LEFT COLUMN SCROLL === */
body.media-mode .directory-content {
  display: flex !important;
  flex-direction: row;
  width: 100%;
  height: calc(100vh - 247px) !important; /* Match top: 247px */
  overflow: hidden !important;
}

body.media-mode:not(.eye-preview) .directory-list {
  height: calc(100% - 234px);
  overflow-y: auto;
  scrollbar-width: none;
}

body.media-mode:not(.eye-preview) .directory-list::-webkit-scrollbar {
  display: none;
}

body.media-mode.eye-preview .directory-list {
    height: calc(100% - 31px);
    overflow-y: auto;
    scrollbar-width: none;
}

body.media-mode.eye-preview .directory-list::-webkit-scrollbar {
  display: none;
}

body:not(.media-mode) .directory-left-column {
  scrollbar-width: none;
}

body:not(.media-mode) .directory-left-column::-webkit-scrollbar {
  display: none;
}

body.media-mode .directory-right-column {
  flex: 1;
  overflow: hidden !important;
  height: 100% !important;
}

/* Ensure scrollbars are styled */
body.media-mode .directory-left-column::-webkit-scrollbar {
  width: 2px !important;
}
body.media-mode .directory-left-column::-webkit-scrollbar-track {
  background: rgba(255, 255, 255, 0.1) !important;
}
body.media-mode .directory-left-column::-webkit-scrollbar-thumb {
  background: rgba(0, 0, 0, 0.2) !important;
  border-radius: 2px !important;
}
body.media-mode .directory-left-column::-webkit-scrollbar-thumb:hover {
  background: rgba(0, 0, 0, 0.3) !important;
}
body.media-mode .directory-left-column {
  scrollbar-width: thin;
  scrollbar-color: rgba(0, 0, 0, 0.2) rgba(255, 255, 255, 0.1);
}
@media (max-width: 768px) {
  body.media-mode .directory-content {
    height: calc(100vh - 130px) !important; /* Matches mobile top offset */
    top: 130px !important;
  }
}