:root {
  --bg: #1a1a1a;
  --fg: #f0f0f0;
  --accent: #4CAF50;
  --hover: #333;
  --border: #3a3a3a;
  --highlight: #ffda6a;
  --danger: #e53935;
  --warning: #ff9800;
  --muted: #888;
  --button-radius: 24px;
  --transition-speed: 0.2s;
  --base-font-size: 13px;
  
}
.light-theme #playlist-container {
  background-color: #e9f5ff; /* soft blue background */
  box-shadow: 0 0 10px rgba(0, 128, 255, 0.15);
}

.light-theme td.dance-name a {
  color: #333; /* very dark grey */
}

.light-theme #playlist li {
  background-color: #f0faff; /* slightly lighter for tracks */
  color: #111;
}

.light-theme .rank-col {
  background-color: #d0ebff; /* vivid light blue for rank # */
  color: #003366;
  font-weight: bold;
}
.dance-link {
  font-size: 1.05rem;
  font-weight: bold;
  text-decoration: none;
  color: var(--fg); /* dynamic color */
}

.dance-link:hover {
  color: var(--highlight); /* bright on hover */
}


.light-theme {
  --bg: #fdfdfd;
  --fg: #111;
  --accent: #0078d7;
  --hover: #e8f0fe;
  --border: #ccc;
  --highlight: #0056b3;
  --danger: #d32f2f;
  --warning: #f57c00;
  --muted: #666;
}

.light-theme body {
  background-color: var(--bg);
  color: var(--fg);
}

.light-theme table {
  background-color: #fff;
  border-color: var(--border);
}

.light-theme th {
  background-color: #f0f0f0;
  color: var(--highlight);
}

.light-theme tr:nth-child(even) {
  background-color: #fafafa;
}

.light-theme tr:hover {
  background-color: #f5faff;
}

.light-theme nav {
  background-color: #e9f5ff;
  border-bottom: 1px solid #ddd;
}

.light-theme nav a {
  color: var(--accent);
}

.light-theme nav a:hover {
  color: #004080;
}

.light-theme .play-btn,
.light-theme .pause-btn,
.light-theme .add-btn,
.light-theme .download-btn,
.light-theme .stop-btn,
.light-theme .delete-btn,
.light-theme .tube-btn {
  background: transparent;
  color: var(--accent);
  border: 1px solid var(--border);
}

.light-theme .play-btn:hover,
.light-theme .pause-btn:hover,
.light-theme .add-btn:hover,
.light-theme .download-btn:hover,
.light-theme .stop-btn:hover,
.light-theme .delete-btn:hover {
  background-color: var(--hover);
}

.light-theme #playlist li {
  background-color: #f4f4f4;
  border-left: 4px solid var(--accent);
  color: var(--fg);
}

.light-theme #playlist li.playing {
  border-left-color: #ff8a00;
  background-color: #e8f0fe;
}

.light-theme input[type="text"],
.light-theme .comment-input {
  background-color: #fff;
  color: #111;
  border: 1px solid var(--border);
}

.light-theme button[type="submit"] {
  background: var(--accent);
  color: white;
}

.light-theme h1,
.light-theme h2 {
  background: var(--accent);
  color: white;
}

.light-theme footer {
  background-color: #eee;
  color: #444;
}
.extra-height {
  min-height: 85vh;
}


.video-wrapper {
  position: relative;
  display: inline-block;
}

.video-icon {
  cursor: pointer;
  display: inline-block;
}

.video-popup {
  /* positioning and styling */
  position: absolute;
  top: 100%;
  left: 0;
  z-index: 1000;
  background-color: #222;
  color: white;
  border: 1px solid var(--border);
  padding: 12px;
  border-radius: 8px;
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.7);
  
  /* grid layout with a max of 4 columns */
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
  max-width: calc(140px * 4 + 30px); /* 4 items + gap space (approx) */
  gap: 10px;
  width: max-content;

  overflow: hidden;
  opacity: 0;
  pointer-events: none;
  transform: translateY(10px);
  transition: opacity 0.25s ease, transform 0.25s ease;
}



/* This makes the popup stay visible when you hover over the icon OR the popup */
.video-wrapper:hover .video-popup,
.video-popup:hover {
  opacity: 1;

  pointer-events: auto;
  transform: translateY(0);
}
.video-popup {
  /* ... existing styles ... */
  will-change: transform;
}
@media (max-width: 600px) {
  .video-popup {
    position: fixed;
    top: 30%;
    left: 50%;
    transform: translate(-50%, -50%);
    max-width: 90vw;
    width: max-content;
    z-index: 1000;

    grid-template-columns: repeat(auto-fit, minmax(50px, 1fr)); /* smaller columns */
    gap: 4px;

    opacity: 0;
    pointer-events: none;
    transition: opacity 0.25s ease, transform 0.25s ease;
  }

  .video-wrapper:hover .video-popup,
  .video-popup:hover {
    opacity: 1;
    pointer-events: auto;
    transform: translate(-50%, -45%);
  }

  .video-popup a {
    min-width: 50px;
    max-width: 60px;
  }

  .video-popup img {
    width: 100%;
    height: auto;
    border-radius: 3px;
    filter: brightness(0.9);
    transition: filter 0.3s ease;
  }

  .video-popup a:hover img {
    filter: brightness(1);
  }
}

