

:root{
  /* Light Theme */ 
  --page-bg: #bbbbbb;
  --text-color: #feffde;
  --box-bg: #1b0e0e;
  --box-outline: #feffde;
  --box-divider: #feffde;
  --overtitle-bg: #111111;
  --overtitle-text: #ffffff;
  --control-bg: rgba(255,255,255,0.9);
  --control-text: #000000;
  --center-text: #ffffff;
  --btn-border: rgba(255,255,255,0.06);
  --btn-hover: rgba(255,255,255,0.04);
}

/* Custom Font */
@font-face {
  font-family: 'Interphases Pro Mono';
  src: local('Interphases Pro Mono'),
       local('InterphasesProMono'),
       url('fonts/InterphasesProMono.woff2') format('woff2'),
       url('fonts/InterphasesProMono.woff') format('woff');
  font-weight: 100 900;
  font-style: normal;
  font-display: swap;
}

/* Music Page Layout */
.music-list {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-top: 14px;
}

.music-card {
  display: flex;
  gap: 12px;
  cursor: pointer;
  transition: all 300ms ease;
}


.album {
  width: 100%;
  height: auto;
  border-radius: 4px;
  display: block;
  z-index: 10; /* ensure album is above the sliding panel */
  cursor: pointer;
}
.album-info {
  width: 120px;
  flex-shrink: 0; /* Prevent the album from shrinking */
}


.track-title {
  font-size: 12px;
  margin-top: 6px;
  color: var(--center-text);
}

/* Music Song Panel */
.song-panel {
  max-width: 0;
  overflow: hidden;
  max-height: 120px; /* Set your desired panel height */
  overflow-y: auto; /* Enable internal scrolling */
  background: rgba(40, 40, 40, 0.2);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px); /* For Safari */
  border: 1px solid var(--btn-border);
  border-radius: 6px;
  padding: 0 10px 10px 10px; /* Removed top padding */
  transition: max-width 300ms ease, padding 300ms ease;
  color: var(--center-text);
  box-sizing: border-box;
}

.music-card.active .song-panel {
  max-width: 200px;
}
.music-card:not(.active) .song-panel {
  padding: 10px 0;
}

.song-panel::-webkit-scrollbar {
  width: 6px;
}
.song-panel::-webkit-scrollbar-thumb {
  background: var(--btn-border);
  border-radius: 4px;
}
.song-panel::-webkit-scrollbar-thumb:hover {
  background: var(--btn-hover);
}
.song-panel::-webkit-scrollbar-track {
  background: transparent;
}



.song-panel ul {
  margin-left: 12px;
  padding: 0;
  list-style: disc;
}

.song-panel li {
  font-size: 9px;
  padding: 4px 0;
}

.song-panel li.liked {
  font-weight: bold;
  color: #72eaff;
}



.track {
  font-size: 12px;
  color: var(--center-text);
  line-height: 1.3;
  margin-top: 6px;
}

.track strong {
  font-weight: 500;
}

ul {
  padding-left: 20px;
}

h2 {
  font-size: 19px;
}
details {
  border: 1px solid var(--btn-border);
  padding: 8px 10px;
  margin: 10px 0;
  border-radius: 6px;
  cursor: pointer;
}

summary {
  font-size: 15px;
  font-weight: 600;
  margin-bottom: 6px;
  outline: none;
}

.mod-group h3 {
  margin: 10px 0 6px;
}

.mod {
  max-width: 100%;
  border-radius: 6px;
  margin-bottom: 10px;
  display: block;
  height: 100%;
  margin-bottom: 12px;
  width: 100%;
  object-fit: contain;
  border: #feffde 2px solid;
  border-radius: 9px;
}

/* Dark Theme */
body.dark {
  --page-bg: #1e1e1e;
  --text-color: #feffde;
  --box-bg: #1b0e0e;
  --box-outline: #feffde;
  --box-divider: #feffde;
  --overtitle-bg: #111111;
  --overtitle-text: #ffffff;
  --control-bg: rgba(0,0,0,0.6);
  --control-text: #ffffff;
  --center-text: #eaeaea; /* text inside the box for dark theme */
  --btn-border: rgba(255,255,255,0.08);
  --btn-hover: rgba(255,255,255,0.06);
}

