/* ------------------------------- */
/*       RESET & TYPOGRAPHY       */
/* ------------------------------- */
:root {
  /* Borrowed from the on blank space palette: warm paper + ink, sage accent. */
  --bg-color: #f7f5f0;       /* paper */
  --text-color: #2b2a27;     /* ink */
  --border-color: #2b2a27;   /* ink, for structural borders */
  --line-color: #e3dfd5;     /* soft separators */
  --accent: #7c8b73;         /* sage */
  --accent-deep: #5f6e57;
  --hover-bg: #7c8b73;       /* sage selection instead of stark black */
  --hover-text: #f7f5f0;
  --font-stack: "IBM Plex Mono", ui-monospace, "Courier New", monospace;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  padding: 0;
  background-color: var(--bg-color);
  color: var(--text-color);
  font-family: var(--font-stack);
  height: 100vh;
  overflow: hidden; /* App-like feel */
}

button {
  background: none;
  border: none;
  font-family: inherit;
  font-size: inherit;
  color: inherit;
  cursor: pointer;
  padding: 0;
  text-transform: uppercase;
}

ul {
  list-style: none;
  padding: 0;
  margin: 0;
}

/* ------------------------------- */
/*          LAYOUT GRID           */
/* ------------------------------- */
.layout-grid {
  display: grid;
  grid-template-columns: 350px 1fr; /* Fixed sidebar, fluid content */
  height: calc(100vh - 60px); /* Leave room for footer */
  width: 100vw;
}

.panel {
  overflow-y: auto;
  padding: 24px;
}

/* ------------------------------- */
/*        LEFT: LIBRARY           */
/* ------------------------------- */
.library-panel {
  border-right: 1px solid var(--border-color);
  display: flex;
  flex-direction: column;
}

.library-header {
  margin-bottom: 32px;
  border-bottom: 2px solid var(--border-color); /* Thicker border for title */
  padding-bottom: 16px;
}

.lab-link {
  display: inline-block;
  margin-bottom: 16px;
  font-size: 0.7rem;
  letter-spacing: 1px;
  text-decoration: none;
  color: var(--accent-deep);
  opacity: 0.85;
  transition: opacity 0.2s;
}

.lab-link:hover {
  opacity: 1;
  text-decoration: underline;
}

.library-header h1 {
  font-size: 1.2rem;
  margin: 0;
  letter-spacing: -1px;
}

.subtitle {
  font-size: 0.8rem;
  opacity: 0.6;
}

/* Album List Items */
#album-list li {
  padding: 12px 0;
  border-bottom: 1px solid var(--line-color);
  cursor: pointer;
  transition: all 0.2s cubic-bezier(0.25, 0.46, 0.45, 0.94);
  font-size: 14px;
  display: flex;
  justify-content: space-between;
}

#album-list li:hover,
#album-list li.active {
  background-color: var(--hover-bg);
  color: var(--hover-text);
  padding-left: 8px; /* Slight nudge */
  border-bottom-color: var(--hover-bg);
}

/* ------------------------------- */
/*        RIGHT: DETAIL           */
/* ------------------------------- */
.detail-panel {
  position: relative;
}

.empty-state {
  display: flex;
  height: 100%;
  align-items: center;
  justify-content: center;
  opacity: 0.4;
  font-size: 0.9rem;
  letter-spacing: 1px;
}

/* Detail Content Structure */
.album-header-large {
  display: flex;
  gap: 24px;
  margin-bottom: 40px;
  align-items: flex-start;
}

.album-cover-stamp {
  width: 140px;
  height: 140px;
  object-fit: cover;
  border: 1px solid var(--border-color);
  /* Optional: filter: grayscale(100%); */
}

.album-info-text h2 {
  margin: 0 0 8px 0;
  font-size: 1.5rem;
  font-weight: normal;
  text-transform: uppercase;
}

.album-info-text p {
  margin: 0;
  font-size: 0.9rem;
  opacity: 0.7;
}