.video-popup img {
  width: 100%;
  height: auto;
  border-radius: 6px;
  filter: brightness(0.9);
  transition: filter 0.3s ease, box-shadow 0.3s ease;
}

.video-popup a:hover img {
  filter: brightness(1.15);
  box-shadow: 0 0 10px 3px rgba(255, 255, 255, 0.6);
}

th.rank-col,
td.rank-col {
  text-align: center;
  font-weight: bold;
  background-color: #444; /* Slightly lighter */
  color: var(--highlight);
  width: 30px;
  font-size: 1.4rem;
  padding: 6px;
  border: none;
  box-shadow: none;
  border-radius: 16px; /* More rounded corners */
}

td.dance-name a {
  color: white;
  
  text-decoration: none;
  font-size: 1rem;
}

td.dance-name a:hover {
  color: #ccc;
}

/* Level line below DanceName */
.dance-level-detail {
  font-style: italic;
  font-size: 0.75rem;
  color: #bbb;
  margin-top: 2px;
}

/* Song name line (Music title) */
td.dance-name {
  font-size: 0.75rem;
  color: #dedbdb;
}
body {
  font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
  background-color: var(--bg);
  color: var(--fg);
  margin: 0;
  padding-bottom: 80px;
  font-size: var(--base-font-size);
}

/* Switch Styling */
.switch {
  position: relative;
  display: inline-block;
  width: 34px;
  height: 20px;
}

.switch input {
  opacity: 0;
  width: 0;
  height: 0;
}

.slider {
  position: absolute;
  cursor: pointer;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background-color: #ccc;
  transition: 0.4s;
  border-radius: 50px;
}

.slider:before {
  position: absolute;
  content: "";
  height: 12px;
  width: 12px;
  border-radius: 50px;
  left: 4px;
  bottom: 4px;
  background-color: white;
  transition: 0.4s;
}

input:checked + .slider {
  background-color: #4CAF50;
}

input:checked + .slider:before {
  transform: translateX(14px);
}


h1, h2 {
  text-align: center;
  margin: 0;
  padding: 10px;
  background: var(--accent);
  color: #fff;
  border-bottom: 2px solid #3c3c3c;
  font-size: 1.2rem;
}

nav {
  background: #2b2b2b;
  padding: 10px 0;
  text-align: center;
  font-size: 0.9rem;
}

nav a {
  color: var(--highlight);
  margin: 0 8px;
  text-decoration: none;
}

nav a:hover {
  color: orange;
}

form {
  text-align: center;
  margin: 15px 0;
}

input[type="text"],
button[type="submit"] {
  padding: 4px 5px;
  border-radius: var(--button-radius);
  border: none;
  background: #2e2e2e;
  color: var(--fg);
  font-size: 0.85rem;
}

button[type="submit"] {
  background: var(--accent);
  color: white;
  cursor: pointer;
}

button[type="submit"]:hover {
  background: #66bb6a;
}

.table-container {
  overflow-x: auto;
  margin: 12px auto;
  table-layout: auto; /* Let content determine column width */
  max-width: 99%;
  border-radius: 8px;
}

table {
  width: 100%;
  border-collapse: collapse;
  background-color: #262626;
  border: 1px solid var(--border);
  border-radius: 6px;
  overflow: hidden;
  font-size: 0.8rem;
}

th, td {
  padding: 6px 10px;
  border: 1px solid var(--border);
  text-align: left;
  font-size: 0.75rem;
  vertical-align: middle;
}
td.dance-name,
th.dance-name {
  max-width: 280px; 
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}


th {
  background-color: #3c3c3c;
  color: var(--highlight);
}

tr:nth-child(even) {
  background-color: #1f1f1f;
}

tr:hover {
  background-color: #2f2f2f;
}

footer {
  background: #222;
  color: #aaa;
  padding: 6px;
  text-align: center;
  position: fixed;
  bottom: 0;
  width: 100%;
  font-size: 0.75rem;
}

#playlist-container {
  background-color: #212121;
  border-radius: 12px;
  padding: 8px;
  margin: 8px auto;
  width: 97%;
  max-width: 800px;
  box-shadow: 0 0 10px rgba(0,0,0,0.4);
}