/* Global Styles */
body {
  background-color: var(--page-bg);
  color: var(--text-color);
  font-family: 'Interphases Pro Mono', 'SFMono-Regular', 'Menlo', 'Roboto Mono', monospace;
  height: 100%;
  margin: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

button, input, select, textarea {
  font-family: inherit;
}

html, body {
  height: 100%;
  margin: 0;
}

/* Page Layout */
.page-wrap {
  transform: translateX(50px);
}

.overtitle {
  position: absolute;
  top: -12px;
  left: 12px;
  color: var(--overtitle-text);
  font-weight: 700; /* make overtitle bold */
  padding: 4px 8px;
  background: var(--overtitle-bg);
  outline: 2px solid var(--box-outline);
  border-radius: 4px;
  display: inline-flex;
  align-items: center;
  cursor: pointer; 
  text-decoration: none; /* remove link underline when overtitle is an anchor */
  z-index: 5;
}

.overtitle:focus-visible {
  outline: 3px solid var(--box-outline);
  outline-offset: 2px;
}

.logo {
  max-width: 100%;
  height: 200px;
  margin-bottom: 16px;
  display: block;
  padding-left: 10%;
}

.center-box {
  width: 720px; /* Increased width to accommodate expanded song list */
  height: 460px;
  background: var(--box-bg);
  box-shadow: 0 6px 18px rgba(0,0,0,0.25);
  border-radius: 8px;
  outline-color: var(--box-outline);
  outline-style: solid;
  outline-width: 2px;
  display: flex;
  position: relative;
}

.left-col {
  width: 200px; /* matches the dividing line at 200px */
  box-sizing: border-box;
  padding: 20px 12px 12px 12px; /* leave space at top for overtitle */
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  scrollbar-width: auto; /* Firefox: normal scrollbar */
  gap: 8px;
  position: relative; /* ensure pseudo-element and mask are positioned correctly */
  -webkit-mask-image: linear-gradient(180deg, rgba(0,0,0,0) 0px, rgba(0,0,0,1) 36px, rgba(0,0,0,1) calc(100% - 36px), rgba(0,0,0,0) 100%);
  mask-image: linear-gradient(180deg, rgba(0,0,0,0) 0px, rgba(0,0,0,1) 36px, rgba(0,0,0,1) calc(100% - 36px), rgba(0,0,0,0) 100%);
  -webkit-mask-size: 100% 100%;
  mask-size: 100% 100%;
  -ms-overflow-style: none; /* IE and Edge */
  scrollbar-width: none; /* Firefox */
}
.left-col::-webkit-scrollbar { /* WebKit */
  width: 0;
  height: 0;
}

/* Left Column Scroll Fade */
.center-box::after {
  content: '';
  position: absolute;
  left: 0; /* align with left edge of center-box */
  top: 0;
  width: 99%; /* match .left-col width so overlay covers that column */
  height: 100%;
  pointer-events: none;
  background: linear-gradient(to bottom, var(--box-bg) 0px, rgba(0,0,0,0) 36px, rgba(0,0,0,0) calc(100% - 46px), var(--box-bg) 100%);
  z-index: 2; /* sits above scroll content */
  border-radius: 8px 0 0 8px; /* round only the left corners so it matches the box */
}

/* Make text inside the center box white (but keep .overtitle color as defined) */
.center-box { color: var(--center-text); }
.left-col .page-btn,
.left-col .cat-title { color: var(--center-text); }

.right-col {
  width: 100px;          /* fixed width */
  flex: 0 0 520px;       /* do not grow or shrink */
  overflow-y: auto;      /* scroll when content exceeds height */
  overflow-x: auto;    /* prevent horizontal stretching */
  min-width: 0;          /* prevents flexbox overflow bugs */
  padding: 18px;
  box-sizing: border-box;
  scrollbar-width: auto; /* Firefox */
}

/* Right Column Scrollbar */
.right-col::-webkit-scrollbar {
  width: 10px;
}

.right-col::-webkit-scrollbar-thumb {
  background: var(--btn-border);
  border-radius: 6px;
}

.right-col::-webkit-scrollbar-thumb:hover {
  background: var(--btn-hover);
}

.right-col::-webkit-scrollbar-track {
  background: transparent;
}


/* Left Column Buttons */
.page-btn {
  display: block;
  text-align: center; /* center text to align with category headers */
  padding: 8px 10px;
  background: transparent;
  color: var(--center-text);
  border: 1px solid var(--btn-border);
  border-radius: 6px;
  cursor: pointer;
  box-sizing: border-box; /* include padding/border in width calculation */
  width: 100%;
  text-decoration: none; /* ensure page links do not show an underline */
}

.page-btn:hover {
  background: var(--btn-hover);
}

a {
  text-decoration: none;
  color: inherit;
}

a:hover {
  text-decoration: none;
}

/* Left Column Categories */
.category {
  margin-top: 6px;
}
.cat-title {
  text-align: center;
  font-size: 13px;
  font-weight: 700;
  margin-bottom: 6px;
}
.cat-divider {
  width: 100px;
  height: 2px;
  background: var(--box-divider);
  margin: 0 auto 10px auto; /* center the divider under the title */
  border-radius: 2px;
}

/* Center Box Divider */
.center-box::before {
  content: '';
  position: absolute;
  left: 200px; /* distance from left edge of box */
  top: 30px; /* gap from top */
  bottom: 30px; /* gap from bottom */
  width: 1px; /* line thickness */
  background: var(--box-divider);
  pointer-events: none;
}

/* Theme Toggle Button */
#theme-toggle {
  position: fixed;
  top: 12px;
  right: 12px;
  z-index: 9999;
  background: var(--control-bg);
  color: var(--control-text);
  border: 1px solid rgba(0,0,0,0.08);
  padding: 6px 10px;
  border-radius: 6px;
  cursor: pointer;
  font-size: 14px;
  display: inline-flex;
  align-items: center;
}

