@font-face {
  font-family: 'MinervaModern';
  src: url('fonts/MinervaModern-Regular.woff2') format('woff2');
  font-style: normal;
}

:root {
  --primary-color: #ffffff; /* Ensure sufficient contrast */
  --secondary-color: #444444; /* Ensure sufficient contrast */
  --tertiary-color: var(--theme-tertiary-color, #ff0059); /* Dynamic accent color for buttons */
  --background-image: url('assets/bg_12.jpg');
  --sidebar-width: 20%;
  --sidebar-background-color: rgba(0, 0, 0, 0);
  --sidebar-button-hover-color: rgba(255, 255, 255, 0.2);
  --sidebar-button-padding: 15px;
  --chat-background-color: rgba(0, 0, 0, 0.6);
  --chat-placeholder: "Ask me anything...";
  --chat-font-size: 0.87em;
  --chat-line-spacing: 1.5;
  --video-placeholder: url('assets/Explainer_AI_text 2.png');
  --video-border-color: rgba(255, 255, 255, 0.7);
  --video-shadow: 0 0 10px rgba(0, 0, 0, 0.5);
  --video-aspect-ratio: 16 / 9;
  --suggestions-box-background-color: rgba(0, 0, 0, 0);
  --thumbnail-border-color: #444;
  --thumbnail-hover-scale: 1.1;
  --scrollbar-track-color: rgba(255, 255, 255, 0.1);
  --scrollbar-thumb-color: rgba(255, 255, 255, 0.3);
  --scrollbar-thumb-hover-color: rgba(255, 255, 255, 0.5);
  --font-family: 'MinervaModern', Arial, sans-serif;
  --font-size: 25px;
  --sidebar-button-border-width: 2px; /* Default value */
}

body {
  font-family: var(--font-family);
  font-size: var(--font-size);
  margin: 0;
  height: 100%;
  display: flex;
  flex-direction: column;
  background: var(--background-image) no-repeat center center fixed;
  background-size: cover;
  color: var(--primary-color);
  overflow: hidden; /* Prevent scrollbars from appearing */
  @media (max-width: 768px) {
    flex-direction: column;
    overflow: auto; /* Allow scrolling on smaller screens */
  }
  position: relative;
  background-color: #000; /* Add solid black base */
  background-image: var(--background-image);
  background-repeat: no-repeat;
  background-position: center center;
  background-size: cover;
  background-attachment: fixed;
}

body.transitioning-background {
  transition: background-image 0.5s ease-in-out;
}

  /*.header {
    display: flex;
    justify-content: space-between;
    height: 60px; 
    background-color: white; 
    color: #444; 
    box-shadow: 0px 2px 5px rgba(0, 0, 0, 0.1); 
    position: fixed; 
    width: 100%; 
    top: 0;
    z-index: 1000; 
    transform-origin: top left; /* Anchor the scaling to the top-left corner 
    transform: scale(1); /* Prevent scaling with browser zoom 
}*/

#loading-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-color: rgba(0, 0, 0, 1);
  color: white;
  display: flex;
  flex-direction: column; /* Stack items vertically */
  justify-content: center;
  align-items: center;
  z-index: 9999;
  opacity: 1;
  transition: opacity 0.5s ease-in-out; /* Smooth transition */
}

#loading-logo {
  width: 300px; /* Adjust the logo size as needed */
  height: auto;
  margin-bottom: 50px; /* Add some spacing below the logo */
}

#loading-overlay .spinner {
  border: 4px solid rgba(255, 255, 255, 0.3);
  border-top: 4px solid white;
  border-radius: 50%;
  width: 40px;
  height: 40px;
  animation: spin 1s linear infinite;
}

#loading-overlay[hidden] {
  display: none !important; /* Ensure it's properly hidden */
}

@keyframes spin {
  0% {
      transform: rotate(0deg);
  }
  100% {
      transform: rotate(360deg);
  }
}

@keyframes newButtonAppear {
  0% {
    opacity: 0;
    transform: translateX(-20px) scale(0.8);
    background: rgba(255, 255, 255, 0.2);
  }
  50% {
    opacity: 1;
    transform: translateX(0) scale(1.1);
    background: rgba(255, 255, 255, 0.3);
  }
  100% {
    opacity: 1;
    transform: translateX(0) scale(1);
    background: rgba(0, 0, 0, 0.292);
  }
}

@keyframes profileUpdate {
    0% {
        transform: translateX(-50%) scale(1);
        box-shadow: 0 0 0 0 rgba(0, 255, 204, 0.4);
    }
    50% {
        transform: translateX(-50%) scale(1.02);
        box-shadow: 0 0 20px rgba(0, 255, 204, 0.4);
    }
    100% {
        transform: translateX(-50%) scale(1);
        box-shadow: 0 0 0 0 rgba(0, 255, 204, 0);
    }
}

.profile-container.profile-update {
    animation: profileUpdate 0.5s ease-out forwards;
}

.profile-update-notification {
    position: fixed;
    bottom: 27px;
    left: calc(var(--sidebar-width) / 2);
    transform: translateX(-50%);
    width: 38px;
    height: 38px; /* Match width for perfect circle */
    background: rgba(0, 0, 0, 0.5);
    border-radius: 50%;
    opacity: 0;
    visibility: hidden;
    z-index: 998;
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 0; /* Remove any padding */
}

.checkmark {
    width: 22px; /* Slightly larger */
    height: 22px;
    position: relative;
    display: inline-block;
}

.checkmark::after {
    content: '';
    position: absolute;
    width: 100%;
    height: 100%;
    border-radius: 50%;
    border: 3px solid #00ffcc; /* Thicker border */
    animation: circle 0.6s ease-in-out;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%); /* Center properly */
}

.checkmark::before {
    content: '';
    position: absolute;
    left: 50%;
    top: 50%;
    width: 7px; /* Slightly wider */
    height: 13px; /* Slightly taller */
    border-right: 3px solid #00ffcc; /* Thicker checkmark */
    border-bottom: 3px solid #00ffcc; /* Thicker checkmark */
    transform: translate(-50%, -50%) rotate(45deg) scale(0);
    animation: check 0.4s ease-in-out 0.4s forwards;
}

@keyframes circle {
    0% {
        transform: translate(-50%, -50%) scale(0);
        opacity: 0;
    }
    50% {
        transform: translate(-50%, -50%) scale(1.1);
        opacity: 0.8;
    }
    100% {
        transform: translate(-50%, -50%) scale(1);
        opacity: 1;
    }
}

@keyframes check {
    0% {
        transform: translate(-50%, -50%) rotate(45deg) scale(0);
        opacity: 0;
    }
    100% {
        transform: translate(-50%, -50%) rotate(45deg) scale(1);
        opacity: 1;
    }
}

.logo img {
    height: 40px; /* Fixed height for the logo */
    width: auto; /* Keep aspect ratio */
}

.nav {
    flex: 1; /* Allow nav to take up space */
    margin: 0 20px; /* Add spacing around navigation */
}

.nav ul {
    list-style: none;
    display: flex;
    gap: 20px; /* Fixed gap between menu items */
    justify-content: flex-end;
    padding: 0;
    margin: 0;
}

.nav ul li {
    display: inline;
}

.nav ul li a {
  text-decoration: none;
  color: var(--secondary-color);
  font-size: 14px;
  font-weight: 500;
}

.nav ul li a:hover {
    color: #000; /* Slightly darker color on hover */
}

.header-buttons {
    display: flex;
    align-items: center;
}

.button {
    padding: 10px 15px;
    text-decoration: none;
    font-size: 14px; /* Fixed font size */
    font-weight: bold;
    text-align: center;
    margin-right: 30px;
}

.book-button {
    background-color: #f5f5f5; /* Light gray background */
    border: 1px solid #ddd;
    color: #444;
}

.book-button:hover {
    background-color: #e0e0e0; /* Slightly darker gray on hover */
}


  
  #container {
    display: flex;
    flex-direction: row;
    margin-top: 10px;
    height: calc(100vh - 80px);
    position: relative;
  }
  
  .sidebar {
    flex: 0 0 var(--sidebar-width);
    background-color: var(--sidebar-background-color);
    padding: var(--sidebar-button-padding);
    color: var(--primary-color);  
    overflow: visible;
    position: relative;
  }
  
  /* Sidebar content wrapper for auto-scaling */
  #sidebar-content-wrapper {
    display: flex;
    flex-direction: column;
    width: 100%;
    transform-origin: top center;
    position: relative;
    transition: transform 0.2s ease;
    min-width: 345px;
  }
  
  .sidebar .logo {
    display: flex;
    justify-content: center;
    align-items: center;
    /* margin-bottom: 20px;*/
    padding: 20px;
  }
  
  .sidebar .logo img {
    width: 100%;
    max-width: 100%;
    height: auto;
    border-radius: 5px;
    transition: opacity 0.3s ease-in-out;
  }
  
  .sidebar ul {
    list-style: none;
    padding: 0;
    margin-top: 20px;
  }
  
  .sidebar ul li {
    margin: 10px 0;
    opacity: 1;
    transition: opacity 0.5s ease-in-out;
  }

  .sidebar ul li.fade-out {
    opacity: 0;
  }
  
  .sidebar ul li button {
    background: rgba(0, 0, 0, 0.292);
    border: var(--sidebar-button-border-width, 2px) solid var(--primary-color);
    padding: 6px var(--sidebar-button-padding);
    width: 100%;
    max-height: 43px;
    min-height: 43px;
    text-align: left;
    line-height: 1.2;
    display: flex; /* Keep flex for alignment; text span inside will clamp */
    align-items: center;
    color: var(--primary-color);
    font-weight: bold;
    border-radius: 5px;
    cursor: pointer;
    transition: all 0.3s ease-in-out;
    opacity: 0; /* Start invisible */
    @media (max-width: 768px) {
      padding: 10px; /* Adjust padding for smaller screens */
    }
  }

  /* MULTI-LINE CLAMP (max 2 lines) for dynamic width buttons */
  .sidebar-btn .sidebar-btn-text {
    flex: 1 1 auto;
    display: -webkit-box;
    -webkit-line-clamp: 2; /* WebKit */
    line-clamp: 2; /* Standard draft */
    -webkit-box-orient: vertical;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: normal; /* allow wrapping */
    word-break: break-word;
    line-height: 1.2; /* sync with button line-height */
    /* Fallback max-height ensures no more than 2 lines if clamp unsupported */
    max-height: calc(1.2em * 2);
  }
  @supports not (-webkit-line-clamp: 2) {
    .sidebar-btn .sidebar-btn-text {
      display: block; /* JS will further truncate if needed */
    }
  }

  .sidebar-btn.visible {
    opacity: 1 !important; /* Force visibility */
    transition: opacity 0.3s ease-in-out, background 0.3s ease-in-out, color 0.3s ease-in-out;
  }

  .sidebar ul li button.fade-in {
    opacity: 0;
    transition: opacity 0.3s ease-in-out;
  }

  .sidebar ul li button.fade-in.visible {
    opacity: 1;
  }
  
  .sidebar ul li button:hover {
    background: var(--sidebar-button-hover-color);
    color: white;
    border-color: white;
  }

  .sidebar ul li button.new-suggestion {
    animation: newButtonAppear 0.5s ease-out forwards;
    border-color: rgba(255, 255, 255, 0.8);
    box-shadow: 0 0 10px rgba(255, 255, 255, 0.2);
    transition: all 0.3s ease-in-out; /* Add transition for hover effects */
  }

  .sidebar ul li button.new-suggestion:hover,
  .sidebar ul li button.existing-suggestion:hover,
  .sidebar ul li button:hover {
    background: var(--sidebar-button-hover-color) !important;
    color: white !important;
    border-color: white !important;
  }

  .sidebar ul li button.existing-suggestion {
    opacity: 1;
    transition: all 0.3s ease-in-out;
  }

  #book-now-button {
    background-color: #ffffffb3; /* Golden yellow */
    color: black;
    border: none;
    padding: 15px;
    font-size: 18px;
    font-weight: bold;
    border-radius: 5px;
    text-align: center;
    cursor: pointer;
    margin-top: 50px;
    transition: background-color 0.3s ease, transform 0.2s ease;
    width: calc(100% - 20px); /* Match other buttons' width */
    margin-left: 10px;
}