#playlist li {
  background: #2b2b2b;
  padding: 4px 6px;
  border-radius: 4px;
  margin-bottom: 4px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  border-left: 4px solid var(--accent);
  flex-wrap: wrap;
  gap: 8px;
  font-size: 0.8rem;
}

#playlist li.playing {
  border-left-color: orange;
  background: #383838;
}

.track-actions {
  display: flex;
  justify-content: space-between;
  align-items: center;
  width: 100%;
  gap: 10px;
  flex-wrap: wrap;
}

.track-actions > div {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
  flex: 1 1 auto;
}

.play-btn, .pause-btn, .add-btn, .stop-btn, .delete-btn, .download-btn, .tube-btn{
  font-size: 28px;
  cursor: pointer;
  border: none;
  transition: background var(--transition-speed);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 20px;
  padding: 3px 3px;
  touch-action: manipulation;
  z-index: 10;
  pointer-events: auto;
  position: relative;

}

.stop-btn { background: var(--danger); color: white; }
.download-btn { background: var(--danger); color: white; }
.pause-btn { background: var(--warning); color: white; }
.stop-btn { background: var(--danger); color: white; }
.add-btn { background: #ffa000; color: #000; }
.delete-btn { background: var(--danger); color: white; }

.play-btn:hover,
.pause-btn:hover,
.stop-btn:hover,
.add-btn:hover,
.delete-btn:hover {
  opacity: 0.9;
}

.stepsheet-link {
  color: var(--highlight);
  font-size: 0.85rem;
  margin-left: 4px;
}

input[type="checkbox"] {
  transform: scale(1.1);
}
.learned-toggle {
  background: none;
  border: none;
  padding: 4px;
  cursor: pointer;
  transition: transform 0.2s ease;
}
.star-icon {
  width: 26px;
  height: 26px;
  transition: transform 0.3s ease, fill 0.3s ease;
  fill: none;
  stroke: gold;
  stroke-width: 2;
  cursor: pointer;
}
.dance-name-wrapper {
  position: relative;
}

.learned-topcorner {
  position: absolute;
  top: 4px;
  right: 6px;
  z-index: 5;
}

.learned-topcorner .learned-toggle {
  background: none;
  border: none;
  padding: 2px;
  cursor: pointer;
}

.learned-topcorner .star-icon {
  width: 20px;
  height: 20px;
}

/* Improve dropdown content layout */
.dropdown-content {
  display: none;
  flex-direction: column;
  align-items: flex-start;
  gap: 0.4em;
  line-height: 1.4;
  text-align: left;
  padding: 1em;
}

/* Ensure dropdown items are aligned horizontally with spacing */
.dropdown-content a,
.dropdown-content strong,
.dropdown-content hr {
  display: block;
  width: 100%;
}

/* Center dropdown in mobile view */
@media (max-width: 692px) {
  .dropdown-content {
    position: fixed;
    top: 30%;
    left: 50%;
    transform: translate(-50%, -50%);
    min-width: 280px;
    max-width: 90vw;
    background-color: #222;
    padding: 1em;
    border: 1px solid #444;
    border-radius: 10px;
    text-align: center;
    z-index: 9999;
  }

  .dropdown-content a,
  .dropdown-content strong {
    text-align: center;
  }
}

/* Increase breakpoint for mobile nav toggle */
@media (max-width: 692px) {
  .nav-header {
    display: flex;
    justify-content: flex-end;
    padding: 0 1em;
  }

  .nav-links {
    display: none;
    flex-direction: column;
    align-items: flex-start;
    padding: 1em;
    background-color: #111;
    text-align: left;
    width: 100%;
  }

  .nav-links.active {
    display: flex;
  }

  .nav-main {
    flex-direction: column;
    align-items: flex-start;
    gap: 0.5em;
    width: 100%;
  }

  .separator {
    display: none;
  }

  .dropdown-content {
    position: static;
    width: 100%;
    min-width: 0;
  }
}

/* Match admin sections to dropdown content style */
.dropdown-content .admin-section {
  display: flex;
  flex-direction: column;
  width: 100%;
  margin-top: 0.75em;
  text-align: left;
}

/* Align collapsible buttons in admin section */
.dropdown-content .admin-section .collapsible-btn {
  width: 100%;
  text-align: left;
  padding: 0.4em 0;
  border: none;
  background: none;
  color: var(--highlight);
  font-size: 0.95rem;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 0.5em;
}

/* Style the collapsible content in admin section */
.dropdown-content .admin-section .content {
  margin-left: 1em;
  margin-top: 0.4em;
  color: #ccc;
  max-width: 100%;
  font-size: 0.85rem;
}

/* Adjust admin tools appearance in mobile dropdown */
@media (max-width: 692px) {
  .dropdown-content .admin-section {
    align-items: center;
  }

  .dropdown-content .admin-section .collapsible-btn {
    justify-content: center;
    text-align: center;
  }

  .dropdown-content .admin-section .content {
    margin-left: 0;
    text-align: center;
  }
}


.choreo-icons-row {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-top: 4px;
  flex-wrap: wrap;
}

.star-icon.learned {
  fill: gold;
  stroke: gold;
  animation: pulseStar 0.5s ease-in-out;
}

@keyframes pulseStar {
  0% {
    transform: scale(1);
    opacity: 0.6;
  }
  50% {
    transform: scale(1.5);
    opacity: 1;
  }
  100% {
    transform: scale(1);
    opacity: 0.9;
  }
}




.comment-input {
  width: 100%;
  max-width: 245px;
  padding: 3px;
  border-radius: var(--button-radius);
  border: 1px solid var(--border);
  background: #2a2a2a;
  color: white;
  font-size: 0.75rem;
}

.comment-input::placeholder {
  color: var(--muted);
}
/* Mobile-friendly, clean icon-style buttons */
.play-btn, .add-btn, .download-btn, .delete-btn {
  background: none;
  border: none;
  font-size: 1.6em;
  padding: 4px 6px;
  cursor: pointer;
  color: white;
}
.expanding {
  opacity: 0;
}
/* Prevent wrapping and make horizontal scrolling work */
@media (max-width: 692px) {
  #playlist li {
    display: flex;
    flex-direction: row;
    flex-wrap: nowrap;
    overflow-x: auto;
    align-items: center;
  }

  .track-actions {
    flex-direction: row;
    flex-wrap: nowrap;
    align-items: center;
    gap: 8px;
    width: 100%;
  }

  .track-actions > div {
    display: flex;
    flex-direction: row;
    flex-wrap: nowrap;
    align-items: center;
    gap: 8px;
    min-width: 0;
  }

  .track-actions button {
    flex-shrink: 0;
  }

  .track-duration,
  .track-actions span {
    white-space: nowrap;
    flex-shrink: 0;
  }
}
 
  .animated-container {
  animation: fadeInSlide 0.6s ease-in-out;
}