#theme-toggle:focus {
  outline: 2px solid rgba(0,0,0,0.16);
}

#theme-toggle .icon {
  width: 18px;
  height: 18px;
  display: inline-block;
  fill: currentColor;
}

#theme-toggle .sun { display: none; }
body.dark #theme-toggle .sun { display: inline-block; }
body.dark #theme-toggle .moon { display: none; }

/* Theme Transition */
body.theme-transitions-active,
body.theme-transitions-active .center-box,
body.theme-transitions-active .overtitle,
body.theme-transitions-active #theme-toggle,
body.theme-transitions-active .left-col,
body.theme-transitions-active .page-btn,
body.theme-transitions-active .cat-title,
body.theme-transitions-active .cat-divider,
body.theme-transitions-active .center-box::before,
body.theme-transitions-active .center-box::after {
  transition: background-color 360ms ease, color 360ms ease, border-color 360ms ease, box-shadow 360ms ease, outline-color 360ms ease, fill 360ms ease, opacity 360ms ease;
}

@media (prefers-reduced-motion: reduce) {
  body.theme-transitions-active,
  body.theme-transitions-active .center-box,
  body.theme-transitions-active .overtitle,
  body.theme-transitions-active #theme-toggle,
  body.theme-transitions-active .left-col,
  body.theme-transitions-active .page-btn,
  body.theme-transitions-active .cat-title,
  body.theme-transitions-active .cat-divider,
  body.theme-transitions-active .center-box::before,
  body.theme-transitions-active .center-box::after {
    transition: none !important;
  }
}

/* Accordion Animation */
details[open] > .mod-group {
  animation: dropdown-open 250ms ease-out;
}

@keyframes dropdown-open {
  0% {
    opacity: 0;
    transform: translateY(-6px);
  }
  100% {
    opacity: 1;
    transform: translateY(0);
  }
}

details > .mod-group {
  opacity: 0;
  transform: translateY(-6px);
  transition: opacity 260ms ease, transform 260ms ease;
}

details[open] > .mod-group {
  opacity: 1;
  transform: translateY(0);
}