#book-now-button:hover {
    background-color: #00e6b4;
    transform: scale(1.05); /* Slight zoom effect */
}

  .video-suggestions {
    position: relative;
    visibility: hidden; /* Hidden by default */
    opacity: 0;
    flex: 1;
    max-width: 10%;
    background: var(--suggestions-box-background-color);
    color: var(--primary-color);
    padding-top: 5px;
    border-radius: 10px;
    box-shadow: 0 0 10px rgba(0, 0, 0, 0);
    margin: 1px;
    margin-right: 20px; /* Reduced from 40px */
    margin-top: 10px; /* Reduced from 20px */
    margin-left: -20px; /* Added to move closer to video */
    overflow-y: overlay;  /*Makes scrollbar overlay content */
    /*overflow-y: hidden;*/
    height: calc(65vh - 120px);
    position: relative;
    transition: opacity 0.3s ease, visibility 0.3s ease; /* Smooth transition */
    min-width: 165.5px;
    z-index: 1000;
  }

  .video-suggestions.visible {
    visibility: visible; /* Show the element */
    opacity: 1; /* Fully opaque */
}

.video-suggestions h3 {
    text-align: start;
    margin-bottom: 10px;
    font-size: 1.2em;
    letter-spacing: 1px;
    color: #f5f5f5;
    margin-left: 20px;
}

.video-suggestions ul {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  justify-content: center;
  padding: 0;
  margin: 0;
  list-style: none;
  margin-top: 20px;
  position: relative;
  height: auto; /* Maintain consistent height */
}

.video-suggestions ul li canvas {
  display: block;
  max-width: 100%;
  border-radius: 5px;
  border: 1px solid #444;
  transition: transform 0.3s ease;
}

.video-suggestions ul li {
  position: relative;
  display: flex;
  justify-content: center;
  align-items: center;
  width: 150px;
  height: 84px;
  overflow: hidden;
  margin: 0;
  padding-left: 5px;
  transition: opacity 0.3s ease; /* Smooth fade effect */
}

.video-suggestions ul li.fading {
  opacity: 0.5; /* Faded state */
}

.video-suggestions ul canvas,
.video-suggestions ul img,
.comparison-thumbnail {
  width: 80%;
  height: 80%;
  object-fit: cover;
  border-radius: 5px;
  border: 1px solid var(--thumbnail-border-color);
  transform: scale(1); /* Reset scale to prevent enlargement by default */
  transition: transform 0.3s ease, border-color 0.3s ease;
}

.video-suggestions ul canvas:hover,
.video-suggestions ul img:hover,
.comparison-thumbnail:hover {
  transform: scale(var(--thumbnail-hover-scale, 1.1)); /* Smooth zoom effect */
  border-color: var(--primary-color); /* Highlight border on hover */
}

/* Grid-specific styles 
.video-suggestions ul li.video-history-grid-item {
  border: 2px solid #3498db;  Blue border for grid items
  border-radius: 8px;
}

.video-suggestions ul li.video-history-grid-item:hover {
  border-color: #2980b9;  Darker blue on hover 
  box-shadow: 0 2px 8px rgba(52, 152, 219, 0.3); 
}*/

.grid-badge {
  position: absolute;
  top: 2px;
  right: 2px;
  background-color: #3498db;
  color: white;
  font-size: 8px;
  padding: 1px 3px;
  border-radius: 3px;
  font-weight: bold;
  z-index: 10;
}

.grid-badge::after {
  content: "GRID";
}

.thumbnail-title {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    color: white;
    font-size: 10px;
    padding: 2px 4px;
    text-align: center;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    font-family: Arial, sans-serif;
}

.video-suggestions::-webkit-scrollbar {
  width: 6px; 
  position: absolute; /* Keeps it inside */
  display: none;
}

.video-suggestions::-webkit-scrollbar-track {
  background: var(--scrollbar-track-color);
  border-radius: 5px; 
}

.video-suggestions::-webkit-scrollbar-thumb {
  background: var(--scrollbar-thumb-color);
  border-radius: 5px; 
}

.video-suggestions::-webkit-scrollbar-thumb:hover {
  background: var(--scrollbar-thumb-hover-color);
}

.video-suggestions::-webkit-scrollbar-thumb:active {
  background: rgba(255, 255, 255, 0.7); 
}

.hide-button {
  position: absolute;
  top: 5px;
  right: 10px;
  background: rgba(255, 255, 255, 0.3);
  color: white;
  border: none;
  border-radius: 50%;
  width: 40px;
  height: 20px;
  font-size: 12px;
  font-weight: bold;
  cursor: pointer;
  text-align: center;
  line-height: 20px;
  padding: 0;
}

.hide-button:hover {
  background: rgba(255, 255, 255, 0.6);
  color: black;
}

.expand-text {
  display: none; /* Hidden by default */
  font-size: 14px;
  font-weight: bold;
  color: white;
}

.video-suggestions.collapsed {
  height: 40px; /* Height for collapsed state */
  overflow: hidden;
  /*padding: 5px;
  padding-right: 5px;*/
}

.video-suggestions h3,
.video-suggestions ul {
  display: block; /* Default state */
}

.video-suggestions.collapsed ul {
  display: none; /* Hide content in collapsed state */
}

.video-suggestions.collapsed h3 {
  font-size: 0.9em; /* Smaller font in collapsed state */
  margin: 10px; /* Center align in the collapsed state */
  margin-right: 40px;
}

.toggle-button {
  position: absolute;
  top: 5px;
  right: 25px;
  background: rgba(0, 0, 0, 0.175);
  color: white;
  border: none;
  border-radius: 5px;
  padding: 5px 10px;
  font-size: 12px;
  font-weight: bold;
  cursor: pointer;
  z-index: 2;
  transition: background 0.3s ease;
}

.toggle-button:hover {
  background: rgba(255, 255, 255, 0.6);
  color: black;
}

.toggle-button img {
  transition: transform 0.3s ease; /* Smooth rotation */
}

.toggle-button img.rotate {
  transform: rotate(180deg); /* Adjust based on the desired rotation */
}

@keyframes fadeIn {
  from {
      opacity: 0;
      transform: scale(0.8);
  }
  to {
      opacity: 1;
      transform: scale(1);
  }
}

.thumbnail-appear {
  animation: fadeIn 0.5s ease-in-out; /* Animation duration and easing */
}

  
  .main-content {
    flex: 4;
    display: flex;
    flex-direction: row;
    justify-content: flex-start;
    padding: 0px;
    position: relative;
  }

  

  .controls button {
    position:relative;
    background: rgba(0, 0, 0, 0.292);
    border: 2px solid white;
    padding: 10px 10px; /* Adjust padding for uniform button size */
    width: 50px; /* Fixed width */
    text-align: center;
    font-size: x-large;
    color: white;
    font-weight: bold;
    border-radius: 5px;
    cursor: pointer;
    transition: all 0.3s ease-in-out;
    margin-bottom: 10px;
    top: 300px;
  }

  .voice-control button {
    position: absolute;
    bottom: -60px; /* Adjust this value to place it just below the Explainer AI bubble */
    right: 100px; /* Adjust this value to align with the bubble */
    background: rgba(0, 0, 0, 0.292);
    border: 2px solid white;
    padding: 10px 10px; /* Adjust padding for uniform button size */
    width: 50px; /* Fixed width */
    text-align: center;
    color: white;
    font-weight: bold;
    font-size: x-large;
    border-radius: 5px;
    cursor: pointer;
    transition: all 0.3s ease-in-out;
    margin-bottom: 10px;  
  }
  
  .controls button:hover,
  .voice-control button:hover {
    background: #ffffffcc;
  }
  
.voice-control, .fullscreen-control, .darkmode-control, .playpause-control {
    position: absolute;
    bottom: -60px; /* Adjust this value to place it just below the Explainer AI bubble */
    right: 100px; /* Adjust this value to align with the bubble */
    background: rgba(0, 0, 0, 0.292);
    border: 2px solid white;
    padding: 10px 10px; /* Adjust padding for uniform button size */
    width: 50px; /* Fixed width */
    text-align: center;
    color: white;
    font-weight: bold;
    font-size: x-large;
    border-radius: 5px;
    cursor: pointer;
    transition: all 0.3s ease-in-out;
    margin-bottom: 10px;  
    z-index: auto; /* Add this to prevent z-index stacking context issues */
}

.voice-control button:hover, .fullscreen-control button:hover, .darkmode-control button:hover, .playpause-control button:hover {
    background: #ffffffcc;
}

.video-section {
  position: relative;
  width: calc(90% - 40px); /* Match chatbox width */
  margin: 0 auto; /* Changed from margin-left to center */
  aspect-ratio: var(--video-aspect-ratio);
  background: rgba(0, 0, 0, 0.8);
  border: 3px solid var(--video-border-color);
  border-radius: 10px;
  box-shadow: var(--video-shadow);
  overflow: hidden;
  
}

/*.video-section + .chat-section {
  margin-top: calc(220px + 5px); /* Ensures space below the video section adjusts dynamically 
} */

.video-column {
  flex: 10; /* The video column takes 3 parts of the available space */
  display: flex;
  justify-content: center; /* Center the video horizontally */
  align-items: flex-start; /* Ensure alignment to the top */
  padding-top: 10px; /* Added space from top */
  position: relative;
  margin-bottom: 5px; /* Added space between video and chat */
}

#fullscreen-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.01); /* Dark overlay */
  z-index: 99; /* Below fullscreen video */
  pointer-events: none; /* Allow interaction with the video */
  visibility: hidden;
  opacity: 0;
  transition: opacity 0.3s ease; /* Smooth fade in/out */
}

#fullscreen-overlay.active {
  visibility: visible;
  opacity: 1;
}

.controls-column {
  display: flex;
  flex-direction: column; /* Stack buttons vertically */
  justify-content: flex-start; /* Align buttons to the top */
  align-items: center; /* Center buttons horizontally */
  gap: 10px; /* Minimal spacing between buttons */
  width: 80px; /* Adjust width to fit content */
  padding: 10px; /* Add some padding for spacing within the column */
  margin-left:-50px;
}

.video-section video {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: none; /* Hide video by default until playing */
}



.video-section img {
    position: absolute;
    top: 40%;
    left: 20px;
    width: 100%;
    height: 25%;
    object-fit: cover;
    z-index: 1;
}

.video-section video.playing {
    display: block;
}

.video-section img.hidden {
    display: none;
}

/* Hide all native controls */
#video-player::-webkit-media-controls {
  display: none !important;
}

#video-player::-webkit-media-controls-timeline {
  display: none !important;
}

/* Custom progress bar */
#video-progress-bar {
  display: none; /* Hidden by default */
  position: absolute;
  bottom: 10px;
  left: 10px;
  width: 97%;
  height: 5px;
  background: rgba(255, 255, 255, 0.7);
  border: none;
  border-radius: 5px;
  cursor: pointer;
  z-index: 5;
  appearance: none;
  box-shadow: 0px 2px 3px rgba(0, 0, 0, 0.7)!important;
}

#video-progress-bar::-webkit-slider-thumb {
  appearance: none;
  width: 10px;
  height: 10px;
  background: white;
  border-radius: 50%;
  cursor: pointer;
  position: relative;
  z-index: 10;
}

#video-progress-bar::-moz-range-thumb {
  width: 10px;
  height: 10px;
  background: white;
  border-radius: 50%;
  cursor: pointer;
  position: relative;
  z-index: 10;
}

/* ...existing code... */

#video-container {
  width: auto;
  height: 58%;
  margin: 0;
  margin-left: calc((-1 * var(--sidebar-width) / 2) + 100px);
  position: relative;
  transform-origin: center center;
  transition: height 0.3s ease, margin-left 0.3s ease;
  /* Add z-index to base state */
  z-index: 1;
}

#video-container.enlarged {
  height: 72%;
  margin-left: calc((-1 * var(--sidebar-width) / 2) + 50px);
  /* Delay z-index change until after transition */
  transition: height 0.3s ease, margin-left 0.3s ease, z-index 0s ease 0.3s;
  z-index: 100;
}

#video-container.very-large {
  height: 100%;
  margin-left: calc((-1 * var(--sidebar-width) / 2) - 0px);
  /* No delay on entering very-large state */
  transition: height 0.3s ease, margin-left 0.3s ease, z-index 0s ease;
  z-index: 1000;
}

/* Add transition class for exiting very-large state */
#video-container.leaving-very-large {
  /* Keep high z-index during transition */
  z-index: 1000;
  /* Delay z-index change until after transition */
  transition: height 0.3s ease, margin-left 0.3s ease, z-index 0s ease 0.3s;
}

/* ...existing code... */

