/* ===================== AUDIO ===================== */

/* Audio Grid */
.audio-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
  gap: 20px;
  margin-bottom: 20px;
  /* overflow: visible; Breaks margins with the footer */
  transition: max-height var(--transition-slow), opacity var(--transition-slow),
    transform var(--transition-slow);
  transform-origin: top;
  opacity: 1;
  max-height: 2000px;
  transform: scaleY(1);
}

.audio-grid.collapsed {
  max-height: 0;
  opacity: 0;
  transform: scaleY(0.7);
  pointer-events: none;
}

/* Audio Cards */
.audio-card {
  background: var(--card-bg);
  padding: 15px;
  border-radius: 10px;
  box-shadow: 0 2px 5px rgba(0, 0, 0, 0.1);
  display: flex;
  flex-direction: column;
  align-items: center;
  transition: transform var(--transition-fast);
}

.audio-card:hover {
  transform: translateY(-2px);
  box-shadow: var(--box-shadow-lg);
}

.file-name {
  font-weight: bold;
  margin-bottom: 5px;
  text-align: center;
  font-size: 1rem;
  color: var(--card-text);
  cursor: pointer;
}

.file-name:hover {
  color: var(--primary-color);
}

.file-description {
  font-size: 0.9em;
  text-align: center;
  color: var(--highlight);
  margin-bottom: 8px;
}

.extra-info {
  font-size: 0.85em;
  margin-top: 5px;
  color: var(--highlight);
  max-height: 0;
  overflow: hidden;
  opacity: 0;
  transform: translateY(-10px);
  transition: max-height var(--transition-normal), opacity var(--transition-normal),
    transform var(--transition-normal), margin-top var(--transition-normal);
}

.extra-info.visible {
  max-height: 2000px;
  opacity: 1;
  transform: translateY(0);
}

.sound-player {
  padding: 20px;
}

/* ===================== BUTTONS ===================== */

button {
  font-family: "HornetDisplay", sans-serif;
  padding: 8px 14px;
  font-size: 14px;
  border: none;
  border-radius: 5px;
  cursor: pointer;
  transition: background-color var(--transition-fast), transform var(--transition-fast);
}

button:hover {
  transform: translateY(-1px);
}

.button-group {
  display: flex;
  gap: 10px;
}

.play-button {
  background-color: #4caf50;
  color: white;
}

.stop-button {
  background-color: #f44336;
  color: white;
}

.global-button {
  background-color: #2196f3;
  color: white;
  margin: 5px;
}

/* Button States */
.play-button:active {
  background-color: #388e3c;
}

.play-button.loading,
.global-button.loading,
.play-button.active,
.global-button.active {
  background-color: #81c784;
  color: black;
  animation: pulse 1.2s infinite;
}

.stop-button:active {
  background-color: #c62828;
}

.global-button:active {
  background-color: #1976d2;
}

.play-button.active,
.global-button.active {
  background-color: #ffca28;
}

.global-button.disabled {
  background-color: #ccc;
  cursor: not-allowed;
  pointer-events: none;
}

/* ===================== ANIMATIONS ===================== */

@keyframes pulse {
  0% {
    box-shadow: 0 0 0px rgba(255, 202, 40, 0.4);
  }
  50% {
    box-shadow: 0 0 12px rgba(255, 202, 40, 0.9);
  }
  100% {
    box-shadow: 0 0 0px rgba(255, 202, 40, 0.4);
  }
}

/* ===================== SYMBOL DROPDOWN ===================== */

#symbol-filter-wrapper {
  position: relative;
}

.symbol-dropdown {
  position: absolute;
  top: 100%;
  right: 0;
  background: var(--card-bg);
  border: 1px solid #ccc;
  max-height: 0;
  overflow: hidden;
  z-index: 1000;
  min-width: 500px;
  padding: 0 10px;
  box-shadow: 0 2px 5px rgba(0, 0, 0, 0.2);
  text-align: center;
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  justify-content: center;
  opacity: 0;
  transform: translateY(-10px);
  transition: max-height var(--transition-normal), opacity var(--transition-normal),
    transform var(--transition-normal), padding var(--transition-normal);
}

.symbol-dropdown.visible {
  max-height: 300px;
  overflow-y: auto;
  opacity: 1;
  transform: translateY(0);
  padding: 10px;
}

.symbol-dropdown label {
  width: 64px;
  display: inline-flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
}

.symbol-dropdown img {
  border: 1px solid white;
  border-radius: 2px;
}

/* ===================== NAVIGATION ===================== */

nav {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  padding: 1rem 4vw;
  display: flex;
  justify-content: space-between;
  align-items: center;
  z-index: 100;
  background: var(--nav-bg);
  backdrop-filter: blur(0px);
  transition: background 0.3s ease, box-shadow 0.3s ease, backdrop-filter 0.3s ease;
  box-sizing: border-box;
}

nav.scrolled {
  background: var(--nav-bg-solid);
  backdrop-filter: blur(6px);
  box-shadow: 0 4px 10px rgba(0, 0, 0, 0.1);
}

