@import url('https://fonts.googleapis.com/css2?family=Segoe+UI:ital,wght@0,400;0,600;1,400&display=swap');

/* ============================================================
   Reset & Base
   ============================================================ */
*,
*::before,
*::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  font-size: 14px;
}

body {
  font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
  background: none;
  color: #333;
  line-height: 1.4;
  height: 100vh;
  overflow: hidden;
  display: flex;
  flex-direction: column;
}

.hidden {
  display: none !important;
}

/* ============================================================
   Layout
   ============================================================ */
.retro-layout {
  display: flex;
  flex-direction: column;
  height: 100vh;
  width: 100vw;
  position: relative;
  z-index: 0;
}

/* Stable zoomed background — scale() zoom doesn't depend on viewport size */
.retro-layout::before {
  content: '';
  position: fixed;
  inset: -10%;
  /* bleed slightly past edges so scaled image never shows gaps */
  background: url('../images/appbg.png') no-repeat center center;
  background-size: cover;
  transform: scale(1.25);
  z-index: -1;
}

.retro-main-content {
  display: flex;
  flex: 1;
  overflow: hidden;
  background: transparent;
}

.retro-sidebar {
  width: 250px;
  background: url('../images/green-bg2.png') no-repeat center center;
  background-size: cover;
  color: white;
  padding: 20px;
  display: flex;
  flex-direction: column;
  box-shadow: inset -2px 0 5px rgba(0, 0, 0, 0.1);
}

.retro-middle-col {
  flex: 1;
  padding: 30px;
  overflow-y: auto;
  background: transparent;
  border-right: 2px solid #fff;
  box-shadow: inset -1px 0 0 #ccc;
}

.retro-panel {
  animation: load 0.25s forwards;
}

#sidebar_logo {
  width: 5rem;
  filter: invert(1);
}

@keyframes load {
  from {
    opacity: 0;
    transform: translateY(25px);
  }

  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.retro-right-col {
  width: 450px;
  background: transparent;
  padding: 30px;
  display: flex;
  flex-direction: column;
  box-shadow: -2px 0 5px rgba(0, 0, 0, 0.05);
}

/* ============================================================
   Top Bar
   ============================================================ */
.retro-top-bar {
  background: url('../images/top-bar-bg.png') repeat-x left top;
  border-bottom: 1px solid #aab7cd;
  padding: 12px 20px;
  display: flex;
  align-items: center;
}

.top-bar-logo {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 18px;
  color: #1a1a1a;
}

.top-bar-logo span {
  font-family: 'DM Sans', sans-serif;
  font-weight: 900;
}

.hz-labs-logo {
  width: 24px;
  height: 24px;
  filter: grayscale(100%);
  margin-bottom: -0.33rem;
}

.retro-sub-bar {
  background: url('../images/top-bar-optionsbar.png') repeat-x left top;
  background-size: 100% 100%;
  border-bottom: 1px solid #b5c2d6;
  padding: 8px 20px;
  display: flex;
  gap: 20px;
  font-size: 12px;
}

.retro-sub-bar a {
  color: #333;
  text-decoration: none;
}

.retro-sub-bar a:hover {
  text-decoration: underline;
}

.retro-sub-bar a.active {
  font-weight: bold;
}

.retro-sub-bar-select {
  font-family: inherit;
  font-size: 12px;
  color: #333;
  background: transparent;
  border: none;
  cursor: pointer;
  padding: 0;
  margin: 0;
  outline: none;
  -webkit-appearance: none;
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='8' height='5' viewBox='0 0 8 5'%3E%3Cpath d='M0 0l4 5 4-5z' fill='%23555'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 4px center;
  padding-right: 16px;
}

.retro-sub-bar-select:hover {
  text-decoration: underline;
}

.retro-toolbar-actions {
  margin-left: auto;
  display: flex;
  gap: 8px;
  align-items: center;
}

.btn-toolbar-retro {
  width: 16px;
  height: 16px;
  border: none;
  background-color: transparent;
  background-size: contain;
  background-repeat: no-repeat;
  background-position: center;
  cursor: pointer;
  opacity: 0.8;
  transition: opacity 0.1s;
}

.btn-toolbar-retro:hover {
  opacity: 1;
}

.btn-toolbar-retro:active {
  transform: translateY(1px);
}

#btn-toolbar-refresh {
  background-image: url('../images/refresh.svg');
  scale: 1.5;
}

#btn-toolbar-stop {
  background-image: url('../images/stop-button.svg');
  margin-right: 0.5rem;
}