/* Wide screens (1920px and above) */
@media screen and (min-width: 1920px) {
  #video-container.very-large {
    margin-left: calc((-1 * var(--sidebar-width) / 2) - 300px);
    height:95%;
  }
}

/* Medium screens (1440px to 1919px) */
@media screen and (max-width: 1919px) and (min-width: 1440px) {
  #video-container.very-large {
    margin-left: -300px;
  }
}

/* Smaller screens (below 1440px) */
@media screen and (max-width: 1439px) {
  #video-container.very-large {
    margin-left: -300px;
  }
}

/* Ensure video maintains aspect ratio */
#video-container video {
    width: 100%;
    height: 100%;
    object-fit: contain;
}

/* Overlay for very-large state */
.video-overlay {
  visibility: hidden;
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0);
  z-index: 999;
  opacity: 0;
  transition: visibility 0.5s cubic-bezier(0.4, 0, 0.2, 1),
              opacity 0.5s cubic-bezier(0.4, 0, 0.2, 1),
              background-color 0.5s cubic-bezier(0.4, 0, 0.2, 1);
  pointer-events: none;
}

.video-overlay.active {
  visibility: visible;
  opacity: 1;
  background: rgba(0, 0, 0, 0.8);
  pointer-events: auto;
}

.banner {
  position: relative;
  background-color: rgba(255, 255, 0, 0.403);
  color: rgb(255, 255, 255);
  text-align: center;
  padding: 10px;
  font-size: 13px;
  font-weight: bold;
  border-bottom: 2px solid black;
  width: 100%;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
  z-index: 20;
}
  
.chat-section {
    position: fixed;
    bottom: 0;
    left: calc(25% + 0px); /* Adjusted for sidebar */
    width: calc(60% - 40px); /* Adjust width accordingly */
    background-color: var(--chat-background-color);
    padding: 10px 20px;
    color: white;
    display: flex;
    flex-direction: column;
    justify-content: space-between; 
    border-top: 1px solid white;
    z-index: 5;
    box-sizing: border-box;
    border-radius: 5px;
    height: 43%; /* Adjusted height for a larger chatbox */
    margin-bottom: 15px;
    margin-top: 30px; /* Ensure spacing between the chat section and the video player */
    transition: height 0.2s ease-out, padding-bottom 0.2s ease-out;
}

.chat-section {
  transition: height 0.3s ease; /* Smooth transition for resizing */
}

.chat-section.smaller {
  height: 30%; /* Adjust the height to your desired value */
}

.chat-section.expanded {
  height: 600px; /* Expanded height to the middle of the screen */
  z-index: 1500;
}

.chat-section.expanded-input {
    padding-bottom: 10px; /* More space when input is expanded */
}

.toggle-chat-button {
  position: absolute;
  top: 1px; /* Align with the top edge of the chat box */
  right: -45px; /* Position outside to the right of the chat box */
  background-color: rgba(0, 0, 0, 0.3); /* Match chat box background */
  border: 1px solid rgba(255, 255, 255, 0.2); /* Light border for definition */
  border-radius: 10px; /* Rounded rectangle to match chat box */
  width: 35px;
  height: 25px;
  display: flex;
  justify-content: center;
  align-items: center;
  cursor: pointer;
  z-index: 101; /* Ensure it's above the chat section */
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.2); /* Subtle shadow for depth */
  transition: background-color 0.3s ease, transform 0.3s ease;
}

.toggle-chat-button:hover {
  background-color: #d5d5d5;
}

/* Optional: Add a transition for rotation */
.toggle-chat-button.rotate {
  transform: rotate(180deg);
  transition: transform 0.3s ease;
}

.clear-chat-button {
    position: absolute;
    top: 35px; /* Position it below the toggle button (30px height + 5px gap) */
    right: -45px; /* Same right alignment as toggle-chat-button */
    background-color: rgba(0, 0, 0, 0.3);
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 10px;
    width: 35px;
    height: 25px;
    display: flex;
    justify-content: center;
    align-items: center;
    cursor: pointer;
    z-index: 101;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.2);
    transition: background-color 0.3s ease, transform 0.3s ease;
}

.clear-chat-button:hover {
    background-color: rgba(220, 53, 69, 0.6); /* Reddish color on hover */
}

.clear-chat-button i {
    color: #ffffff;
    font-size: 14px;
}

.chat {
    display: block;
    overflow-y: auto; /* Enable scrolling */
    height: calc(100% - 60px); /* Adjust base height */
    transition: height 0.2s ease-out; /* Add smooth transition */
    background: rgba(0, 0, 0, 0.2); /* Slightly darker background for contrast */
    padding: 5px; /* Add padding for spacing */
    border-radius: 5px; /* Rounded corners */
    font-family: 'Roboto', Arial, sans-serif;
    font-size: var(--chat-font-size, 0.87em);
    line-height: var(--chat-line-spacing);
    color: white;
}
.chat p {
  margin: 0;
  padding: 4px;
}

.chat p:nth-child(odd) {
  background: rgba(255, 255, 255, 0.05); /* Subtle lighter shade */
}

.chat p:nth-child(even) {
  background: rgba(0, 0, 0, 0.05); /* Subtle darker shade */
}

.chat p {
  border-bottom: 1px solid rgba(255, 255, 255, 0.1); /* Thin separator line */
}

/* Style the scrollbar */
.chat::-webkit-scrollbar {
  width: 6px; /* Width of the scrollbar */
}

.chat::-webkit-scrollbar-track {
  background: rgba(255, 255, 255, 0.1); /* Track background */
  border-radius: 5px; /* Rounded corners */
}

.chat::-webkit-scrollbar-thumb {
  background: rgba(255, 255, 255, 0.3); /* Thumb background */
  border-radius: 5px; /* Rounded corners */
}

.chat::-webkit-scrollbar-thumb:hover {
  background: rgba(255, 255, 255, 0.5); /* Slightly brighter on hover */
}

.chat::-webkit-scrollbar-thumb:active {
  background: rgba(255, 255, 255, 0.7); /* Even brighter when active */
}

@keyframes scaleIn {
  from {
    opacity: 0;
    transform: scale(0.8);
  }
  to {
    opacity: 1;
    transform: scale(1);
  }
}

.chat-message {
  animation: scaleIn 0.5s ease-out;
}

form {
  display: flex;
  gap: 10px;
  width: 100%;
  box-sizing: border-box;
  margin-top: auto; /* Ensure form stays at the bottom */
  margin-bottom: 5px;
  position: relative; /* Add this */
  z-index: 1; /* Add this */
}

form input {
    flex: 1;
    padding: 10px;
    border-radius: 5px;
    border: none;
    font-size: 14px;
    min-height: 40px;
    max-height: 120px;
    height: 40px;
    resize: none;
    overflow-y: auto;
    white-space: pre-wrap !important;
    word-wrap: break-word !important;
    overflow-wrap: break-word;
    line-height: 20px;
    transition: height 0.15s ease-out;
    box-sizing: border-box;
    width: 100%;
    display: block;
}

form input::-webkit-scrollbar {
  width: 6px;
}

form input::-webkit-scrollbar-track {
  background: rgba(255, 255, 255, 0.1);
  border-radius: 3px;
}

form input::-webkit-scrollbar-thumb {
  background: rgba(255, 255, 255, 0.3);
  border-radius: 3px;
}

form input::-webkit-scrollbar-thumb:hover {
  background: rgba(255, 255, 255, 0.5);
}

form button {
  padding: 10px 20px;
  background: #ffffff80;
  border: none;
  border-radius: 5px;
  cursor: pointer;
  font-weight: bold;
  color: black;
  font-size: 0.9em;
  max-width: 150px;
}

form button:hover {
  background: #ffffffcc;
}

#audio-visualizer-container {
  position: absolute;
  right: 20px;
  bottom: 0px;
  width: 200px;
  height: 200px;
  border-radius: 50%;
  z-index: 10;
  background: rgba(0, 0, 0, 0); /* No background color */
  overflow: hidden; /* Prevent the pseudo-elements from going outside */
}

#audio-visualizer-container::before,
#audio-visualizer-container::after {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  border-radius: 50%;
  z-index: -1;
  background: radial-gradient(
      circle,
      rgba(0, 0, 0, 0.5) 0%,    /* Strong blur at the center */
      rgba(0, 0, 0, 0.3) 30%,  /* Slightly weaker blur */
      rgba(0, 0, 0, 0.05) 60%,  /* Weak blur near the edges */
      rgba(0, 0, 0, 0) 100%    /* No blur at the very edge */
  );
  backdrop-filter: blur(1px); /* The blur effect applied to the entire container */
  -webkit-backdrop-filter: blur(1px); /* Ensure compatibility with WebKit browsers */
  pointer-events: none; /* Disable interaction for pseudo-elements */
}

#audio-visualizer {
  width: 200px;
  height: 200px;
}

.control-button {
  position: absolute;
  bottom: -50px; /* Adjust this value to place it just below the Explainer AI bubble */
  right: 70px; /* Adjust this value to align with the bubble */
  background-color: white;
  border: 1px solid rgba(57, 57, 57, 0.347);
  color: black;
  padding: 8px 15px;
  font-size: 14px;
  border-radius: 5px;
  text-align: center;
  cursor: pointer;
  transition: background-color 0.3s ease, color 0.3s ease;
  z-index: 11; /* Ensure it stays above other elements */
}

.control-button:hover {
  background-color: black;
  color: white;
}

.logout-btn {
  background-color: #f44336!important; /* Red color */
  color: white!important;
  border: none!important;
  width: 10px!important; /* Make it small */
  height: 10px!important; /* Keep it square */
  padding: 0!important;   /* Remove padding */
  border-radius: 50%!important; /* Make it perfectly round */
  cursor: pointer!important;
  box-shadow: 0px 2px 4px rgba(0, 0, 0, 0.2)!important;
  transition: background-color 0.3s ease, transform 0.2s ease!important;;
  position: fixed!important;;
  top: 5px!important;;
  right: 20px!important;;
  z-index: 1000!important;;
}

/* Hover Effect for Logout Button */
.logout-btn:hover {
  background-color: #d32f2f; /* Darker shade on hover */
  transform: scale(1.2); /* Slight zoom effect */
}

.confirm-dialog {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0);
    z-index: 2000;
    justify-content: center;
    align-items: center;
    transition: background-color 0.3s ease; /* Smooth fade for background */
}

.confirm-dialog.active {
    display: flex;
    background-color: rgba(0, 0, 0, 0.5);
}

.confirm-dialog-content {
    background-color: rgba(0, 0, 0, 0.8);
    padding: 20px;
    border-radius: 10px;
    border: 1px solid rgba(255, 255, 255, 0.2);
    text-align: center;
    max-width: 300px;
    color: white;
    backdrop-filter: blur(5px);
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
    opacity: 0;
    transform: scale(0.9);
    transition: opacity 0.3s ease, transform 0.3s ease;
}

.confirm-dialog.active .confirm-dialog-content {
    opacity: 1;
    transform: scale(1);
}

.confirm-dialog-buttons {
    display: flex;
    justify-content: center;
    gap: 10px;
    margin-top: 20px;
}

.confirm-btn {
    padding: 8px 20px;
    border: none;
    border-radius: 5px;
    cursor: pointer;
    font-weight: bold;
    transition: all 0.3s ease;
}

.confirm-btn.yes {
    background-color: rgba(220, 53, 69, 0.8);
    color: white;
}

.confirm-btn.no {
    background-color: rgba(255, 255, 255, 0.2);
    color: white;
}

.confirm-btn:hover {
    transform: scale(1.05);
}

.confirm-btn.yes:hover {
    background-color: rgba(220, 53, 69, 1);
}

.confirm-btn.no:hover {
    background-color: rgba(255, 255, 255, 0.3);
}

@keyframes scaleIn {
    from {
        transform: scale(0.9);
    }
    to {
        transform: scale(1);
    }
}

.suggestions-nav {
  display: flex;
  justify-content: center;
  gap: 10px;
  margin-top: 10px; /* Reduced from 20px */
  padding: 0 10px;
  width: 100%;
  box-sizing: border-box;
  min-height: 32px;
}

.suggestions-nav button {
  background: rgba(0, 0, 0, 0.292);
  border: 2px solid var(--primary-color);
  color: var(--primary-color);
  padding: 6px;  /* Reduced from 8px */
  border-radius: 5px;
  cursor: pointer;
  transition: all 0.3s ease;
  width: 32px;   /* Reduced from 40px */
  height: 32px;  /* Reduced from 40px */
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 12px;  /* Added to make icons smaller */
}