.tracklist {
  display: flex;
  flex-direction: column;
  gap: 0; /* Tight list */
}

.track-item {
  padding: 12px 0;
  border-bottom: 1px solid var(--line-color);
  cursor: pointer;
  display: flex;
  gap: 16px;
  transition: opacity 0.2s;
  font-weight: normal; /* V4 Change: Ensure consistent weight */
}

.track-name {
    font-weight: normal;
}

.track-item:hover {
  opacity: 0.6;
}

.track-number {
  opacity: 0.4;
  width: 24px;
}

/* ------------------------------- */
/*       BOTTOM: PLAYER BAR       */
/* ------------------------------- */
#player-bar {
  position: fixed;
  bottom: 0;
  left: 0;
  width: 100%;
  height: 60px;
  background: var(--bg-color);
  border-top: 1px solid var(--border-color);
  z-index: 100;
  display: flex;
  flex-direction: column;
}

.progress-container {
  width: 100%;
  height: 4px; /* Thin clickable area */
  background: var(--line-color);
  cursor: pointer;
  position: relative;
}

.progress-bar {
  height: 100%;
  background: var(--accent); /* sage accent */
  width: 0%;
  transition: width 0.1s linear;
}

.controls-wrapper {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 24px;
  font-size: 13px;
}

.track-info {
  font-weight: normal; /* V4 Change: Not bold */
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 40%;
}

.buttons {
  display: flex;
  gap: 24px;
}

.control-btn:hover {
  text-decoration: underline;
}

/* ------------------------------- */
/*        MOBILE RESPONSIVE       */
/* ------------------------------- */
.mobile-only { display: none; }

@media (max-width: 768px) {
  .layout-grid {
    display: block; /* Stack instead of grid */
    position: relative;
    /* Split screen vertically: Content takes top, Footer takes bottom */
    height: calc(100dvh - 80px); 
    width: 100vw;
    overflow: hidden;
  }

  .panel {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%; /* Becomes relative to the calc'd parent height */
    background: var(--bg-color);
    transition: transform 0.3s ease-in-out;
    padding-bottom: 24px; /* Standard padding since we don't overlap anymore */
    overflow-y: auto; 
    -webkit-overflow-scrolling: touch;
  }
  
  .library-panel {
    z-index: 1;
    /* Remove flux quirks */
    display: block; 
  }
  
  .detail-panel {
    z-index: 2;
    transform: translateX(100%); 
  }

  .detail-panel.open {
    transform: translateX(0);
  }

  .mobile-only { 
    display: block; 
    margin-bottom: 20px;
    font-weight: bold;
    font-size: 1rem;
    padding: 10px 0;
    cursor: pointer;
  }
  
  /* --- Mobile Footer (Minimal / Consistent) --- */
  #player-bar {
    height: 80px; /* Fixed height for calculations */
    /* Ensure it sits below the content area visually */
    border-top: 1px solid var(--border-color);
    background: var(--bg-color);
    /* Reset layout */
    justify-content: center;
    padding-bottom: 0;
  }
  
  .controls-wrapper {
    flex-direction: row; /* Keep horizontal like desktop */
    justify-content: space-between;
    gap: 12px;
    padding: 0 20px;
    height: 100%;
  }
  
  .track-info {
    max-width: 35%; /* Restrict width to prevent crowding */
    text-align: left;
    font-size: 0.8rem;
    margin: 0;
  }

  .buttons {
    width: auto;
    display: flex;
    gap: 16px;
  }

  /* Reset Button Styles to Minimal */
  .control-btn {
    border: none;
    padding: 0;
    text-align: center;
    font-weight: normal;
    background: transparent;
    font-size: 0.9rem;
  }
  
  .control-btn:active {
    background: transparent;
    color: inherit;
    opacity: 0.5;
  }

  /* Override specific overrides */
  #playPauseButton {
    background: transparent;
    color: inherit;
    font-size: 0.9rem;
  }
  
}


