/* Reset and Base Theme Styles */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

body {
  background-color: #0d0d0d;
  color: #ffffff;
  font-family: 'Inter', sans-serif; 
  min-height: 100vh;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  
  display: flex;
  justify-content: center;
  align-items: center;
}

/* ========================================== */
/* Desktop Grid Layout                        */
/* ========================================== */
.landing-container {
  display: grid;
  grid-template-columns: 1fr minmax(600px, 850px) 150px; /* Expands to hold the drum app comfortably */
  grid-template-rows: auto 120px;
  width: 100%;
  max-width: 1400px;
  height: 100vh;
  padding: 40px;
  gap: 20px;
}

/* Central Application Container */
.drum-machine-container {
  grid-column: 2;
  grid-row: 1;
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 30px;
  padding: 20px 0;
}

/* Top Control Customizations */
.controls-panel {
  display: flex;
  flex-wrap: wrap;
  gap: 20px;
  align-items: center;
  background-color: #141414;
  padding: 15px 20px;
  border-radius: 8px;
  border: 1px solid #222;
}

.btn-group {
  display: flex;
  gap: 8px;
}

.control-btn {
  background: #1e1e1e;
  border: 1px solid #333;
  color: #888;
  padding: 8px 16px;
  border-radius: 4px;
  cursor: pointer;
  text-transform: lowercase;
  font-weight: 300;
  transition: all 0.3s ease;
}

.control-btn:hover, .control-btn.active {
  color: #fff;
  border-color: #555;
  background: #252525;
}

#btn-clear:hover {
  border-color: #ff4a4a; /* Turns the border a subtle red on hover */
  color: #ff4a4a;
}

.input-group {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.input-group label {
  font-size: 0.75rem;
  color: #666;
  text-transform: lowercase;
}

.input-group input, .input-group select {
  background: #1e1e1e;
  border: 1px solid #333;
  color: #fff;
  padding: 6px 10px;
  border-radius: 4px;
  font-family: inherit;
  font-size: 0.9rem;
  font-weight: 300;
}

/* Responsive Sequencer Grid Framework */
.sequencer-scroll-wrapper {
  width: 100%;
  overflow-x: auto; /* Enables smooth scrolling if bars extend beyond screen width */
  background-color: #141414;
  border-radius: 8px;
  border: 1px solid #222;
  padding: 20px;
}

.sequencer-grid {
  display: grid;
  gap: 12px;
  min-width: 500px;
}

/* Row Settings */
.instrument-row {
  display: contents; /* Allows structural children items to inherit parent CSS grid rules directly */
}

.label-cell {
  color: #888;
  font-size: 0.9rem;
  font-weight: 300;
  text-transform: lowercase;
  display: flex;
  align-items: center;
  padding-right: 15px;
}

/* Sequencer Step Pad Buttons */
.step-pad {
  aspect-ratio: 1;
  background-color: #1a1a1a;
  border: 1px solid #2c2c2c;
  border-radius: 4px;
  cursor: pointer;
  transition: all 0.1s ease;
}

/* Color codes visual variations for rhythm tracking (e.g. shifts patterns every downbeat beat) */
.step-pad.downbeat {
  background-color: #222222;
}

.step-pad.active {
  background-color: #ffffff; /* Active user notes glow crisp clean white */
  border-color: #ffffff;
}

.step-pad.playing {
  transform: scale(1.08);
  box-shadow: 0 0 8px rgba(255, 255, 255, 0.4);
}

/* ========================================== */
/* Layout Overrides Remaining Fixed           */
/* ========================================== */
.links-area {
  grid-column: 3;
  grid-row: 1;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: flex-start;
  padding-left: 30px;
}

.nav-links {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 25px;
}

.nav-links a {
  color: #666;
  text-decoration: none;
  font-size: 1rem;
  font-weight: 300;
  text-transform: lowercase;
  transition: color 0.4s ease;
}

.nav-links a:hover {
  color: #ffffff;
}

.title-area {
  grid-column: 2;
  grid-row: 2;
  display: flex;
  justify-content: center;
  align-items: flex-end;
  padding-bottom: 20px;
}

.website-title {
  font-size: 3.5rem; 
  font-weight: 300;
  letter-spacing: 1px;
  text-transform: lowercase; 
}

/* Mobile Configurations */
@media (max-width: 900px) {
  body { display: block; }
  .landing-container {
    display: flex;
    flex-direction: column;
    height: auto;
    min-height: 100vh;
    padding: 20px;
    gap: 40px;
  }
  .drum-machine-container { order: 1; }
  .title-area { order: 2; align-items: center; }
  .website-title { font-size: 2.2rem; }
  .links-area { order: 3; align-items: center; padding-left: 0; }
  .nav-links { align-items: center; }
}


    //If I want to add real instrument sounds, use the following code:
    // let hatAudio = new Audio('sounds/kick.wav');
    // hatAudio.currentTime = 0; // Rewinds the sample instantly if it's already playing
    // hatAudio.play();
    // break;