.suggestions-nav button:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

.suggestions-nav button:hover:not(:disabled) {
  background: var(--sidebar-button-hover-color);
}

.profile-container {
  background: rgba(0, 0, 0, 0.6);
  color: white;
  padding: 12px;
  border-radius: 10px;
  position: fixed; /* Changed from relative */
  bottom: 60px; /* Distance from bottom */
  left: calc(var(--sidebar-width) / 2); /* Position relative to sidebar width */
  transform: translateX(-50%); /* Center within sidebar */
  width: fit-content;
  transition: all 0.3s ease-in-out;
  max-height: fit-content;
  overflow: hidden;
  z-index: 999; /* Ensure it stays above other elements */
}

.profile-header {
    text-align: center;
    font-size: 14px;
    font-weight: bold;
    padding-bottom: 4px; /* Reduced from 8px */
    width: 100%;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0px; /* Reduced from 2px */
}

.profile-header h3 {
    margin: 0;
    padding: 0;
    margin-bottom: 10px; /* Reduced from 10px */
    max-width: 100%;
    overflow: hidden;
    text-overflow: ellipsis;
    font-size: clamp(12px, 18px, 4vw);
    line-height: 1;
    white-space: nowrap;
}

.profile-email {
    color: #00ffcc;
    font-size: clamp(10px, 15px, 3vw) !important;
    line-height: 1 !important;
    max-width: 100%;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    margin: 0 !important; /* Remove default margins */
    padding: 0 !important; /* Remove default padding */
    margin-bottom: 10px;
}

.profile-status {
    color: #ffd700;
    font-size: 11px !important;
    line-height: 1 !important;
    margin: 2px 0 0 0 !important; /* Only small top margin */
}

#expand-profile {
    margin: 4px auto 0; /* Reduced from 6px */
}

.profile-container.hidden {
  display: none;
}

.profile-details {
  display: none;
  position: fixed;
  left: 0;
  bottom: 0;
  width: var(--sidebar-width);
  min-height: 130px;
  height: min-content; /* Expand to fit content */
  max-height: 90vh; /* Limit to 90% of viewport height */
  background: rgba(0, 0, 0, 0.95);
  color: white;
  padding: 20px;
  border-radius: 0 10px 0 0;
  overflow-y: auto;
  z-index: 1000;
  opacity: 0;
  transform: translateX(-100%);
  transition: opacity 0.3s ease, transform 0.3s ease;
}

.profile-details:not(.hidden) {
    display: block;
    opacity: 1;
    transform: translateX(0);
}

/* Hide scrollbar by default, show only when hovering and content overflows */
.profile-details::-webkit-scrollbar {
    width: 6px;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.profile-details:hover::-webkit-scrollbar {
    opacity: 1;
}

.profile-details::-webkit-scrollbar-track {
    background: rgba(255, 255, 255, 0.1);
    border-radius: 3px;
}

.profile-details::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.3);
    border-radius: 3px;
}

.profile-details::-webkit-scrollbar-thumb:hover {
    background: rgba(255, 255, 255, 0.5);
}

.profile-details p {
    margin: 8px 0;
    line-height: 1.4;
    display: block; /* Changed from flex to block */
    text-align: left;
    width: 100%;
}

.profile-details p strong {
    margin-right: 8px;
}

.profile-details p span:first-child {
    font-weight: bold;
    margin-right: 5px;
    min-width: 100px; /* Give some consistent space for labels */
}

.profile-close {
    position: absolute;
    top: 3px;
    right: 5px;
    background: none;
    border: none;
    color: rgba(255, 255, 255, 0.7);
    font-size: 20px;
    cursor: pointer;
    padding: 5px;
    transition: color 0.3s ease;
    z-index: 100;
}

.profile-close:hover {
    color: white;
}

#expand-profile {
    background: rgba(255, 255, 255, 0.2);
    border: none;
    padding: 3px 15px;
    color: white;
    cursor: pointer;
    border-radius: 5px;
    margin: 4px auto 0; /* Reduced from 6px */
    letter-spacing: 1px;
    font-size: 13px;
    transition: all 0.3s ease-in-out;
    z-index: 100;
    position: relative;
    display: block;
    width: auto;
}

#expand-profile:hover {
    background: rgba(255, 255, 255, 0.4);
}

.profile-full-title {
  margin: 0 0 20px 0;
  padding-bottom: 10px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.2);
  font-size: 20px;
  color: #00ffcc;
  text-align: center;
}

.profile-age {
  color: rgba(255, 255, 255, 0.8);
}

#measure-div {
    position: absolute;
    visibility: hidden;
    height: auto;
    box-sizing: border-box;
    white-space: pre-wrap;
    word-wrap: break-word;
}

#user-query {
    flex: 1;
    padding: 10px;
    border-radius: 5px;
    border: none;
    font-size: 14px;
    min-height: 40px;
    max-height: 100px; /* Reduced from 120px */
    height: 40px;
    resize: none;
    overflow-y: auto;
    white-space: pre-wrap !important;
    word-wrap: break-word !important;
    word-break: break-word;
    line-height: 20px;
    transition: height 0.2s ease-out;
    box-sizing: border-box;
    width: 100%;
    display: block;
    background: white;
    color: black;
    font-family: 'Roboto', Arial, sans-serif;
}

#user-query::-webkit-scrollbar {
    width: 6px;
}

#user-query::-webkit-scrollbar-track {
    background: rgba(255, 255, 255, 0.1);
    border-radius: 3px;
}
#user-query::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.3);
    border-radius: 3px;
}

#user-query::-webkit-scrollbar-thumb:hover {
    background: rgba(255, 255, 255, 0.5);
}

/* Chat Processing Overlay */
.chat-processing-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.75);
    display: none;
    justify-content: center;
    align-items: center;
    z-index: 1000;
    border-radius: 5px;
    backdrop-filter: blur(3px);
    animation: overlayFadeIn 0.3s ease-out;
    overflow: hidden;
    position: absolute;
}

/* Sweeping light effect */
.chat-processing-overlay::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, 
        transparent 0%, 
        rgba(255, 255, 255, 0.1) 30%, 
        rgba(255, 255, 255, 0.2) 50%, 
        rgba(255, 255, 255, 0.1) 70%, 
        transparent 100%);
    animation: sweepLight 2.5s ease-in-out infinite;
}

@keyframes sweepLight {
    0% {
        left: -100%;
    }
    100% {
        left: 100%;
    }
}

@keyframes overlayFadeIn {
    from {
        opacity: 0;
        backdrop-filter: blur(0px);
    }
    to {
        opacity: 1;
        backdrop-filter: blur(3px);
    }
}

.processing-content {
    display: flex;
    align-items: center;
    gap: 12px;
    color: rgba(255, 255, 255, 0.9);
    font-size: 14px;
    font-weight: 500;
    animation: contentSlideIn 0.4s ease-out 0.1s both;
    position: relative;
    z-index: 1;
}

@keyframes contentSlideIn {
    from {
        transform: translateY(10px);
        opacity: 0;
    }
    to {
        transform: translateY(0);
        opacity: 1;
    }
}

.processing-gear {
    width: 20px;
    height: 20px;
    color: #4CAF50;
    animation: rotateGear 2s linear infinite;
    flex-shrink: 0;
}

@keyframes rotateGear {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

.processing-text {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
    text-shadow: 0 1px 3px rgba(0, 0, 0, 0.5);
    letter-spacing: 0.5px;
    font-size: 16px;
    font-weight: 600;
}

/* Animated dots for thinking text */
.dots-animation {
    display: inline-block;
    min-width: 50px; /* Reserve space for 5 dots */
    text-align: left;
}

/* ...existing code... */

#profile-arrow-container {
    position: fixed;
    bottom: 10px;
    left: 10px;
    z-index: 1000;
    /* Remove the left transition */
}

/* Remove the expanded position change */
/*#profile-arrow-container.expanded {*/
    /* remove left: 20%; */
/*}*/

#profile-arrow {
    background: rgba(0, 0, 0, 0.3);
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 50%;
    width: 25px;
    height: 25px;
    display: flex;
    justify-content: center;
    align-items: center;
    cursor: pointer;
    /* Keep only background-color transition */
    transition: background-color 0.3s ease;
}

/* Keep only the icon rotation animation */
#profile-arrow img {
    transition: transform 0.3s ease;
    transform: rotate(90deg); /* Initially point right */
}

#profile-arrow-container.expanded img {
    transform: rotate(-90deg); /* Point left when expanded */
}

#profile-arrow-container:not(.expanded) img {
    transform: rotate(90deg); /* Point right when collapsed */
}

/* ...existing code... */

#controls-container {
    position: absolute;
    bottom: -60px;
    right: 35px;
    z-index: auto !important; /* Remove stacking context */
    /* Add overlay text container */
    position: relative;
}

#controls-container button {
    background: rgba(0, 0, 0, 0.292);
    border: 2px solid white;
    padding: 5px;
    width: 35px;
    height: 35px;
    text-align: center;
    color: white;
    font-weight:400;
    font-size:medium;
    border-radius: 5px;
    cursor: pointer;
    transition: all 0.3s ease-in-out;
}

#controls-container button:hover {
    background: #ffffffcc;
}

/* Style for override controls container */
#override-controls {
  position: fixed;
  top: 3px;
  right: 20px;
  display: flex;
  align-items: center;
  gap: 5px;
  z-index: 1001;
}

#override-controls .runtime-version-chip {
  position: absolute;
  top: 0;
  right: calc(100% + 10px);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 4px 10px;
  border-radius: 999px;
  background: rgba(0, 0, 0, 0.55);
  color: rgba(255, 255, 255, 0.95);
  font-family: 'Iceland', sans-serif;
  font-size: 13px;
  letter-spacing: 0.5px;
  text-shadow: -1px -1px 0 rgba(0, 0, 0, 0.4),
         1px -1px 0 rgba(0, 0, 0, 0.4),
        -1px  1px 0 rgba(0, 0, 0, 0.4),
         1px  1px 0 rgba(0, 0, 0, 0.4);
  min-width: 100px;
  text-align: center;
  white-space: nowrap;
  transition: opacity 0.3s ease, transform 0.2s ease;
  backdrop-filter: blur(6px);
  opacity: 0;
  pointer-events: none;
  transform: translateY(-4px);
}

#override-controls .runtime-version-chip.override-active {
  background: rgba(255, 140, 0, 0.85);
  color: #1b1b1b;
  text-shadow: none;
  border: 1px solid rgba(0, 0, 0, 0.35);
}

#override-controls:hover .runtime-version-chip {
  opacity: 1;
  transform: translateY(-6px);
}

#override-controls .powered-text {
    font-family: 'Iceland', sans-serif;
    font-size: 15px;
    color: rgba(255, 255, 255, 0.9);
    transition: opacity 0.3s ease;
    text-shadow: 
        -1px -1px 0 rgba(0, 0, 0, 0.5),  
         1px -1px 0 rgba(0, 0, 0, 0.5),
        -1px  1px 0 rgba(0, 0, 0, 0.5),
         1px  1px 0 rgba(0, 0, 0, 0.5);
    margin-right: -30px;
}

/* Hide text when container is hovered */
#override-controls:hover .powered-text {
    opacity: 0;
}

/* Update button styles - maintain positioning but under new parent */
#override-controls .name-override-btn,
#override-controls .logout-btn,
#override-controls .background-override-btn,
#override-controls .logo-override-btn,
#override-controls .voice-override-btn,
#override-controls .language-override-btn,
#override-controls .ctag-container-size-btn,
#override-controls .grid-admin-btn,
#override-controls .placeholder-override-btn,
#override-controls .clear-data-btn {
    position: relative;
    width: 10px;
    height: 10px;
    padding: 0;
    border: none;
    border-radius: 50%;
    cursor: pointer;
    box-shadow: 0px 2px 4px rgba(0, 0, 0, 0.2);
    transition: transform 0.2s ease, opacity 0.3s ease;
  opacity: 0;
  right: 75px;
}

/* Show buttons on hover */
#override-controls:hover .name-override-btn,
#override-controls:hover .logout-btn,
#override-controls:hover .background-override-btn,
#override-controls:hover .logo-override-btn,
#override-controls:hover .voice-override-btn,
#override-controls:hover .language-override-btn,
#override-controls:hover .ctag-container-size-btn,
#override-controls:hover .grid-admin-btn,
#override-controls:hover .placeholder-override-btn,
#override-controls:hover .clear-data-btn {
    opacity: 1;
}

