/* 
  style.css - Authentic 90s Geocities Aesthetic for Momo's Cyber-Book Nook
  Features: Comic Sans, high-contrast neon borders, 3D beveled windows, animated retro tags.
*/

@import url('https://fonts.googleapis.com/css2?family=Comic+Neue:wght@400;700&display=swap');

:root {
  --bg-deep: #050014;
  --bg-card: #0c0226;
  --win-bg: #140538;
  --neon-yellow: #ffff00;
  --neon-cyan: #00ffff;
  --neon-magenta: #ff007f;
  --neon-pink: #ff1493;
  --neon-green: #39ff14;
  --neon-orange: #ff6600;
  --win-border-light: #5df2d6;
  --win-border-dark: #004d40;
  --text-white: #ffffff;
  --font-retro: 'Comic Sans MS', 'Comic Neue', 'Chalkboard SE', 'Marker Felt', cursive, sans-serif;
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  overflow-x: hidden;
  width: 100%;
  max-width: 100%;
}

body {
  background-color: var(--bg-deep);
  background-image: 
    radial-gradient(rgba(255, 0, 127, 0.15) 1px, transparent 0),
    radial-gradient(rgba(0, 255, 255, 0.15) 1px, var(--bg-deep) 0);
  background-size: 30px 30px, 60px 60px;
  background-position: 0 0, 15px 15px;
  color: var(--text-white);
  font-family: var(--font-retro);
  font-size: 16px;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  line-height: 1.4;
  overflow-x: hidden;
  width: 100%;
  max-width: 100%;
  touch-action: pan-y;
}

/* Retro Marquee Bar */
.marquee-container {
  background: #ff007f;
  border-bottom: 3px outset #ffff00;
  color: #ffff00;
  font-weight: bold;
  font-size: 14px;
  padding: 6px 0;
  white-space: nowrap;
  overflow: hidden;
  box-shadow: 0 0 12px rgba(255, 0, 127, 0.8);
}

.marquee-text {
  display: inline-block;
  padding-left: 100%;
  animation: marquee 20s linear infinite;
  letter-spacing: 1px;
}

@keyframes marquee {
  0% { transform: translate(0, 0); }
  100% { transform: translate(-100%, 0); }
}

/* Page Wrapper */
.wrapper {
  max-width: 860px;
  width: 95%;
  margin: 15px auto 40px auto;
  display: flex;
  flex-direction: column;
  gap: 24px;
}

/* Header Banner */
.geocities-header {
  text-align: center;
  background: linear-gradient(180deg, #1f044d 0%, #0d0024 100%);
  border: 4px outset var(--neon-cyan);
  padding: 16px 15px 22px 15px;
  box-shadow: 0 0 20px rgba(0, 255, 255, 0.4), inset 0 0 15px rgba(255, 0, 127, 0.3);
  position: relative;
}

/* Audio BGM Controller in Header Top Bar */
.header-top-bar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  position: relative;
  margin-bottom: 6px;
}

.header-decor {
  font-size: 13px;
  color: var(--neon-yellow);
  visibility: hidden; /* balances spacing against the right button */
}

.audio-control-container {
  position: relative;
  z-index: 1000;
}

.retro-audio-btn {
  background: #000000;
  color: var(--neon-yellow);
  border: 2px outset var(--neon-cyan);
  font-family: var(--font-retro);
  font-size: 12px;
  font-weight: bold;
  padding: 4px 10px;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  box-shadow: 2px 2px 0 #000;
  transition: all 0.1s ease;
}

.retro-audio-btn:hover {
  background: #1f003b;
  border-color: var(--neon-magenta);
}

.retro-audio-btn:active {
  border-style: inset;
  transform: translate(1px, 1px);
}

.retro-volume-menu {
  position: absolute;
  top: 100%;
  right: 0;
  margin-top: 5px;
  background: #09001b;
  border: 3px outset var(--neon-magenta);
  box-shadow: 4px 4px 0 #000, 0 0 15px rgba(255, 0, 127, 0.6);
  min-width: 190px;
  display: flex;
  flex-direction: column;
  z-index: 9999;
}