@keyframes spin {
  from {
    transform: rotate(0deg);
  }

  to {
    transform: rotate(-360deg);
  }
}

/* ============================================================
   Sidebar
   ============================================================ */
.sidebar-title {
  font-size: 24px;
  font-weight: normal;
  margin-bottom: 30px;
  color: white;
}

.sidebar-nav {
  list-style: none;
  flex: 1;
}

.sidebar-nav li {
  margin-bottom: 10px;
}

.sidebar-nav a {
  color: white;
  text-decoration: none;
  font-size: 16px;
  display: flex;
  align-items: center;
  padding-left: 12px;
  /* Space for the bullet */
  position: relative;
}

.sidebar-nav a.active {
  font-weight: bold;
}

.sidebar-nav a.active::before {
  content: '•';
  position: absolute;
  left: 0;
  font-size: 16px;
}

.sidebar-back {
  color: white;
  text-decoration: none;
  font-size: 14px;
  opacity: 0.8;
}

.sidebar-back:hover {
  text-decoration: underline;
  opacity: 1;
}

.sidebar-beta-box {
  margin-top: auto;
  margin-bottom: 20px;
  font-size: 11px;
  opacity: 0.6;
  line-height: 1.4;
  border-left: 2px solid rgba(255, 255, 255, 0.3);
  padding-left: 10px;
  font-style: italic;
}

/* ============================================================
   Middle Column - Forms
   ============================================================ */
.section-title {
  font-size: 18px;
  font-weight: normal;
  color: #333;
  margin-bottom: 15px;
  padding-bottom: 5px;
}

.form-group {
  margin-bottom: 15px;
  position: relative;
}

.form-row {
  display: flex;
  gap: 15px;
  margin-bottom: 15px;
}

.row-full {
  width: 100%;
}

.flex-1 {
  flex: 1;
}

.flex-2 {
  flex: 2;
}

.retro-input {
  width: 100%;
  padding: 6px 8px;
  font-family: inherit;
  font-size: 14px;
  border-top: 1px solid #888;
  border-left: 1px solid #888;
  border-bottom: 1px solid #e0e0e0;
  border-right: 1px solid #e0e0e0;
  background-color: white;
  box-shadow: inset 1px 1px 2px rgba(0, 0, 0, 0.05);
  color: #333;
}

.retro-input:focus {
  outline: 1px dotted #333;
}

.retro-input::placeholder {
  color: #999;
  font-style: italic;
}

.sc-beta-warning {
  background: #fff8e1;
  border: 1px solid #ffe082;
  color: #856404;
  padding: 8px 12px;
  font-size: 13px;
  margin-bottom: 15px;
  border-radius: 4px;
  display: flex;
  align-items: center;
  gap: 10px;
}

.sc-beta-warning span {
  font-size: 16px;
}

/* Checkboxes */
.checkbox-grid {
  display: grid;
  grid-template-rows: repeat(4, auto);
  grid-auto-flow: column;
  gap: 8px 20px;
  margin-bottom: 25px;
}

.retro-checkbox {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
  cursor: pointer;
  user-select: none;
}

.retro-checkbox input[type="checkbox"] {
  margin: 0;
  width: 16px;
  height: 16px;
  cursor: pointer;
  -webkit-appearance: none;
  appearance: none;
  background: url('../images/checkbox off.svg') no-repeat center center;
  background-size: contain;
  border: none;
  outline: none;
}

.retro-checkbox input[type="checkbox"]:checked {
  background: url('../images/checkbox on.svg') no-repeat center center;
  background-size: contain;
}

/* Autocomplete */
.retro-autocomplete-list {
  position: absolute;
  top: 100%;
  left: 0;
  right: 0;
  background: white;
  border: 1px solid #999;
  box-shadow: 2px 2px 5px rgba(0, 0, 0, 0.2);
  z-index: 100;
  max-height: 200px;
  overflow-y: auto;
  list-style: none;
}

.retro-autocomplete-list li {
  padding: 4px 8px;
  cursor: pointer;
  font-size: 13px;
}

.retro-autocomplete-list li:hover {
  background-color: #3399ff;
  color: white;
}

.retro-autocomplete-list li.empty {
  color: #999;
  font-style: italic;
  cursor: default;
}

/* ============================================================
   Right Column
   ============================================================ */
.action-group {
  display: flex;
  gap: 15px;
  margin-bottom: 30px;
}