/* Keep individual button colors and hover effects */
#override-controls .name-override-btn { background-color: #4CAF50; }
#override-controls .logout-btn { background-color: #f44336; }
#override-controls .background-override-btn { background-color: #ffd700; }
#override-controls .logo-override-btn { background-color: #1e90ff; }
#override-controls .voice-override-btn { background-color: #9c27b0; }
#override-controls .language-override-btn { background-color: #34dbd0; }
#override-controls .ctag-container-size-btn { background-color: #ff9800; }
#override-controls .grid-admin-btn { background-color: #17a2b8; }
#override-controls .placeholder-override-btn { background-color: #e91e63; }
#override-controls .clear-data-btn { background-color: #dc3545; }

#override-controls button:hover {
    transform: scale(1.2);
}

/* Tooltip styles for override control buttons */
#override-controls button[data-tooltip] {
    position: relative;
}

#override-controls button[data-tooltip]::after {
    content: attr(data-tooltip);
    position: absolute;
    top: calc(100% + 8px); /* Position below the button */
    left: 50%;
    transform: translateX(-50%);
    background-color: rgba(0, 0, 0, 0.9);
    color: #ffffff;
    padding: 6px 10px;
    border-radius: 4px;
    font-size: 11px;
    font-weight: 500;
    white-space: nowrap;
    max-width: 200px;
    text-align: center;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.2s ease, transform 0.2s ease;
    z-index: 10000;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.3);
    min-height: 10px;
}

/* Small arrow pointing up to the button */
#override-controls button[data-tooltip]::before {
    content: '';
    position: absolute;
    top: calc(100% + 2px);
    left: 50%;
    transform: translateX(-50%);
    border: 6px solid transparent;
    border-bottom-color: rgba(0, 0, 0, 0.9);
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.2s ease;
    z-index: 10001;
}

/* Show tooltip on hover - only when override-controls is hovered AND individual button is hovered */
#override-controls:hover button[data-tooltip]:hover::after {
    opacity: 1;
    transform: translateX(-50%) translateY(2px);
}

#override-controls:hover button[data-tooltip]:hover::before {
    opacity: 1;
}

/* Modify the button styles to be initially invisible */
.name-override-btn,
.logout-btn,
.background-override-btn,
.logo-override-btn {
    transition: opacity 0.3s ease, transform 0.2s ease, background-color 0.3s ease !important;
}

/* Keep hover effects for the buttons */
.name-override-btn:hover,
.logout-btn:hover,
.background-override-btn:hover,
.logo-override-btn:hover {
    transform: scale(1.2) !important;
}

.playpause-control {
  position: absolute;
  right: 150px;
  bottom: 0;
  z-index: 1000;
  opacity: 1;
  cursor: pointer;
  pointer-events: auto;
  transition: opacity 0.3s ease;
}

/* Disabled state when comparison is present - using :has() */
body:has(.comparison-container) .playpause-control {
  z-index: 1;
  opacity: 0.5;
  cursor: not-allowed;
  pointer-events: none;
}

/* Fallback for browsers that don't support :has */
.comparison-container ~ #controls-container .playpause-control {
  z-index: 1;
  opacity: 0.5;
  cursor: not-allowed;
  pointer-events: none;
}

/* Hover effect only when enabled */
.playpause-control:not([disabled]):hover {
  background: rgba(255, 255, 255, 0.8);
}

.fullscreen-control {
    /* Break out of all stacking contexts */
    position: fixed !important;
    isolation: isolate !important;
    z-index: 1000 !important;
    right: 135px !important;
    bottom: 10px !important;
    background: rgba(0, 0, 0, 0.292) !important;
    border: 2px solid white !important;
    padding: 5px !important;
    width: 35px !important;
    height: 35px !important;
    text-align: center !important;
    color: white !important;
    font-weight: 400 !important;
    font-size: medium !important;
    border-radius: 5px !important;
    cursor: pointer !important;
    transition: all 0.3s ease-in-out !important;
    /* Force button to top layer */
    transform: translateZ(0) !important;
    will-change: transform !important;
}

.fullscreen-control:hover {
    background: #ffffffcc !important;
}

.darkmode-control {
    position: absolute;
    right: 50px;
    bottom: 0;
}

.voice-control {
    position: absolute;
    right: 0;
    bottom: 0;
}

/* Common control button styles */
.fullscreen-control i,
.voice-control i,
.darkmode-control i,
.playpause-control i {
    transition: transform 0.3s ease-in-out, color 0.3s ease-in-out;
}

/* Fullscreen button - grow and grey only on expand */
.fullscreen-control:hover i.fa-expand {
    transform: scale(1.4);
    color: #888888;
}

.fullscreen-control:hover i.fa-compress {
    transform: scale(0.7);
    /* No color change for compress - stays white */
}

/* Other control buttons - grow and grey on both states */
.voice-control:hover i.fa-volume-up,
.voice-control:hover i.fa-volume-mute,
.darkmode-control:hover i.fa-sun,
.darkmode-control:hover i.fa-moon,
.playpause-control:hover i.fa-play,
.playpause-control:hover i.fa-pause {
    transform: scale(1.4);
    color: #888888;
}

/* Add dark mode styles */
body.dark-mode {
    position: relative;
}

body.dark-mode::after {
    content: '';
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.8); /* Dark overlay */
    pointer-events: none; /* Allow clicking through */
    z-index: -1; /* Change to negative to ensure it's below everything */
    opacity: 0;
    transition: opacity 0.5s ease-in-out; /* Smoother transition */
    animation: fadeInDarkMode 0.5s forwards; /* Add fade-in animation */
}

body:not(.dark-mode)::after {
  content: '';
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-color: rgba(0, 0, 0, 0.8);
  pointer-events: none;
  z-index: -1;
  animation: fadeOutDarkMode 0.5s forwards;
}

@keyframes fadeInDarkMode {
    from {
        opacity: 0;
    }
    to {
        opacity: 1;
    }
}

@keyframes fadeOutDarkMode {
    from {
        opacity: 1;
    }
    to {
        opacity: 0;
    }
}

.background-override-btn {
    background-color: #ffd700!important; /* Yellow color */
    color: white!important;
    border: none!important;
    width: 10px!important;
    height: 10px!important;
    padding: 0!important;
    border-radius: 50%!important;
    cursor: pointer!important;
    box-shadow: 0px 2px 4px rgba(0, 0, 0, 0.2)!important;
    transition: background-color 0.3s ease, transform 0.2s ease!important;
    position: fixed!important;
    top: 5px!important;
    right: 35px!important;
    z-index: 1000!important;
}

.logo-override-btn {
    background-color: #1e90ff!important; /* Blue color */
    color: white!important;
    border: none!important;
    width: 10px!important;
    height: 10px!important;
    padding: 0!important;
    border-radius: 50%!important;
    cursor: pointer!important;
    box-shadow: 0px 2px 4px rgba(0, 0, 0, 0.2)!important;
    transition: background-color 0.3s ease, transform 0.2s ease!important;
    position: fixed!important;
    top: 5px!important;
    right: 50px!important;
    z-index: 1000!important;
}

.background-override-btn:hover,
.logo-override-btn:hover {
    transform: scale(1.2)!important;
}

.logo-fade-out {
    opacity: 0 !important;
}

.logo-fade-in {
    opacity: 1 !important;
}

.name-override-btn {
    position: fixed!important;
    top: 5px!important;
    right: 65px!important; /* Position it left of the existing buttons */
    background-color: #4CAF50!important; /* Green color to differentiate */
    color: white!important;
    border: none!important;
    width: 10px!important;
    height: 10px!important;
    padding: 0!important;
    border-radius: 50%!important;
    cursor: pointer!important;
    box-shadow: 0px 2px 4px rgba(0, 0, 0, 0.2)!important;
    transition: background-color 0.3s ease, transform 0.2s ease!important;
    z-index: 1000!important;
}

.name-override-btn:hover {
    background-color: #45a049;
    transform: scale(1.2);
}

/* Video text overlay styles - single unified section */
.video-text-overlay {
    position: absolute;
    display: flex;
    flex-direction: column;
    transform: scale(1);
    transition: transform 0.3s ease;
    width: 98%;
}

/* Position-based transform origins */
.video-text-overlay[data-position="TL"] { transform-origin: top left; }
.video-text-overlay[data-position="TC"] { transform-origin: top center; }
.video-text-overlay[data-position="TR"] { transform-origin: top right; }
.video-text-overlay[data-position="CL"] { transform-origin: left center; }
.video-text-overlay[data-position="CC"] { transform-origin: center center; }
.video-text-overlay[data-position="CR"] { transform-origin: right center; }
.video-text-overlay[data-position="BL"] { transform-origin: bottom left; }
.video-text-overlay[data-position="BC"] { transform-origin: bottom center; }
.video-text-overlay[data-position="BR"] { transform-origin: bottom right; }

/* Scale effect when video is stopped */
.video-text-overlay.video-stopped {
    transform: scale(0.8);
    width: 120%;
}

/* Text element styles */
.video-text-overlay .video-title,
.video-text-overlay .video-subtitle {
    margin: 0;
    padding: 0;
    line-height: 1.2;
    text-align: inherit; /* Inherit alignment */
    white-space: normal; /* Allow text wrapping */
}

/* Scale effect only when NOT in very-large mode AND NOT when size override is active */
#video-container:not(.very-large):not(.size-override-active) .video-text-overlay.video-stopped {
    transform: scale(0.8);
    width: 120%;
}

/* Remove transform when in very-large mode OR when size override is active */
#video-container.very-large .video-text-overlay.video-stopped,
#video-container.size-override-active .video-text-overlay.video-stopped {
    transform: none;
    width: 98%;
}

.comparison-container {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.8);
    padding: 20px;
    box-sizing: border-box;
    overflow: auto;
    display: flex;
    flex-direction: column;
    z-index: 50; /* Increased z-index */
    opacity: 1; /* Force visibility */
    visibility: visible; /* Ensure visibility */
    transform: none; /* Reset any transforms */
    position: relative; /* For positioning child elements */
}

.comparison-container.hidden {
    display: none;
}

.comparison-header {
    text-align: center;
    margin-bottom: 0px;
    flex: 0 0 auto;
}

.comparison-header h2 {
    color: var(--primary-color);
    font-size: 24px;
    margin-bottom: 10px;
}

.comparison-header h3 {
    color: var(--primary-color);
    font-size: 18px;
    opacity: 0.8;
}

.comparison-columns {
    display: flex;
    align-items: stretch; /* Ensure all columns stretch to the height of the tallest column */
    gap: 20px;
    padding: 20px;
    flex: 1;
    min-height: 0;
}

.comparison-columns {
    display: flex;
    flex-direction: column;
    gap: 20px;
    padding: 20px;
}

.comparison-row {
    display: flex;
    gap: 20px;
    justify-content: flex-start;
    width: 100%;
    margin-bottom: 20px;
}

.comparison-row:last-child {
    margin-bottom: 0;
}

.comparison-column {
    height: fit-content;
    flex: 1; /* Ensure columns take equal width */
    position: relative;
    padding: 5px;
    /*border: 2px solid rgba(255, 255, 255, 0.2);*/
    border-radius: 5px;
    padding-left: 20px;
    padding-right: 20px;
    margin-bottom: 20px;
}

.comparison-column::after {
    content: '';
    position: absolute;
    top: 25px;
    right: -1px;
    height: 99%;
    width: 2px;
    background: rgba(255, 255, 255, 0.526);
    
}

.comparison-column:last-child::after {
    display: none;
}

.comparison-content {
    line-height: 1.6;
    height: 100%;
    overflow-y: auto;
    text-align: inherit !important; /* Force text alignment */
}

.comparison-thumbnail {
    position: relative;
    margin: 5px;
    cursor: pointer;
    background: rgba(0, 0, 0, 0.6);
    border: 1px solid var(--thumbnail-border-color);
    border-radius: 5px;
    overflow: hidden;
    transition: transform 0.3s ease, border-color 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
}

.comparison-thumbnail:hover {
    transform: scale(var(--thumbnail-hover-scale, 1.1));
    border-color: var(--primary-color);
}

.comparison-preview {
    display: flex;
    flex-direction: column;
    align-items: center;
    color: var(--primary-color);
}

.comparison-icon {
    font-size: 18px; /* Smaller icon */
    margin-bottom: 3px;
}

/* Handle video container states */
#video-container.enlarged .comparison-container {
    padding: 30px;
    transform: scale(1.1);
}

#video-container.very-large .comparison-container {
    padding: 40px;
    transform: scale(1.2);
}