.volume-option {
  padding: 8px 12px;
  font-size: 13px;
  font-weight: bold;
  color: #ffffff;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 8px;
  text-align: left;
  white-space: nowrap;
  border-bottom: 1px dashed rgba(255, 255, 255, 0.15);
  transition: background 0.1s, color 0.1s;
}

.volume-option:last-child {
  border-bottom: none;
}

.volume-option:hover {
  background: var(--neon-magenta);
  color: var(--neon-yellow);
}

.vol-check {
  display: inline-block;
  width: 14px;
  color: var(--neon-green);
  font-weight: bold;
}

/* Momo Inline Avatar inside the title 'M(O)MO' */
.momo-o-wrapper {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  vertical-align: -0.12em;
  margin: 0 2px;
  position: relative;
  top: 2px;
  line-height: 1;
}

.momo-o-img {
  width: 1.02em;
  height: 1.02em;
  border-radius: 50%;
  object-fit: cover;
  border: 2.5px solid #ffff00;
  box-shadow: 0 0 8px #ff007f, 0 0 14px #00ffff;
  display: inline-block;
  vertical-align: middle;
  transition: transform 0.2s ease;
  animation: pulse-avatar 2s infinite alternate ease-in-out;
}

.momo-o-img:hover {
  transform: scale(1.3) rotate(8deg);
  box-shadow: 0 0 15px #ffff00, 0 0 25px #ff007f;
}