.logo {
  font-size: 1.1rem;
  font-weight: bold;
  display: flex;
  /* align-items: center; */
  line-height: 31px;
  gap: 10px; /* replaces margin-right on img */
}

.logo img {
  height: 32px;
  vertical-align: middle;
  margin-right: 10px;
}

.nav-links {
  display: flex;
  align-items: center;
  gap: 1.5rem;
}

.nav-links.menu-open {
  top: 0;
}

.nav-links a {
  color: var(--fg);
  text-decoration: none;
  margin-left: 1.5rem;
  font-size: 0.95rem;
  position: relative;
  transition: color 0.3s ease;
  flex-shrink: 0;
}

.nav-links a::after {
  content: "";
  position: absolute;
  bottom: -4px;
  left: 0;
  height: 2px;
  width: 0;
  background: var(--accent);
  transition: width 0.3s ease;
}

.nav-links a:hover::after {
  width: 100%;
}

.nav-links a.active::after {
  width: 100%;
}

.nav-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
}

.nav-header a {
  color: var(--fg);
  text-decoration: none;
  transition: color 0.3s ease;
}

.theme-toggle {
  background: none;
  border: 1px solid var(--fg);
  color: var(--fg);
  padding: 8px 12px;
  border-radius: 6px;
  font-size: 0.85rem;
  cursor: pointer;
  margin-left: 1.5rem;
  white-space: nowrap;
  flex-shrink: 0;
}

/* ===================== HERO SECTION ===================== */

.hero {
  height: 100vh;
  /* background: url("https://images.unsplash.com/photo-1549924231-f129b911e442?ixlib=rb-4.0.3&auto=format&fit=crop&w=1950&q=80")
    no-repeat center center / cover; */
  overflow: hidden;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: flex-start;
  padding: 8vw;
  color: white;
  position: relative;
}

.hero::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(to bottom, rgba(0, 0, 0, 0.4), rgba(0, 0, 0, 0.7));
  z-index: 0;
}

.hero-video {
  position: absolute;
  top: 0;
  left: 0;
  min-width: 100%;
  min-height: 100%;
  object-fit: cover;
  z-index: 0;
}

.hero-content {
  position: relative;
  z-index: 2;
  /* z-index: 1; */
  /* max-width: 700px; */
}

.hero h1 {
  font-size: clamp(2.5rem, 6vw, 5rem);
  margin-bottom: 1rem;
}

.hero p {
  font-size: 1.2rem;
  margin-bottom: 2rem;
  opacity: 0.9;
}

.hero a {
  display: inline-block;
  background: var(--accent);
  color: #000;
  padding: 14px 28px;
  text-decoration: none;
  font-weight: bold;
  border-radius: 4px;
  transition: all 0.3s ease;
}

.hero a:hover {
  transform: translateY(-2px);
  box-shadow: 0 10px 30px rgba(0, 255, 231, 0.4);
}

/* ===================== HAMBURGER MENU ===================== */

.hamburger {
  display: none;
  font-size: 2rem;
  background: none;
  border: none;
  color: var(--fg);
  cursor: pointer;
  z-index: 110;
}

.hamburger.close-menu {
  position: absolute;
  top: 1rem;
  right: 1rem;
  z-index: 10001;
  font-size: 2rem;
}

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

@media (max-width: 768px) {
  nav {
    flex-direction: column;
    align-items: flex-start;
    padding: 1rem 4vw;
  }

  .theme-toggle {
    margin: 0;
    align-self: center;
    font-size: 1.5rem;
    padding: 1rem;
  }

  .hamburger {
    display: block;
  }

  .nav-links {
    position: fixed;
    top: -100vh;
    left: 0;
    width: 100vw;
    height: 100vh;
    background: var(--nav-bg-solid);
    -webkit-backdrop-filter: blur(10px);
    backdrop-filter: blur(10px);
    z-index: 9999;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    /* MODIFIED: Added 'background' to the transition for smooth theme changes */
    transition: top 0.3s ease, background 0.3s ease;
    padding: 0;
    margin: 0;
    overflow: hidden;
  }

  .nav-links.menu-open {
    top: 0;
  }

  .nav-links a,
  .nav-links .theme-toggle {
    margin: 1rem 0;
    font-size: 1.5rem;
  }

  .nav-links a.active {
    /* border-left: 3px solid var(--accent); */
    /* padding-left: 15px; */
    /* margin-left: -18px; */
  }
}

@media (max-width: 600px) {
  .symbol-dropdown {
    left: 50% !important;
    right: auto !important;
    transform: translateX(-50%) !important;
    min-width: 90vw;
    max-width: 95vw;
  }
}

@media (max-width: 480px) {
  nav {
    padding: 1rem 2vw;
  }

  .logo {
    font-size: 1rem;
  }

  .logo img {
    height: 24px;
  }

  .nav-links a {
    /* font-size: 1rem; */
  }

  .theme-toggle {
    font-size: 0.8rem;
    padding: 6px 10px;
  }
}