/* Responsive design */
@media screen and (max-width: 768px) {
    .comparison-columns {
        grid-template-columns: 1fr;
    }
    
    .comparison-column::after {
        display: none;
    }
}

.voice-override-btn {
    background-color: #9c27b0!important; /* Purple color */
    color: white!important;
    border: none!important;
    width: 10px!important;
    height: 10px!important;
    padding: 0!important;
    border-radius: 50%!important;
    cursor: pointer!important;
    box-shadow: 0px 2px 4px rgba(0, 0, 0, 0.2)!important;
    transition: background-color 0.3s ease, transform 0.2s ease!important;
    position: fixed!important;
    top: 5px!important;
    right: 80px!important;
    z-index: 1000!important;
}

.voice-override-btn:hover {
    transform: scale(1.2)!important;
}

.modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.7);
    z-index: 2000;
    align-items: center;
    justify-content: center;
}

.modal.active {
    display: flex;
}

.modal-content {
    background: rgba(0, 0, 0, 0.9);
    padding: 20px;
    border-radius: 10px;
    border: 1px solid rgba(255, 255, 255, 0.2);
    color: white;
    min-width: 300px;
}

/* Voice category separator styling */
.voice-category-separator {
    width: 100%;
    text-align: center;
    border-bottom: 1px solid #ccc;
    line-height: 0.1em;
    margin: 20px 0 15px;
}

.voice-category-separator span {
    background: white;
    padding: 0 10px;
    font-size: 0.9em;
    color: #555;
    font-weight: 500;
}

/* For dark mode compatibility */
body.dark-mode .voice-category-separator span {
    background: #333;
    color: #ccc;
}

body.dark-mode .voice-category-separator {
    border-bottom: 1px solid #555;
}

.voice-options {
    display: flex;
    flex-direction: column;
    gap: 15px;
    margin: 20px 0;
}

.voice-options label {
    display: flex;
    align-items: center;
    gap: 10px;
    cursor: pointer;
    padding: 5px;
    transition: background-color 0.3s ease;
}

.voice-options label:hover {
    background: rgba(255, 255, 255, 0.1);
}



.modal-content button {
    padding: 8px 20px;
    border: none;
    border-radius: 5px;
    cursor: pointer;
    margin: 5px;
    font-weight: bold;
    transition: all 0.3s ease;
}

#save-voice {
    background-color: #9c27b0;
    color: white;
}

#close-voice-modal {
    background-color: rgba(255, 255, 255, 0.2);
    color: white;
}

#save-voice:hover {
    background-color: #7b1fa2;
}

#close-voice-modal:hover {
    background-color: rgba(255, 255, 255, 0.3);
}

/* Chat form button styling to accommodate icons */
#chat-form {
  position: relative; /* Needed for overlay positioning */
  display: flex;
  gap: 10px;
}

#chat-form button {
  width: 60px;
  height: 40px;
  background: var(--tertiary-color);
  border: none;
  border-radius: 5px;
  cursor: pointer;
  font-weight: bold;
  color: #000;
  font-size: 0.9em;
  display: flex;
  justify-content: center;
  align-items: center;
  transition: all 0.2s ease;
}

#chat-form button:hover {
  background: var(--tertiary-color);
  opacity: 0.9;
}

#chat-form button i {
  font-size: 1.2em;
  color: #000;
}

/* Speech feedback styling for desktop */
.speech-feedback {
  position: fixed;
  bottom: 80px;
  left: 50%;
  transform: translateX(-50%);
  background-color: rgba(0, 0, 0, 0.7);
  color: white;
  padding: 12px 20px;
  border-radius: 20px;
  z-index: 1000;
  min-width: 200px;
  text-align: center;
}

.speech-waves {
  display: flex;
  justify-content: center;
  align-items: center;
  height: 30px;
  margin-bottom: 8px;
}

.speech-wave {
  width: 3px;
  height: 10px;
  background-color: #0088ff;
  margin: 0 2px;
  border-radius: 1px;
  animation: wave 1s infinite ease-in-out;
}

.speech-wave:nth-child(1) { animation-delay: 0.0s; }
.speech-wave:nth-child(2) { animation-delay: 0.2s; }
.speech-wave:nth-child(3) { animation-delay: 0.4s; }
.speech-wave:nth-child(4) { animation-delay: 0.2s; }
.speech-wave:nth-child(5) { animation-delay: 0.0s; }

@keyframes wave {
  0%, 100% { height: 10px; }
  50% { height: 25px; }
}

/* Language button styling similar to other override buttons */
/* Language styling is now integrated with other override buttons */

/* Language selection modal styling */
.language-options {
    display: flex;
    flex-direction: column;
    gap: 10px;
    margin: 15px 0;
    max-height: 300px;
    overflow-y: auto;
}

.language-options label {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 5px;
    border-radius: 5px;
    cursor: pointer;
    transition: background-color 0.2s;
}

.language-options label:hover {
    background-color: rgba(255, 255, 255, 0.1);
    color: white;
    font-size: 16px;
}

.modal-buttons {
    display: flex;
    justify-content: flex-end;
    gap: 10px;
    margin-top: 15px;
}

#save-language-btn {
    background-color: #3498db;
}

#close-language-modal {
    background-color: rgba(255, 255, 255, 0.2);
}

/* Adding CSS style for active override button state */
#override-controls button.active {
    border: 2px solid white;
    box-shadow: 0 0 10px 3px rgba(255, 255, 255, 0.5);
    transform: scale(1.2);
}

/* New styles for placeholder override button */
.placeholder-override-btn {
    position: fixed!important;
    top: 5px!important;
    right: 157px!important; /* Position it left of the existing buttons */
    background-color: #e91e63!important; /* Pink color to differentiate */
    color: white!important;
    border: none!important;
    width: 10px!important;
    height: 10px!important;
    padding: 0!important;
    border-radius: 50%!important;
    cursor: pointer!important;
    box-shadow: 0px 2px 4px rgba(0, 0, 0, 0.2)!important;
    transition: background-color 0.3s ease, transform 0.2s ease!important;
    z-index: 1000!important;
}

.placeholder-override-btn:hover {
    background-color: #c2185b!important;
    transform: scale(1.2)!important;
}

/* Placeholder modal styles */
#placeholder-modal .modal-content {
    max-width: 400px;
    padding: 20px;
}

#placeholder-modal .placeholder-form {
    margin: 15px 0;
}

#placeholder-modal input[type="text"] {
    width: 100%;
    padding: 10px;
    border-radius: 4px;
    border: 1px solid rgba(255, 255, 255, 0.2);
    background-color: rgba(255, 255, 255, 0.1);
    color: white;
    font-size: 16px;
}

#placeholder-modal .modal-buttons {
    display: flex;
    justify-content: flex-end;
    gap: 10px;
}

#save-placeholder {
    background-color: #e91e63;
}

#cancel-placeholder {
    background-color: rgba(255, 255, 255, 0.2);
}

.ctag-container-size-btn::after {
    content: "Container Size Override";
    position: absolute;
    background-color: rgba(0, 0, 0, 0.8);
    color: white;
    padding: 5px 10px;
    border-radius: 4px;
    font-size: 12px;
    white-space: nowrap;
    visibility: hidden;
    opacity: 0;
    transition: opacity 0.3s ease, visibility 0.3s ease;
    bottom: 100%;
    left: 50%;
    transform: translateX(-50%);
    margin-bottom: 5px;
}

.ctag-container-size-btn:hover::after {
    visibility: visible;
    opacity: 1;
}

/* Grid Admin Button Tooltip */
.grid-admin-btn::after {
    content: "Grid Admin";
    position: absolute;
    background-color: #333;
    color: white;
    padding: 5px 10px;
    border-radius: 4px;
    font-size: 12px;
    white-space: nowrap;
    visibility: hidden;
    opacity: 0;
    transition: opacity 0.3s ease, visibility 0.3s ease;
    bottom: 100%;
    left: 50%;
    transform: translateX(-50%);
    margin-bottom: 5px;
}

.grid-admin-btn:hover::after {
    visibility: visible;
    opacity: 1;
}

/* Grid Admin Button Active State */
.grid-admin-btn.active {
    background-color: #138496 !important;
    box-shadow: 0 0 10px rgba(23, 162, 184, 0.5);
}

/* Linked Content Display Styles */
.linked-content-container {
  margin-top: 15px;
  margin-bottom: 10px;
  transition: opacity 0.3s ease, visibility 0.3s ease, height 0.3s ease;
  /*overflow: hidden;*/
}

.linked-content-container.hidden {
  opacity: 0;
  visibility: hidden;
  height: 0;
  margin: 0;
}

#linked-content-display {
  transition: none !important;
  opacity: 1;
}
#linked-content-display.hidden {
  display: none !important;
  opacity: 0 !important;
  transition: none !important;
}
#linked-content-display.fade-in {
  display: block !important;
  opacity: 1 !important;
  transition: opacity 0.4s ease-in;
}

.linked-content-item {
  position: relative;
  width: 100%;
  height: 90px;
  background-color: rgba(0, 0, 0, 0.4);
  border-radius: 8px;
  border: 2px solid rgba(255, 255, 255, 0.2);
  overflow: hidden;
  cursor: pointer;
  transition: transform 0.2s ease, border-color 0.2s ease, box-shadow 0.2s ease;
  display: flex;
  align-items: center;
  visibility: hidden;
}

.linked-content-item.lightbulb-navigation {
    visibility: visible !important;
}

.linked-content-item:hover {
  transform: scale(1.02);
  border-color: rgba(255, 255, 255, 0.5);
  box-shadow: 0 4px 8px rgba(0, 0, 0, 0.3);
}

.linked-content-thumbnail {
  width: 120px;
  height: 70px;
  object-fit: cover;
  border-radius: 5px;
  margin: 10px;
  flex-shrink: 0;
  border: 1px solid rgba(255, 255, 255, 0.1);
}

.linked-content-overlay {
  flex: 1;
  padding: 10px 5px 10px 5px;
  display: flex;
  flex-direction: column;
  justify-content: center;
  height: 100%;
  overflow: hidden;
}

.linked-content-title {
  font-size: 14px;
  font-weight: bold;
  color: white;
  margin-bottom: 5px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  text-shadow: 1px 1px 1px rgba(0, 0, 0, 0.8);
  max-width: 190px;
  min-width: 190px;
}