@keyframes pulse-avatar {
  0% { transform: scale(1); filter: drop-shadow(0 0 4px #ff007f); }
  100% { transform: scale(1.08); filter: drop-shadow(0 0 10px #00ffff); }
}

.sparkle-row {
  font-size: 24px;
  margin-bottom: 6px;
}

.sparkle {
  display: inline-block;
  animation: pulse-sparkle 1.2s infinite alternate ease-in-out;
}
.sparkle:nth-child(2) { animation-delay: 0.3s; }
.sparkle:nth-child(3) { animation-delay: 0.6s; }
.sparkle:nth-child(4) { animation-delay: 0.9s; }

@keyframes pulse-sparkle {
  from { transform: scale(0.8) rotate(-10deg); opacity: 0.6; }
  to { transform: scale(1.3) rotate(15deg); opacity: 1; }
}

.glow-title {
  font-size: clamp(26px, 5vw, 42px);
  color: var(--neon-yellow);
  text-shadow: 
    3px 3px 0px #ff007f, 
    -2px -2px 0px #00ffff, 
    0 0 15px rgba(255, 255, 0, 0.8);
  letter-spacing: 2px;
  margin-bottom: 8px;
}

.rainbow-letter:nth-child(1) { color: #ff3366; }
.rainbow-letter:nth-child(2) { color: #ffcc00; }
.rainbow-letter:nth-child(3) { color: #33ff99; }
.rainbow-letter:nth-child(4) { color: #33ccff; }

.cyber-word {
  color: var(--neon-cyan);
}

.subtitle-badge {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  gap: 10px;
  margin-top: 8px;
  font-size: 13px;
  font-weight: bold;
}

.badge-text {
  background: #000;
  border: 2px solid var(--neon-green);
  color: var(--neon-green);
  padding: 3px 10px;
  border-radius: 4px;
}

.blink-tag {
  color: var(--neon-yellow);
  animation: retro-blink 1s steps(1, start) infinite;
}

@keyframes retro-blink {
  0%, 49% { opacity: 1; }
  50%, 100% { opacity: 0; }
}

/* 90s Retro Window Components */
.retro-window {
  background: var(--win-bg);
  border: 4px outset var(--neon-cyan);
  box-shadow: 6px 6px 0px #000, 0 0 15px rgba(0, 0, 0, 0.8);
  border-radius: 2px;
}

.window-titlebar {
  background: linear-gradient(90deg, #000080 0%, #1084d0 100%);
  color: #ffffff;
  padding: 6px 12px;
  font-weight: bold;
  font-size: 15px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-bottom: 2px solid #000;
  letter-spacing: 1px;
}

.win-icon {
  margin-right: 6px;
  font-size: 17px;
}

.win-title {
  flex-grow: 1;
}

.win-buttons {
  display: flex;
  gap: 4px;
}

.win-btn {
  background: #c0c0c0;
  color: #000;
  border: 2px outset #ffffff;
  font-size: 11px;
  width: 18px;
  height: 18px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  font-weight: bold;
}

.win-action-btn {
  background: #ff0055;
  color: #ffffff;
  border: 2px outset #ffffff;
  font-family: var(--font-retro);
  font-size: 11px;
  font-weight: bold;
  padding: 2px 8px;
  cursor: pointer;
}
.win-action-btn:hover {
  background: #cc0044;
}

.live-pill {
  background: #ff0000;
  color: #ffff00;
  font-size: 11px;
  padding: 2px 6px;
  font-weight: bold;
  border: 1px solid #ffff00;
  animation: retro-blink 1.2s infinite;
}

.window-body {
  padding: 20px;
}

/* Instructions */
.cyber-instruct {
  color: #00ffcc;
  font-size: 14px;
  margin-bottom: 18px;
  background: rgba(0, 0, 0, 0.4);
  padding: 8px 12px;
  border-left: 4px solid var(--neon-yellow);
}

/* Forms */
.cyber-form {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.form-group {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.retro-label {
  color: var(--neon-yellow);
  font-weight: bold;
  font-size: 15px;
  letter-spacing: 0.5px;
}

.label-star {
  color: var(--neon-magenta);
}

.req-tag {
  color: var(--neon-magenta);
  font-size: 12px;
}

.opt-tag {
  color: #88ccff;
  font-size: 12px;
  font-style: italic;
}

.retro-input {
  background: #000000;
  border: 3px inset #00ffff;
  color: #ffffff;
  padding: 12px 14px;
  font-family: var(--font-retro);
  font-size: 16px;
  outline: none;
  transition: border-color 0.2s;
}

.retro-input:focus {
  border-color: var(--neon-yellow);
  box-shadow: 0 0 10px rgba(255, 255, 0, 0.5);
}

/* Toggle Card */
.toggle-card {
  background: #1e0945;
  border: 2px dashed var(--neon-magenta);
  padding: 12px 15px;
  margin-top: 4px;
}

.toggle-label {
  display: flex;
  align-items: center;
  gap: 10px;
  cursor: pointer;
  color: var(--neon-yellow);
  font-size: 15px;
}

.retro-checkbox {
  width: 22px;
  height: 22px;
  accent-color: var(--neon-magenta);
  cursor: pointer;
}

.toggle-text strong {
  color: #ff3399;
}

.toggle-hint {
  font-size: 12px;
  color: #d1b8ff;
  margin-top: 6px;
  padding-left: 32px;
}

/* Retro Bevel Buttons */
.submit-container {
  margin-top: 8px;
  text-align: center;
}

.retro-btn {
  background: linear-gradient(180deg, #ff007f 0%, #a60052 100%);
  color: #ffff00;
  border: 4px outset #ff66cc;
  padding: 14px 28px;
  font-family: var(--font-retro);
  font-size: 18px;
  font-weight: bold;
  cursor: pointer;
  text-shadow: 2px 2px 0px #000;
  box-shadow: 4px 4px 0px #000;
  transition: all 0.1s ease;
  width: 100%;
  max-width: 450px;
}

.retro-btn:hover:not(:disabled) {
  background: linear-gradient(180deg, #ff3399 0%, #cc0066 100%);
  transform: translate(-1px, -1px);
  box-shadow: 5px 5px 0px #000;
}

.retro-btn:active:not(:disabled) {
  border-style: inset;
  transform: translate(2px, 2px);
  box-shadow: 1px 1px 0px #000;
}

.retro-btn:disabled {
  background: #555555 !important;
  color: #aaaaaa !important;
  border-color: #777777 !important;
  cursor: not-allowed;
  transform: none !important;
  box-shadow: none !important;
}

.btn-icon {
  font-size: 20px;
}

/* Active & Queue Lists */
.active-list, .history-list {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.empty-state {
  text-align: center;
  padding: 25px;
  color: #8c82b0;
  font-style: italic;
  font-size: 14px;
  border: 1px dashed #4b367c;
}

/* Job Cards */
.job-card {
  background: #0d022b;
  border: 3px outset var(--neon-cyan);
  padding: 14px 16px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  position: relative;
  box-shadow: 3px 3px 0px #000;
}

.job-card.active-state {
  border-color: var(--neon-yellow);
  background: #160344;
}

.job-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 10px;
}

.job-title-block {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.job-title {
  font-size: 18px;
  font-weight: bold;
  color: var(--neon-yellow);
}

.job-author {
  font-size: 14px;
  color: var(--neon-cyan);
}

.job-dest-badge {
  display: inline-block;
  font-size: 11px;
  padding: 2px 6px;
  font-weight: bold;
  border-radius: 2px;
  margin-top: 4px;
  width: fit-content;
}

.dest-momo {
  background: #004d40;
  color: #00ffcc;
  border: 1px solid #00ffcc;
}

.dest-arman {
  background: #4a0072;
  color: #ff80df;
  border: 1px solid #ff80df;
}

/* Cancel Button */
.cancel-btn {
  background: #cc0000;
  color: #ffffff;
  border: 2px outset #ff6666;
  font-family: var(--font-retro);
  font-size: 12px;
  font-weight: bold;
  padding: 4px 10px;
  cursor: pointer;
  white-space: nowrap;
}
.cancel-btn:hover {
  background: #ff0000;
}
.cancel-btn:active {
  border-style: inset;
}

/* Delete Button */
.delete-btn {
  background: #333333;
  color: #ff9999;
  border: 2px outset #777777;
  font-family: var(--font-retro);
  font-size: 12px;
  font-weight: bold;
  padding: 3px 8px;
  cursor: pointer;
}
.delete-btn:hover {
  background: #aa0000;
  color: #ffffff;
  border-color: #ff4444;
}

/* Status Bar & Animation */
.job-status-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding-top: 6px;
  border-top: 1px dashed rgba(255, 255, 255, 0.2);
  font-size: 13px;
}

.status-badge {
  font-weight: bold;
  padding: 2px 8px;
  border-radius: 2px;
  text-transform: uppercase;
  font-size: 12px;
  letter-spacing: 0.5px;
}

.status-queued {
  background: #333300;
  color: #ffff33;
  border: 1px solid #ffff33;
}

.status-searching {
  background: #002244;
  color: #33ccff;
  border: 1px solid #33ccff;
}

.status-downloading {
  background: #330033;
  color: #ff66ff;
  border: 1px solid #ff66ff;
}

.status-delivered {
  background: #003300;
  color: var(--neon-green);
  border: 1px solid var(--neon-green);
}

.status-not_found {
  background: #442200;
  color: var(--neon-orange);
  border: 1px solid var(--neon-orange);
}

.status-failed {
  background: #330000;
  color: #ff3333;
  border: 1px solid #ff3333;
}

.status-cancelled {
  background: #222222;
  color: #888888;
  border: 1px solid #666666;
}

.job-msg {
  color: #ffffff;
  font-size: 13px;
  flex-grow: 1;
}

/* Animated Retro Loader */
.cyber-loader {
  display: inline-block;
  width: 14px;
  height: 14px;
  border: 3px solid var(--neon-cyan);
  border-top-color: transparent;
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
  vertical-align: middle;
  margin-right: 6px;
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

.history-intro {
  font-size: 13px;
  color: #a49bc4;
  margin-bottom: 12px;
}

/* History Card */
.history-card {
  background: #0a0122;
  border: 2px outset #3b2b64;
}

.history-date {
  font-size: 11px;
  color: #7777aa;
}

/* Footer */
.geocities-footer {
  text-align: center;
  padding: 20px 10px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 15px;
}

.retro-divider {
  color: var(--neon-magenta);
  font-size: 14px;
  letter-spacing: 1px;
  max-width: 100%;
  overflow: hidden;
  white-space: nowrap;
  user-select: none;
}

.visitor-box {
  background: #000000;
  border: 2px inset var(--neon-green);
  padding: 6px 14px;
  display: inline-flex;
  align-items: center;
  gap: 10px;
}

.visitor-text {
  font-size: 12px;
  color: var(--neon-green);
  font-weight: bold;
}

.hit-counter {
  background: #111;
  color: #ff0033;
  font-family: 'Courier New', monospace;
  font-size: 16px;
  font-weight: bold;
  letter-spacing: 3px;
  padding: 2px 6px;
  border: 1px solid #333;
}

.badge-row {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 8px;
  margin-top: 5px;
}

.retro-badge {
  image-rendering: pixelated;
  border: 1px solid #444;
}

.copyright-tag {
  font-size: 12px;
  color: #6a6288;
}

/* Modal Overlay for Password Gate */
.modal-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  background: rgba(0, 0, 0, 0.88);
  backdrop-filter: blur(4px);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 99999;
}

.modal-window {
  width: 90%;
  max-width: 440px;
  border-color: #ff0055;
  box-shadow: 0 0 30px rgba(255, 0, 85, 0.6);
}

.alert-titlebar {
  background: linear-gradient(90deg, #8b0000 0%, #ff0055 100%);
}

.modal-body {
  text-align: center;
  display: flex;
  flex-direction: column;
  gap: 14px;
  padding: 25px 20px;
}

.lock-graphic {
  font-size: 42px;
  animation: pulse-sparkle 1.5s infinite alternate;
}

.modal-heading {
  color: var(--neon-yellow);
  font-size: 22px;
  text-shadow: 2px 2px 0px #ff0055;
  letter-spacing: 1px;
}

.modal-desc {
  font-size: 14px;
  color: #ffffff;
}

.modal-input {
  text-align: center;
  font-size: 18px;
  letter-spacing: 2px;
}

.auth-error-msg {
  color: #ff3333;
  font-size: 13px;
  font-weight: bold;
  min-height: 18px;
}

.modal-btn {
  width: 100%;
  font-size: 16px;
  padding: 12px;
}

/* Responsive adjustments & Mobile Safeguards */
@media (max-width: 600px) {
  .wrapper {
    width: 95%;
    margin: 10px auto 30px auto;
    gap: 16px;
    overflow-x: clip;
  }
  .geocities-header {
    padding: 12px 8px 16px 8px;
    border-width: 3px;
  }
  .glow-title {
    font-size: clamp(20px, 6.2vw, 32px);
    letter-spacing: 1px;
    word-break: break-word;
  }
  .momo-o-wrapper {
    margin: 0 1px;
    top: 1.5px;
  }
  .momo-o-img {
    border-width: 1.2px;
    box-shadow: 0 0 5px #ff007f, 0 0 8px #00ffff;
  }
  .sparkle-row {
    font-size: 18px;
    margin-bottom: 4px;
  }
  .subtitle-badge {
    font-size: 11px;
    gap: 6px;
  }
  .badge-text {
    padding: 2px 6px;
    font-size: 11px;
  }
  .window-titlebar {
    padding: 5px 8px;
    font-size: 13px;
  }
  .win-title {
    font-size: 13px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
  }
  .window-body {
    padding: 14px 10px;
  }
  .job-header {
    flex-direction: column;
  }
  .cancel-btn {
    align-self: flex-start;
  }
  .retro-btn {
    font-size: 16px;
    padding: 12px 14px;
  }
  .retro-audio-btn {
    font-size: 11px;
    padding: 3px 8px;
  }
  .retro-volume-menu {
    min-width: 165px;
  }
  .retro-badge {
    height: 26px;
  }
  .retro-divider {
    font-size: 12px;
    letter-spacing: 0px;
  }
  .visitor-box {
    padding: 4px 10px;
  }
}
