/* ==================================================
   style.css — reorganised by semantic sections
   Sections: Base | Layout | Navbar | Controls | Piano
             | Visualiser & Instructions | Recording
             | Footer | Responsive
   Goal: keep exact selectors and behaviour; improve readability
   ================================================== */

@import url("https://fonts.googleapis.com/css2?family=Orbitron:wght@400;700&display=swap");

/* ----------------------
   Base / Reset
   ---------------------- */
body {
  min-height: 100%;
  background-color: #0d0d0d;
  color: #f5f5f5;
  font-family: "Orbitron", sans-serif;
  text-align: center;
  display: flex;
  flex-direction: column;
  flex-grow: 1;
}

.section-spacing {
  margin-top: 10rem;
  margin-bottom: 10rem;
}

/* ----------------------
   Layout / Navbar
   ---------------------- */
.navbar {
  background: linear-gradient(90deg, #ff00ff, #00fff9);
  border-bottom: 2px solid #0ff;
  box-shadow: 0 0 20px #0ff;
}

.navbar-brand {
  color: #fff;
  font-weight: bold;
  text-shadow: 0 0 10px #ff00ff, 0 0 20px #ff00ff;
  margin-left: 1.5rem;
}

.nav-link {
  color: #ff00ff !important;
  text-shadow: 0 0 10px #ff00ff, 0 0 20px #ff00ff;
}

.nav-link:hover {
  color: #0d0d0d !important;
  text-shadow: 0 0 5px #00fff9;
  transition: all 0.2s ease-in-out;
}

/* ----------------------
   Controls (volume, toggles)
   ---------------------- */
/* Playback volume slider (navbar) */
#volume-slider {
  appearance: none;
  width: 50%;
  height: 15px;
  background: #000;
  outline: none;
  border: 1px solid #ff00ff;
  border-radius: 8px;
  cursor: pointer;
  box-shadow: inset 0 0 10px #00fff9, inset 0 0 20px #ff00ff;
}

#volume-slider::-webkit-slider-thumb {
  appearance: none;
  width: 5px;
  height: 20px;
  background: #00fff9;
  border: 1px solid #000;
  border-radius: 1px;
  cursor: pointer;
  box-shadow: inset 0 0 10px #00fff9, inset 0 0 20px #ff00ff;
}

/* ----------------------
   Piano (container, keys, canvas)
   ---------------------- */
#piano-container {
  margin-top: 2rem;
  padding: 20px;
  background: rgba(15, 15, 30, 0.95);
  border: 2px solid #ff00ff;
  border-radius: 10px;
  box-shadow: 0 0 25px #ff00ff, 0 0 50px #00fff9 inset;
  z-index: 1;
}

.key {
  position: relative;
  display: inline-block;
  margin: 3px;
  border-radius: 6px;
  overflow: hidden;
  cursor: pointer;
  user-select: none;
}

.key.white {
  width: 40px;
  height: 140px;
  background: #1a1a1a;
  border: 2px solid #0ff;
  box-shadow: 0 0 10px #0ff;
}

.key.black {
  width: 30px;
  height: 90px;
  margin-left: -15px;
  margin-right: -15px;
  background: #111;
  border: 2px solid #ff00ff;
  box-shadow: 0 0 10px #ff00ff;
  z-index: 2;
}

.key:hover {
  box-shadow: 0 0 15px #8000ff, 0 0 30px #8000ff inset;
}

.key button {
  width: 100%;
  height: 100%;
  background: transparent;
  border: none;
  color: #fff;
  font-size: 0.8rem;
  font-weight: bold;
  text-shadow: 0 0 5px #00fff9, 0 0 10px #ff00ff;
  cursor: pointer;
}

.key.active,
.key button:active {
  transform: scale(0.96);
  box-shadow: 0 0 25px #ff00ff, 0 0 50px #00fff9;
  transition: 0.1s ease;
}

/* Consolidated piano canvas rules (merged duplicates) */
#piano {
  /* keep consistent sizing and stacking */
  display: block;
  max-width: 100%;
  height: auto;
  border-radius: 8px;
  z-index: 1;

  /* Visual appearance: prefer neutral background with subtle neon glow */
  border: 2px solid #333;
  background-color: #f5f5f5;
  box-shadow: 0 0 20px #ff00ff, 0 0 40px #00fff9;
}

#pick-visuals {
  z-index: 1;
}

/* Fullscreen visualiser canvas (positioned behind UI) */
#visualiser-canvas {
  width: 100%;
  height: 100%;
  background-color: #000000;
  border-radius: 0;
  position: fixed;
  left: 0;
  z-index: 0;
}

/* ----------------------
   Visualiser & Instructions
   ---------------------- */
#visualiser,
#instructions {
  max-height: 600px;
  background: rgba(25, 25, 60, 0.85);
  border: 1px solid #0ff;
  padding: 20px;
  border-radius: 8px;
  box-shadow: 0 0 15px #0ff, 0 0 30px #ff00ff inset;
  z-index: 1;
  position: relative;
}

#visualiser button,
#instructions button {
  background: transparent;
  border: none;
  color: #0ff;
  text-shadow: 0 0 8px #ff00ff, 0 0 15px #0ff;
}

#instructions ul {
  list-style: none;
  padding-left: 0;
}