.linked-content-subtitle {
  font-size: 12px;
  color: rgba(255, 255, 255, 0.8);
  line-height: 1.3;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  text-overflow: ellipsis;
  text-shadow: 1px 1px 1px rgba(0, 0, 0, 0.8);
  line-height: 1.3;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* Improved comparison thumbnail styling */
/* .linked-content-item[data-type="comparison"] .linked-content-thumbnail {
  width: 45px;
  height: 45px;
  object-fit: cover;
  border-radius: 5px; 
  margin: 5px 12px 5px 10px; 
  border: 1px solid rgba(255, 255, 255, 0.3);
} */

/* Center the badge directly over the thumbnail */
/* .linked-content-item[data-type="comparison"]::after {
  content: "";
  position: absolute;
  top: 50%;
  left: 33px;
  width: 40px;
  height: 40px;
  background-image: url(https://ultimxtechnologies.com/ultimx_app/assets/comp2.svg);
  background-size: contain;
  background-repeat: no-repeat;
  background-position: center;
  transform: translate(-50%, -50%); 
  z-index: 10;
  pointer-events: none;
} */

/* Better spacing for comparison content */
/* .linked-content-item[data-type="comparison"] .linked-content-overlay {
  padding-left: 15px; 
  padding-right: 15px; 
} */

/* Adjust text for better readability */
/* .linked-content-item[data-type="comparison"] .linked-content-title,
.linked-content-item[data-type="comparison"] .linked-content-subtitle {
  margin-left: 10px;
  margin-right: 5px;
  max-width: 230px;
} */

/* Ensure text doesn't overflow container */
/* .linked-content-item[data-type="comparison"] .linked-content-title {
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
} */

/* Animation for when linked content appears */
.linked-content-item.appear {
  animation: linkedContentAppear 0.4s ease-out forwards;
}

@keyframes linkedContentAppear {
  0% {
    opacity: 0;
    transform: translateY(-10px) scale(0.95);
  }
  100% {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

/* Thumbnail hover zone - covers right 50% of thumbnail for overlay activation */
.thumbnail-hover-zone {
  position: absolute;
  top: 0;
  right: 0;
  width: 50%;
  height: 100%;
  z-index: 10;
  pointer-events: auto;
  background: transparent;
  cursor: default;
}

/* Thumbnail hover overlay system - START */
.thumbnail-hover-overlay {
  position: fixed;
  width: 400px; /* Increased from 320px */
  background-color: rgba(0, 0, 0, 0.90);
  border-radius: 15px; /* Match thumbnail border radius */
  display: flex;
  flex-direction: row;
  align-items: center;
  padding: 12px 15px; /* Increased from 10px 12px */
  box-sizing: border-box;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.3s ease, transform 0.3s ease, background-color 0.2s ease;
  #right-hand-button.active-zoom {
    background: linear-gradient(135deg, #1e88e5, #42a5f5);
    color: #fff;
    box-shadow: 0 0 0 2px rgba(66,165,245,0.6);
  }
  
  /* Fit to viewport button active feedback */
  #right-hand-button.fit-viewport {
    background: linear-gradient(135deg, #4caf50, #66bb6a);
    color: #fff;
    box-shadow: 0 0 0 2px rgba(76,175,80,0.6);
  }
  z-index: 1001;
  transform: translateX(-10px) scaleX(0.8); /* Initial state for expansion animation */
  box-shadow: 0px 0px 19px rgba(0, 0, 0, 0.7); /* Increased from 15px */
  height: 106px; /* Increased from 85px */
  overflow: hidden;
  cursor: pointer;
  border: 1px solid var(--thumbnail-border-color, #444);
  /* Add a small buffer zone to reduce edge-case flickering */
  margin: -2px; /* Extend hit area slightly */
}

/* Hover effects for clickable overlays */
.thumbnail-hover-overlay:hover {
  background-color: rgba(10, 10, 10, 0.90);
  border-color: rgba(255, 255, 255, 0.15);
  transform: translateX(0) scale(1.02);
  box-shadow: 0px 0px 25px rgba(0, 0, 0, 0.8);
}

/* Active state for better feedback */
.thumbnail-hover-overlay:active {
  transform: translateX(0) scale(0.98);
  background-color: rgba(20, 20, 20, 0.90);
}

.thumbnail-hover-overlay.inverted {
  flex-direction: row-reverse;
}

.hover-thumbnail {
  width: 150px; /* Increased from 120px */
  height: 85px; /* Increased from 68px */
  object-fit: cover;
  border-radius: 5px; /* Increased from 4px */
  margin-right: 18px; /* Increased from 14px */
  box-shadow: 0 0 4px rgba(0, 0, 0, 0.3); /* Increased from 3px */
}

/* .hover-thumbnail[data-type="comparison"] {
  width: 56px; 
  height: 56px; 
  object-fit: cover;
  border-radius: 5px;
  margin: 6px 15px 6px 12px; 
  border: 1px solid rgba(255, 255, 255, 0.3);
  position: relative; 
} */

.comparison-badge {
  content: "";
  position: absolute;
  top: 50%;
  right: -5px; /* Increased from -4px */
  width: 50px; /* Increased from 40px */
  height: 50px; /* Increased from 40px */
  background-image: url(https://ultimxtechnologies.com/ultimx_app/assets/comp2.svg);
  background-size: contain;
  background-repeat: no-repeat;
  background-position: center;
  transform: translate(-50%, -50%);
  z-index: 10;
  pointer-events: none;
  display: none;
}



.thumbnail-hover-overlay.inverted .hover-thumbnail {
  margin-right: 0;
  margin-left: 18px; /* Increased from 14px */
}

/* Adjustments specifically for comparison hover overlays */
/* .thumbnail-hover-overlay[data-type="comparison"] {
  padding: 12px 22px 12px 12px; 
  min-width: 325px;
  height: 106px; 
}

.thumbnail-hover-overlay[data-type="comparison"] .hover-thumbnail[data-type="comparison"] {
  margin: 6px -8px 6px 12px; 
}

.thumbnail-hover-overlay[data-type="comparison"] .hover-content {
  width: calc(100% - 69px); 
  min-width: 175px; 
  max-width: 300px; 
  padding-left: 0;
  padding-right: 0;
} */

.hover-content {
  display: flex;
  flex-direction: column;
  justify-content: center;
  width: calc(100% - 168px); /* Increased from calc(100% - 134px) */
  height: 100%;
}

.hover-title {
  font-size: 14px; /* Font size unchanged */
  font-weight: bold;
  color: white;
  margin-bottom: 8px; /* Increased from 6px */
  text-align: left;
  overflow: hidden;
  text-overflow: ellipsis;
  text-shadow: 1px 1px 1px rgba(0, 0, 0, 0.8);
  line-height: 1.2;
  white-space: nowrap;
}

.hover-description {
  font-size: 12px; /* Font size unchanged */
  color: rgba(255, 255, 255, 0.95);
  text-align: left;
  overflow: hidden;
  text-overflow: ellipsis;
  text-shadow: 1px 1px 1px rgba(0, 0, 0, 0.8);
  line-height: 1.3;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* Green Lightbulb Navigation Icon for Thumbnail Overlays - Font Awesome Version */
.lightbulb-nav-icon {
    position: absolute;
    top: 68px;
    right: 168px;
    width: 24px;
    height: 24px;
    background: rgba(0, 0, 0, 0.4);
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
    z-index: 1000;
    border: 2px solid rgba(255, 255, 255, 0.3);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.3);
}

.lightbulb-nav-icon:hover {
    background: rgba(0, 0, 0, 0.6);
    transform: scale(1.1);
    border-color: rgba(255, 255, 255, 0.6);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.4);
}

/* Font Awesome lightbulb icon styling */
.lightbulb-nav-icon i {
    color: #00ffcc;
    font-size: 14px;
    transition: color 0.3s ease;
}

.lightbulb-nav-icon:hover i {
    color: #00ff00;
}

/* Hide lightbulb when not available */
.lightbulb-nav-icon.hidden {
    display: none;
}

/* Enhanced lightbulb animations and states */
.lightbulb-nav-icon:active {
    transform: scale(1.05);
    background: rgba(0, 0, 0, 0.7);
    box-shadow: 0 6px 16px rgba(0, 255, 204, 0.6);
}

.lightbulb-nav-icon:active i {
    color: #00ff00;
}

.lightbulb-nav-icon.navigating {
    animation: pulse-lightbulb 0.6s ease-in-out;
    pointer-events: none;
}

@keyframes pulse-lightbulb {
    0% { 
        background: rgba(0, 0, 0, 0.4);
        transform: scale(1);
    }
    50% { 
        background: rgba(0, 0, 0, 0.7);
        transform: scale(1.2);
        box-shadow: 0 8px 20px rgba(0, 255, 204, 0.8);
    }
    100% { 
        background: rgba(0, 0, 0, 0.4);
        transform: scale(1);
    }
}

@keyframes pulse-lightbulb-icon {
    0% { 
        color: #00ffcc;
    }
    50% { 
        color: #00ff00;
    }
    100% { 
        color: #00ffcc;
    }
}

.lightbulb-nav-icon.navigating i {
    animation: pulse-lightbulb-icon 0.6s ease-in-out;
}

/* Better positioning for different overlay types */
/* .thumbnail-hover-overlay[data-type="comparison"] .lightbulb-nav-icon {
    top: 72px;
    right: 80px;
} */

.thumbnail-hover-overlay .lightbulb-nav-icon {
    opacity: 1;
    transition: all 0.3s ease;
}

/* Ensure lightbulb doesn't interfere with overlay content */
.lightbulb-nav-icon {
    pointer-events: auto;
}

.thumbnail-hover-overlay {
    pointer-events: auto;
}

/* Success feedback */
.lightbulb-nav-icon.success {
    background: rgba(0, 0, 0, 0.8) !important;
    animation: success-flash 0.4s ease-out;
}

.lightbulb-nav-icon.success i {
    animation: success-flash-icon 0.4s ease-out;
}

@keyframes success-flash {
    0% { 
        background: rgba(0, 0, 0, 0.8);
        box-shadow: 0 4px 12px rgba(0, 255, 204, 0.4);
    }
    50% { 
        background: rgba(255, 255, 255, 0.9);
        box-shadow: 0 8px 20px rgba(255, 255, 255, 0.8);
    }
    100% { 
        background: rgba(0, 0, 0, 0.8);
        box-shadow: 0 4px 12px rgba(0, 255, 204, 0.4);
    }
}

@keyframes success-flash-icon {
    0% { 
        color: #00ff00;
    }
    50% { 
        color: #000000;
    }
    100% { 
        color: #00ff00;
    }
}

/* Tooltip styles for lightbulb
.lightbulb-nav-icon::after {
    content: attr(title);
    position: absolute;
    bottom: -30px;
    left: 50%;
    transform: translateX(-50%);
    background: rgba(0, 0, 0, 0.8);
    color: white;
    padding: 4px 8px;
    border-radius: 4px;
    font-size: 11px;
    white-space: nowrap;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.3s ease;
    z-index: 1002;
} */

.lightbulb-nav-icon:hover::after {
    opacity: 1;
}

/* Ensure tooltip doesn't interfere with overlay positioning */
.thumbnail-hover-overlay {
    overflow: visible;
}

/* Scrollable Suggestions Wrapper Styles */
.suggestions-wrapper {
  /* Default state - no scrolling, preserve existing behavior */
  overflow: visible;
  max-height: none;
  transition: max-height 0.3s ease, overflow 0.3s ease;
}

/* Enable scrolling when there are 8+ suggestions */
.suggestions-wrapper.scrollable {
  overflow-y: auto;
  overflow-x: hidden;
  /* Calculate max height to prevent overflow while maintaining spacing */
  max-height: 365px; /* Adjust based on logo and navigation space */
  padding-top: 5px;
  margin-bottom: 7px;
  /* Use padding-right to reserve space for scrollbar */
  padding-right: 0px; /* Reserve consistent space for scrollbar */
}

/* Auto-hiding scrollbar styling for suggestions wrapper */
.suggestions-wrapper.scrollable::-webkit-scrollbar {
  width: 6px;
}

.suggestions-wrapper.scrollable::-webkit-scrollbar-track {
  background: var(--scrollbar-track-color, rgba(255, 255, 255, 0.1));
  border-radius: 3px;
  opacity: 0; /* Hidden by default with opacity for smooth fading */
  transition: opacity 0.5s ease; /* Smooth fade transition */
}

.suggestions-wrapper.scrollable::-webkit-scrollbar-thumb {
  background: var(--scrollbar-thumb-color, rgba(255, 255, 255, 0.3));
  border-radius: 3px;
  opacity: 0; /* Hidden by default with opacity for smooth fading */
  transition: opacity 0.5s ease; /* Smooth fade transition */
}

.suggestions-wrapper.scrollable::-webkit-scrollbar-thumb:hover {
  background: var(--scrollbar-thumb-hover-color, rgba(255, 255, 255, 0.5));
  opacity: 1; /* Always visible on hover */
}

/* Show scrollbar when wrapper has show-scrollbar class */
.suggestions-wrapper.scrollable.show-scrollbar::-webkit-scrollbar-track {
  opacity: 1; /* Fade in smoothly */
}

.suggestions-wrapper.scrollable.show-scrollbar::-webkit-scrollbar-thumb {
  opacity: 1; /* Fade in smoothly */
}

/* Firefox auto-hiding scrollbar support */
.suggestions-wrapper.scrollable {
  scrollbar-width: thin;
  scrollbar-color: rgba(255, 255, 255, 0) rgba(255, 255, 255, 0); /* Fully transparent by default */
  transition: scrollbar-color 0.5s ease; /* Smooth transition for Firefox */
}

.suggestions-wrapper.scrollable.show-scrollbar {
  scrollbar-color: rgba(255, 255, 255, 0.3) rgba(255, 255, 255, 0.1); /* Fade in */
}

/* Fixed width container for buttons to prevent expansion */
.suggestions-wrapper.scrollable ul {
  list-style: none;
  padding: 0;
  margin-top: -10px;
  /* Fixed width to prevent button expansion when scrollbar hides */
  width: calc(100% - 2px); /* Account for reserved scrollbar space */
  box-sizing: border-box;
}

/* Preserve existing ul styles within the wrapper for non-scrollable state */
.suggestions-wrapper:not(.scrollable) ul {
  list-style: none;
  padding: 0;
  margin-top: -10px;
  /* Full width when not scrollable */
  width: 100%;
  box-sizing: border-box;
}

/* Ensure existing button styles are preserved */
.suggestions-wrapper ul li {
  margin: 10px 0;
  opacity: 1;
  transition: opacity 0.5s ease-in-out;
}

.suggestions-wrapper ul li.fade-out {
  opacity: 0;
}

/* Preserve all existing button styling */
.suggestions-wrapper ul li button {
  background: rgba(0, 0, 0, 0.292);
  border: var(--sidebar-button-border-width, 2px) solid var(--primary-color);
  padding: 6px var(--sidebar-button-padding);
  width: 100%;
  max-height: 43px;
  min-height: 43px;
  text-align: left;
  line-height: 1.2;
  display: flex;
  align-items: center;
  color: var(--primary-color);
  font-weight: bold;
  border-radius: 5px;
  cursor: pointer;
  transition: all 0.3s ease-in-out;
  opacity: 1; /* Start invisible */
  box-sizing: border-box; /* Ensure consistent sizing with padding/borders */
}

.suggestions-wrapper ul li button.visible {
  opacity: 1 !important;
  transition: opacity 0.3s ease-in-out, background 0.3s ease-in-out, color 0.3s ease-in-out;
}

.suggestions-wrapper ul li button.fade-in {
  opacity: 0;
  transition: opacity 0.3s ease-in-out;
}

.suggestions-wrapper ul li button.fade-in.visible {
  opacity: 1;
}

.suggestions-wrapper ul li button:hover {
  background: var(--sidebar-button-hover-color);
  color: white;
  border-color: white;
}

.suggestions-wrapper ul li button.new-suggestion {
  animation: newButtonAppear 0.5s ease-out forwards;
  border-color: rgba(255, 255, 255, 0.8);
  box-shadow: 0 0 10px rgba(255, 255, 255, 0.2);
  transition: all 0.3s ease-in-out; /* Add transition for hover effects */
}

.suggestions-wrapper ul li button.new-suggestion:hover,
.suggestions-wrapper ul li button.existing-suggestion:hover,
.suggestions-wrapper ul li button:hover {
  background: var(--sidebar-button-hover-color) !important;
  color: white !important;
  border-color: white !important;
}

.suggestions-wrapper ul li button.existing-suggestion {
  opacity: 1;
}

/* Move navigation positioning to account for new wrapper */
.suggestions-nav {
  display: flex;
  justify-content: center;
  gap: 10px;
  margin-top: 10px;
  padding: 0 10px;
  width: 100%;
  box-sizing: border-box;
}

/* Scroll indicator button for scrollable suggestions - part of navigation */
.suggestions-nav .scroll-indicator {
  /* Inherit all navigation button styling */
  background: rgba(0, 0, 0, 0.292);
  border: 2px solid var(--primary-color);
  color: var(--primary-color);
  padding: 6px;
  border-radius: 5px;
  cursor: pointer; /* Make it clickable */
  transition: all 0.3s ease;
  width: 32px;
  height: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 12px;
  
  /* Scroll indicator specific styling */
  opacity: 0;
  transform: translateY(-5px);
  pointer-events: none;
}

.suggestions-nav .scroll-indicator.visible {
  opacity: 0.6;
  transform: translateY(0);
  animation: scrollIndicatorBounce 1s ease-in-out;
  pointer-events: auto; /* Enable clicks when visible */
}

.suggestions-nav .scroll-indicator.visible:hover {
  opacity: 1;
  background: var(--sidebar-button-hover-color);
  border-color: white;
  color: white;
}

.suggestions-nav .scroll-indicator i {
  color: var(--primary-color, white);
  font-size: 12px; /* Match navigation button font size */
  filter: drop-shadow(0 0 3px rgba(0, 0, 0, 0.5));
}

.suggestions-nav .scroll-indicator.hidden {
  display: none;
}

/* Bounce animation for scroll indicator */
@keyframes scrollIndicatorBounce {
  0% {
    transform: translateY(0);
  }
  50% {
    transform: translateY(3px); /* Reduced bounce for button context */
  }
  100% {
    transform: translateY(0);
  }
}

/* Permanently hide navigation buttons while keeping scroll indicator visible */
#next-suggestions,
#prev-suggestions {
    display: none !important;
}

/* ===========================
   Clear Data Modal Styling
   =========================== */

/* Clear Data Button - with trash icon hint */
.clear-data-btn::after {
    content: '🗑️';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    font-size: 6px;
    opacity: 0;
    transition: opacity 0.3s ease;
    pointer-events: none;
}

.clear-data-btn:hover::after {
    opacity: 1;
}

/* Clear Data Modal Content Customization */
#clear-data-modal .modal-content {
    max-width: 500px;
    min-width: 400px;
}

#clear-data-modal h2 {
    margin: 0 0 15px 0;
    font-size: 1.5em;
    text-align: center;
    color: white;
}

/* Warning Message */
.clear-data-warning {
    background: rgba(255, 193, 7, 0.2);
    border: 1px solid rgba(255, 193, 7, 0.5);
    border-radius: 5px;
    padding: 12px;
    margin-bottom: 20px;
    text-align: center;
    color: #ffc107;
    font-weight: 500;
}

/* Clear Data Options Container */
.clear-data-options {
    display: flex;
    flex-direction: column;
    gap: 12px;
    margin: 20px 0;
}

/* Individual Option Button */
.clear-data-option {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 16px;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.3s ease;
    text-align: left;
    width: 100%;
    color: white;
}

.clear-data-option:hover {
    background: rgba(255, 255, 255, 0.1);
    border-color: rgba(255, 255, 255, 0.3);
    transform: translateX(5px);
}

.clear-data-option:active {
    transform: translateX(5px) scale(0.98);
}

.clear-data-option .option-content {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.clear-data-option strong {
    color: white;
    font-size: 1.05em;
    display: block;
    font-weight: 600;
}

.clear-data-option small {
    color: rgba(255, 255, 255, 0.65);
    font-size: 0.85em;
    display: block;
    line-height: 1.4;
}

.clear-data-option i {
    color: rgba(255, 255, 255, 0.4);
    font-size: 1em;
    flex-shrink: 0;
    transition: all 0.3s ease;
}

.clear-data-option:hover i {
    color: rgba(255, 255, 255, 0.8);
    transform: translateX(3px);
}

/* Modal Buttons */
#clear-data-modal .modal-buttons {
    display: flex;
    justify-content: center;
    gap: 10px;
    margin-top: 20px;
}

.danger-btn {
    background-color: #dc3545;
    color: white;
    padding: 10px 24px;
    border: none;
    border-radius: 5px;
    cursor: pointer;
    font-weight: bold;
    transition: all 0.3s ease;
}

.danger-btn:hover:not(:disabled) {
    background-color: #c82333;
    transform: scale(1.05);
}

.danger-btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

#close-clear-data-modal {
    background-color: rgba(255, 255, 255, 0.2);
    color: white;
    padding: 10px 24px;
    border: none;
    border-radius: 5px;
    cursor: pointer;
    font-weight: bold;
    transition: all 0.3s ease;
}