.fade-in {
  animation: fadeIn 1s ease-in-out;
}

.fade-slide-up {
  animation: slideUp 0.7s ease-out;
}

.fade-hover {
  transition: opacity 0.3s ease;
}
.fade-hover:hover {
  opacity: 0.6;
}

@keyframes fadeInSlide {
  from {
    opacity: 0;
    transform: translateY(10px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes fadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

@keyframes slideUp {
  from {
    opacity: 0;
    transform: translateY(20px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.animated-container {
  overflow: hidden;
  transition: height 0.4s ease, opacity 0.4s ease;
  height: auto;
  opacity: 1;
}

.collapsing {
  height: 0 !important;
  opacity: 0;
  transition: height 0.4s ease, opacity 0.4s ease;
  overflow: hidden;
}

.expanding {
  opacity: 0;
}

.playlist-scroll {
  list-style: none;
  padding: 0;
  overflow-y: auto;

  /* Responsive max-height */
  max-height: 40vh; /* 40% of viewport height */
}

/* WebKit-based browsers (Chrome, Safari, Edge) */
.playlist-scroll::-webkit-scrollbar {
  width: 8px;
}

.playlist-scroll::-webkit-scrollbar-track {
  background: #f0f0f0;
  border-radius: 10px;
}

.playlist-scroll::-webkit-scrollbar-thumb {
  background-color: #888;
  border-radius: 10px;
  border: 2px solid transparent;
  background-clip: content-box;
}

.playlist-scroll::-webkit-scrollbar-thumb:hover {
  background-color: #555;
}

/* Firefox scrollbar styling */
@supports (scrollbar-color: auto) {
  .playlist-scroll {
    scrollbar-width: thin;
    scrollbar-color: #888 #f0f0f0;
  }
}

/* Rank icons for top 1–10 */




#playlist li.playing {
  border-left-color: orange;
  background: #383838;
}

.video-popup {
  max-height: 80vh;
  overflow-y: auto;
}

/* Prevent clipping from scrollable containers */
.video-wrapper {
  overflow: visible;
}

/* Optional: Better handling for screen height and bottom placement */
@media (min-width: 601px) {
  .video-popup {
    bottom: auto;
    top: auto;
    transform: translateY(0);
    max-height: 80vh;
  }

  .video-wrapper:hover .video-popup,
  .video-popup:hover {
    opacity: 1;
    pointer-events: auto;
    transform: translateY(0);
  }
}