#instructions ul li {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5em;
  margin-bottom: 0.7em;
  font-weight: bold;
  width: 100%;
  text-align: center;
  position: relative;
}

#instructions ul li::before {
  font-family: "Font Awesome 6 Free";
  content: "\f51f";
  font-weight: 900;
  color: #0ff;
  text-shadow: 0 0 8px #ff00ff, 0 0 15px #0ff;
  font-size: 1.2em;
  display: inline-block;
}

#instructions h2,
#instructions h3 {
  color: #0ff;
  text-shadow: 0 0 8px #ff00ff, 0 0 15px #0ff;
}

/* Collapse behaviour: shrink panel to its header width */
#instructions.collapsed {
  width: fit-content;
  max-width: none;
  padding: 8px 12px;
  margin-left: auto;
  margin-right: auto;
}

#instructions.collapsed #instructions-box {
  display: none !important;
}

#instructions .toggle-text {
  display: inline-block;
  background: transparent;
  border: none;
  padding: 0;
}

#instructions .toggle-text h2 {
  display: inline-block;
  margin: 0;
  white-space: nowrap;
}

/* Mirror collapse for visualiser */
#visualiser.collapsed {
  width: fit-content;
  max-width: none;
  padding: 8px 12px;
  margin-left: auto;
  margin-right: auto;
}

#visualiser.collapsed #visualiser-box {
  display: none !important;
}

/* ----------------------
   Modal / Backdrop tweaks
   ---------------------- */
.modal-backdrop {
  background-color: transparent !important;
  backdrop-filter: none !important;
  pointer-events: none !important;
}

/* ----------------------
   Recording Controls
   ---------------------- */
#recording-controls {
  max-width: 900px;
  margin: 3rem auto;
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 16px;
  position: relative;
  z-index: 1000;
  align-items: center;
}

.heading-3 {
  color: #0ff;
  text-shadow: 0 0 8px #ff00ff, 0 0 15px #0ff;
  padding-bottom: 1rem;
}

.btn-custom {
  width: 50%;
  justify-content: center;
  border-radius: 12px;
  font-weight: bold;
  border: 2px solid;
  padding: 8px 20px;
  cursor: pointer;
  transition: box-shadow 0.2s, color 0.2s, background-color 0.2s;
  user-select: none;
  z-index: 11;
  background-color: #181c2f;
}

.btn-custom.r-start,
.btn-custom.r-stop,
.btn-custom.r-play {
  background: radial-gradient(
    circle,
    rgba(0, 255, 255, 0.3) 0%,
    rgba(0, 255, 255, 0.1) 50%,
    rgba(0, 255, 255, 0) 100%
  );
  border-color: #00fff9;
  color: #4d4f5b !important;
}

.btn-custom.active {
  border-color: #ff00ff;
  box-shadow: 0 0 16px #ff00ff, 0 0 32px #ff00ff80;
  background: radial-gradient(
    circle,
    transparent 0%,
    #ff00ff80 70%,
    #ff00ff 100%
  );
  transition: background-color 0.3s ease, box-shadow 0.3s ease;
  color: white !important;
  text-shadow: 0 0 10px #ff00ff, 0 0 20px #ff00ff;
}

.btn-custom.active:hover {
  transform: scale(1.1);
}

/* ----------------------
   Footer
   ---------------------- */
footer {
  background: linear-gradient(90deg, #ff00ff, #00fff9);
  border-top: 2px solid #0ff;
  box-shadow: 0 0 20px #0ff;
  position: fixed;
  bottom: 0;
  left: 0;
  width: 100%;
}

footer .container-fluid {
  position: relative;
}

footer .row {
  position: relative;
}

#tagline {
  color: #fff !important;
  font-weight: bold;
  text-shadow: 0 0 10px #ff00ff, 0 0 20px #ff00ff;
  text-align: center !important;
  display: block;
  width: 100%;
  position: absolute;
  left: 50%;
  top: 50%;
  transform: translate(-50%, -50%);
}

footer .text-muted {
  color: #fff !important;
  text-shadow: 0 0 10px #ff00ff, 0 0 20px #ff00ff;
}

#tagline i {
  margin-right: 0.5rem;
}

#tagline i:last-child {
  margin-left: 0.5rem;
  margin-right: 0;
}

/* ----------------------
   Responsive tweaks
   ---------------------- */
@media (max-width: 600px) {
  #recording-controls {
    flex-direction: column;
    align-items: center;
    width: 100%;
  }
}

@media screen and (max-width: 768px) {
  footer .row {
    flex-direction: column !important;
    align-items: center !important;
    text-align: center;
  }

  footer .mobile-view {
    width: 100% !important;
    display: block !important;
    text-align: center !important;
    margin: 0 !important;
    padding: 0;
    font-size: 0.6rem;
  }

  #tagline {
    position: static;
    transform: none;
    margin-bottom: 8px;
  }
}

@media screen and (max-width: 992px) {
  .navbar .nav-link {
    color: #fff !important;
    text-shadow: 0 0 10px #ff00ff, 0 0 20px #ff00ff;
  }
  .nav-link:hover {
    color: #0d0d0d !important;
    text-shadow: 0 0 5px #00fff9;
    transition: all 0.2s ease-in-out;
  }
}