#close-clear-data-modal:hover {
    background-color: rgba(255, 255, 255, 0.3);
}

/* Feedback Messages */
.clear-data-feedback {
    margin-top: 15px;
    padding: 12px;
    border-radius: 5px;
    display: flex;
    align-items: flex-start;
    gap: 10px;
    animation: fadeIn 0.3s ease;
    transition: opacity 0.3s ease;
}

.clear-data-feedback strong {
    font-size: 1.2em;
    flex-shrink: 0;
}

.clear-data-feedback span {
    flex: 1;
    line-height: 1.4;
}

.clear-data-feedback-success {
    background: rgba(40, 167, 69, 0.2);
    border: 1px solid rgba(40, 167, 69, 0.5);
    color: #28a745;
}

.clear-data-feedback-error {
    background: rgba(220, 53, 69, 0.2);
    border: 1px solid rgba(220, 53, 69, 0.5);
    color: #dc3545;
}

.clear-data-feedback-info {
    background: rgba(23, 162, 184, 0.2);
    border: 1px solid rgba(23, 162, 184, 0.5);
    color: #17a2b8;
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(-10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* End of suggestions wrapper styles */

/* ============================================
   Visual Selector Modal (Background & Logo)
   ============================================ */

#visual-selector-modal {
    backdrop-filter: blur(8px);
}

#visual-selector-modal.active {
    display: flex;
    animation: modalFadeIn 0.3s ease;
}

.visual-selector-content {
    background: rgba(20, 20, 20, 0.95);
    border-radius: 12px;
    border: 1px solid rgba(255, 255, 255, 0.15);
    padding: 0;
    max-width: 1200px;
    width: 90%;
    max-height: 95vh;
    display: flex;
    flex-direction: column;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.6);
    animation: slideUp 0.3s ease;
}

.visual-selector-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px 24px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.visual-selector-title {
    margin: 0;
    font-size: 20px;
    font-weight: 600;
    color: #ffffff;
}

.visual-selector-close {
    background: none;
    border: none;
    font-size: 32px;
    color: rgba(255, 255, 255, 0.6);
    cursor: pointer;
    padding: 0;
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
    border-radius: 4px;
}

.visual-selector-close:hover {
    background: rgba(255, 255, 255, 0.1);
    color: #ffffff;
    transform: scale(1.1);
}

.visual-selector-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
    gap: 16px;
    padding: 24px;
    overflow-y: auto;
    max-height: calc(85vh - 80px);
}

/* Logo grid - wider columns for rectangular logos */
.visual-selector-grid.logo-grid {
    grid-template-columns: repeat(3, 1fr); /* Force exactly 3 columns */
    gap: 24px; /* Increased spacing to prevent vertical overlap */
    row-gap: 28px; /* Extra vertical spacing */
}

/* Custom scrollbar for grid */
.visual-selector-grid::-webkit-scrollbar {
    width: 8px;
}

.visual-selector-grid::-webkit-scrollbar-track {
    background: rgba(255, 255, 255, 0.05);
    border-radius: 4px;
}

.visual-selector-grid::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.2);
    border-radius: 4px;
}

.visual-selector-grid::-webkit-scrollbar-thumb:hover {
    background: rgba(255, 255, 255, 0.3);
}

.visual-selector-item {
    position: relative;
    cursor: pointer;
    border-radius: 8px;
    overflow: hidden;
    transition: all 0.3s ease;
    border: 2px solid transparent;
    background: rgba(255, 255, 255, 0.05);
    aspect-ratio: 16 / 9;
}

.visual-selector-item:hover {
    transform: translateY(-4px);
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.4);
    border-color: rgba(255, 255, 255, 0.3);
}

.visual-selector-item.active {
    border-color: #4CAF50;
    box-shadow: 0 0 0 3px rgba(76, 175, 80, 0.3);
}

.visual-selector-item img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.visual-selector-item-overlay {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    background: linear-gradient(to top, rgba(0, 0, 0, 0.8), transparent);
    padding: 8px 12px;
    font-size: 11px;
    color: rgba(255, 255, 255, 0.9);
    font-weight: 500;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.visual-selector-item:hover .visual-selector-item-overlay {
    opacity: 1;
}

.visual-selector-item.active .visual-selector-item-overlay {
    opacity: 1;
    background: linear-gradient(to top, rgba(76, 175, 80, 0.9), transparent);
}

/* Logo-specific styling */
.visual-selector-item.logo-item {
    background: rgba(40, 40, 40, 0.9);
    aspect-ratio: 3.75 / 1; /* Match typical logo dimensions (721x192 = ~3.75:1) */
    min-height: 70px; /* Slightly reduced for better fit */
    max-height: 90px; /* Prevent excessive height */
    padding: 12px 20px; /* Padding on container, not image */
    box-sizing: border-box; /* Include padding and border in width calculation - prevents overlap! */
}

.visual-selector-item.logo-item img {
    object-fit: contain;
    width: 100%;
    height: 100%;
}

.visual-selector-item.logo-item:hover {
    background: rgba(50, 50, 50, 1);
    border-color: rgba(255, 255, 255, 0.4);
}

/* Visual selector animations */
@keyframes modalFadeIn {
    from {
        opacity: 0;
    }
    to {
        opacity: 1;
    }
}

@keyframes slideUp {
    from {
        transform: translateY(20px);
        opacity: 0;
    }
    to {
        transform: translateY(0);
        opacity: 1;
    }
}

/* Responsive adjustments */
@media (max-width: 768px) {
    .visual-selector-grid {
        grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
        gap: 12px;
        padding: 16px;
    }

    .visual-selector-header {
        padding: 16px;
    }

    .visual-selector-title {
        font-size: 18px;
    }
}

/* End of visual selector styles */