.btn-retro {
  flex: 1;
  padding: 10px 20px;
  font-size: 15px;
  font-weight: 600;
  font-family: 'Segoe UI', Tahoma, sans-serif;
  color: #333;
  cursor: pointer;
  text-align: center;
  background: linear-gradient(180deg, #ffffff 0%, #f2f2f2 48%, #e6e6e6 52%, #eeeeee 100%);
  border: 1px solid #828282;
  border-radius: 4px;
  box-shadow:
    inset 0 1px 0 0 #fff,
    inset 0 -1px 1px 0 rgba(0, 0, 0, 0.05),
    0 1px 2px rgba(0, 0, 0, 0.1);
  transition: all 0.1s ease;
}

.btn-retro:hover {
  background: linear-gradient(180deg, #ffffff 0%, #f7f7f7 48%, #ededed 52%, #f5f5f5 100%);
  border-color: #666;
  box-shadow:
    inset 0 1px 0 0 #fff,
    0 1px 3px rgba(0, 0, 0, 0.15);
}

.btn-retro:active,
.btn-retro:focus {
  outline: none;
  background: linear-gradient(180deg, #ffffff 0%, #f1f1f1 49%, #d5e6f2 50%, #c4daeb 100%) !important;
  border-color: #3c7fb1 !important;
  box-shadow: inset 0 0 12px #3fd5fb !important;
}


/* Terminal */
.output-title {
  margin-bottom: 10px;
}

.retro-terminal {
  flex: 1;
  background: transparent;
  color: #555;
  font-family: inherit;
  font-size: 14px;
  font-style: italic;
  overflow-y: auto;
  margin-bottom: 20px;
}

.log-entry {
  margin-bottom: 4px;
}

.log-prefix {
  margin-right: 8px;
}

/* ============================================================
   Player Controls
   ============================================================ */
.retro-player-container {
  margin-top: auto;
}

.player-progress-bar {
  height: 4px;
  background: #ccc;
  border: 1px solid #b3b3b3;
  margin-bottom: 15px;
  position: relative;
  border-radius: 2px;
}

.player-progress-fill {
  height: 100%;
  background: #3366cc;
  width: 0%;
}

.player-progress-thumb {
  position: absolute;
  top: 50%;
  transform: translateY(-50%) translateX(-50%);
  width: 10px;
  height: 16px;
  background: #eee;
  border: 1px solid #999;
  border-radius: 2px;
  box-shadow: 1px 1px 2px rgba(0, 0, 0, 0.2);
  /* The thumb position is tied to the fill width in JS if we wanted to visually update it. We can just hide it or leave it static for now as a decoration if JS only updates the fill width. */
  display: none;
  /* simple progress bar for now */
}

.player-controls {
  display: flex;
  align-items: center;
  gap: 15px;
}

.btn-play-retro,
.btn-stop-retro {
  cursor: pointer;
  position: relative;
  border: none;
  background-color: transparent;
}

.btn-play-retro {
  width: 40px;
  height: 40px;
  background: url('../images/playbutton.svg') no-repeat center center;
  background-size: contain;
}

.btn-play-retro.playing {
  background: url('../images/pausebutton.svg') no-repeat center center;
  background-size: contain;
}

.btn-play-retro:disabled,
.btn-stop-retro:disabled {
  filter: grayscale(100%);
  opacity: 0.5;
  cursor: default;
}

.btn-stop-retro {
  width: 12px;
  height: 12px;
  background: url('../images/stop-button.svg') no-repeat center center;
  background-size: contain;
}

.player-time {
  color: #333;
  font-family: 'Segoe UI', Tahoma, sans-serif;
  font-size: 14px;
  margin: 0 10px;
  display: flex;
  align-items: center;
  min-width: 40px;
}

#mobile_title {
  display: none;
}

.volume-label {
  font-size: 12px;
  color: #333;
  margin-left: auto;
}

.volume-slider-retro {
  width: 100px;
  -webkit-appearance: none;
  background: transparent;
}

.volume-slider-retro::-webkit-slider-runnable-track {
  width: 100%;
  height: 4px;
  background: #ccc;
  border: 1px solid #b3b3b3;
  border-radius: 2px;
}

.volume-slider-retro::-webkit-slider-thumb {
  -webkit-appearance: none;
  height: 16px;
  width: 8px;
  background: #eee;
  border: 1px solid #999;
  border-radius: 2px;
  margin-top: -7px;
  box-shadow: 1px 1px 2px rgba(0, 0, 0, 0.2);
  cursor: pointer;
}

/* ============================================================
   Aero Style Settings Modal
   ============================================================ */
.retro-modal-overlay {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.4);
  z-index: 1000;
  backdrop-filter: blur(2px);
}

.aero-window {
  width: 450px;
  background: rgba(255, 255, 255, 0.8);
  border: 1px solid rgba(255, 255, 255, 0.4);
  border-radius: 8px;
  box-shadow:
    0 0 0 1px rgba(0, 0, 0, 0.2),
    0 15px 30px rgba(0, 0, 0, 0.3),
    inset 0 0 0 1px rgba(255, 255, 255, 0.5);
  overflow: hidden;
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  font-family: 'Segoe UI', sans-serif;
  padding: 0 5px 5px 5px;
  /* Removed top padding so titlebar touches edge */
  background: linear-gradient(135deg, rgba(215, 235, 255, 0.6) 0%, rgba(185, 215, 245, 0.4) 50%, rgba(215, 235, 255, 0.6) 100%);
}

.aero-titlebar {
  height: 32px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0;
  padding-left: 8px;
  cursor: default;
  user-select: none;
}

.aero-title {
  color: #000;
  font-size: 13px;
  font-weight: 500;
  text-shadow: 0 0 10px rgba(255, 255, 255, 0.8), 0 0 5px rgba(255, 255, 255, 1);
  margin-top: -2px;
}

.aero-controls {
  display: flex;
  height: 100%;
}

.aero-close-btn {
  width: 45px;
  height: 22px;
  background: linear-gradient(180deg, #e78e7e 0%, #d65239 50%, #b82b12 50%, #e37e6b 100%);
  border: 1px solid #7a1c0d;
  border-top: none;
  border-right: none;
  border-radius: 0 0 3px 3px;
  position: relative;
  cursor: pointer;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.3);
  transition: filter 0.1s;
  align-self: flex-start;
  margin-right: 2px;
}

.aero-close-btn::before,
.aero-close-btn::after {
  content: '';
  position: absolute;
  top: 50%;
  left: 50%;
  width: 10px;
  height: 2px;
  background-color: white;
  transform: translate(-50%, -50%) rotate(45deg);
}

.aero-close-btn::after {
  transform: translate(-50%, -50%) rotate(-45deg);
}

.aero-close-btn:hover {
  filter: brightness(1.2);
}

.aero-close-btn:active {
  filter: brightness(0.8);
}

.aero-content {
  background: white;
  border: 1px solid #a0a0a0;
  border-radius: 0;
  /* Content area is usually sharp inside the glass */
  display: flex;
  flex-direction: column;
}

.aero-body {
  padding: 25px 35px;
}

.aero-instruction {
  font-size: 18px;
  color: #003399;
  margin-bottom: 25px;
}

.aero-radio-group {
  display: flex;
  flex-direction: column;
  gap: 15px;
}

.aero-radio {
  display: flex;
  align-items: center;
  cursor: pointer;
  gap: 8px;
  font-size: 14px;
}

.aero-radio input {
  margin: 0;
}

.aero-footer {
  padding: 15px 12px;
  background: #f0f0f0;
  border-top: 1px solid #d9d9d9;
  display: flex;
  justify-content: flex-end;
}

.aero-btn {
  min-width: 85px;
  padding: 4px 10px;
  font-family: 'Segoe UI', sans-serif;
  font-size: 12px;
  background: linear-gradient(180deg, #f2f2f2 0%, #ebebeb 50%, #dddddd 50%, #cfcfcf 100%);
  border: 1px solid #707070;
  border-radius: 3px;
  cursor: pointer;
  box-shadow: inset 0 1px 0 #fff;
}

.aero-btn:hover {
  background: linear-gradient(180deg, #e9f5fc 0%, #d8effa 50%, #bee6f7 50%, #abe0f5 100%);
  border-color: #3c7fb1;
  box-shadow: 0 0 5px rgba(60, 127, 177, 0.4), inset 0 1px 0 #fff;
}

.aero-btn:active {
  background: linear-gradient(180deg, #daeef9 0%, #c1e5f7 50%, #a2d7f3 50%, #92cff1 100%);
  border-color: #2c628b;
  box-shadow: inset 0 1px 3px rgba(0, 0, 0, 0.2);
}

/* ============================================================
   Mobile Responsive (≤768px)
   ============================================================ */
@media (max-width: 768px) {

  /* Allow full page scroll on mobile */
  body {
    overflow: auto;
    height: auto;
    min-height: 100vh;
    background-attachment: scroll;
    /* fixed bg breaks on iOS */
  }

  .retro-layout {
    height: auto;
    min-height: 100vh;
  }

  .retro-main-content {
    flex-direction: column;
    overflow: visible;
    height: auto;
  }

  /* ---- Sidebar → horizontal tab bar ---- */
  .retro-sidebar {
    width: 100%;
    height: auto;
    flex-direction: row;
    align-items: center;
    padding: 8px 12px;
    gap: 6px;
    background-size: cover;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
  }

  .sidebar-title,
  .sidebar-back {
    display: none;
  }

  #mobile_title {
    display: flex;
  }

  .sidebar-nav {
    display: flex;
    flex-direction: row;
    flex: 1;
    gap: 6px;
  }

  .sidebar-nav li {
    margin-bottom: 0;
    flex: 1;
  }

  .sidebar-nav a {
    font-size: 13px;
    padding: 6px 8px;
    padding-left: 8px;
    /* override desktop bullet indent */
    justify-content: center;
    text-align: center;
    background: rgba(255, 255, 255, 0.18);
    border-radius: 3px;
    border: 1px solid rgba(255, 255, 255, 0.25);
  }

  .sidebar-nav a.active {
    background: rgba(255, 255, 255, 0.45);
    font-weight: bold;
  }

  /* Remove desktop bullet on active tab */
  .sidebar-nav a.active::before {
    display: none;
  }

  /* ---- Middle column ---- */
  .retro-middle-col {
    flex: none;
    width: 100%;
    padding: 14px;
    border-right: none;
    box-shadow: none;
    overflow-y: visible;
  }

  /* Stack form rows vertically */
  .form-row {
    flex-direction: column;
    gap: 8px;
  }

  .flex-1,
  .flex-2 {
    flex: none;
    width: 100%;
  }

  /* Two-column checkbox grid on mobile */
  .checkbox-grid {
    grid-template-rows: unset;
    grid-auto-flow: unset;
    grid-template-columns: 1fr 1fr;
  }

  /* ---- Right column ---- */
  .retro-right-col {
    width: 100%;
    padding: 14px;
    box-shadow: none;
    border-top: 1px solid rgba(0, 0, 0, 0.1);
  }

  .action-group {
    margin-bottom: 15px;
  }

  /* ---- Sub bar ---- */
  .retro-sub-bar {
    padding: 6px 12px;
    font-size: 11px;
    gap: 14px;
  }

  /* ---- Top bar ---- */
  .retro-top-bar {
    padding: 8px 12px;
  }

  /* ---- Player ---- */
  .retro-player-container {
    margin-top: 10px;
  }

  .player-controls {
    flex-wrap: wrap;
    gap: 10px;
  }

  .volume-slider-retro {
    flex: 1;
    min-width: 80px;
  }

  /* ---- Settings modal ---- */
  .aero-window {
    width: calc(100% - 20px);
    max-width: 380px;
    padding: 3px;
  }

  .aero-body {
    padding: 15px 20px;
  }

  .aero-instruction {
    font-size: 16px;
    margin-bottom: 15px;
  }

  .sidebar-beta-box {
    display: none;
  }
}/* ============================================================
   Help View Styling
   ============================================================ */
.help-article {
  background: white;
  border: 1px solid #ccc;
  box-shadow: 2px 2px 8px rgba(0, 0, 0, 0.1);
  padding: 30px;
  color: #333;
  font-family: 'Segoe UI', Tahoma, sans-serif;
  line-height: 1.6;
}

.help-header {
  border-bottom: 2px solid #3366cc;
  margin-bottom: 25px;
  padding-bottom: 10px;
}

.help-subtitle {
  font-size: 14px;
  color: #666;
  font-style: italic;
}

.help-section {
  margin-bottom: 30px;
}

.help-section h3 {
  color: #3366cc;
  font-size: 18px;
  margin-bottom: 10px;
}

.help-section ul {
  margin-left: 20px;
  list-style-type: disc;
}

.help-section li {
  margin-bottom: 8px;
}

.help-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 20px;
  margin-top: 15px;
}

.help-card {
  background: #f9f9f9;
  border-left: 4px solid #3366cc;
  padding: 15px;
  border-radius: 4px;
}

.help-card h4 {
  margin-bottom: 5px;
  color: #333;
}

.help-card p {
  font-size: 13px;
  color: #555;
}

.help-footer {
  margin-top: 40px;
  padding-top: 15px;
  border-top: 1px solid #eee;
  font-size: 12px;
  color: #999;
  text-align: center;
}

.help-footer code {
  background: #eee;
  padding: 2px 4px;
  border-radius: 3px;
  color: #333;
}
