/* Memories — Ambient Web Experience CSS Stylesheet */

@import url('https://fonts.googleapis.com/css2?family=Outfit:wght@300;400;600;700&family=Inter:wght@400;500;600&display=swap');

:root {
  --color-primary: #161915;
  --color-accent: #376d68;
  --color-accent-terracotta: #c05c46;
  --color-accent-gold: #d49a3b;
  --color-bg-card: rgba(243, 233, 212, 0.85);
  --color-bg-card-dark: rgba(26, 28, 26, 0.8);
  --color-text-light: #ffffff;
  --color-text-dark: #24251f;
  --shadow-premium: 0 12px 40px rgba(0, 0, 0, 0.4);
  --font-display: 'Outfit', -apple-system, system-ui, sans-serif;
  --font-ui: 'Inter', system-ui, sans-serif;
}

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

html, body {
  width: 100%;
  height: 100%;
  overflow: hidden;
  background-color: var(--color-primary);
  font-family: var(--font-ui);
  -webkit-font-smoothing: antialiased;
}

/* Fullscreen Background Scene */
#scene {
  position: fixed;
  inset: 0;
  background-position: center;
  background-size: cover;
  background-repeat: no-repeat;
  transition: background-image 0.8s ease-in-out, filter 0.5s ease;
  z-index: 1;
}

/* Ambient Canvas Overlay */
#ambient-canvas {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 2;
}

/* Off-screen YouTube Player container */
#yt-container {
  position: absolute;
  top: -9999px;
  left: -9999px;
  width: 1px;
  height: 1px;
  opacity: 0;
  pointer-events: none;
}

/* Local Device Clock */
#clock {
  position: fixed;
  z-index: 5;
  top: 24px;
  right: 28px;
  color: var(--color-text-light);
  font-family: var(--font-display);
  font-size: 20px;
  font-weight: 600;
  letter-spacing: 0.05em;
  text-shadow: 0 2px 14px rgba(0, 0, 0, 0.7);
  opacity: 0.9;
  transition: opacity 0.3s ease;
}

/* Clock hidden during inactivity */
.ambient-mode #clock {
  opacity: 0.25;
}

/* Live Visitor Indicator */
#live-indicator {
  position: fixed;
  z-index: 5;
  top: 24px;
  left: 28px;
  display: flex;
  align-items: center;
  gap: 8px;
  color: var(--color-text-light);
  font-family: var(--font-display);
  font-size: 16px;
  font-weight: 600;
  text-shadow: 0 2px 14px rgba(0, 0, 0, 0.7);
  opacity: 0.9;
  transition: opacity 0.3s ease;
}

.ambient-mode #live-indicator {
  opacity: 0.25;
}

.green-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background-color: #00e676;
  box-shadow: 0 0 8px #00e676;
  display: inline-block;
  animation: pulse-dot 2s infinite;
}

@keyframes pulse-dot {
  0% {
    transform: scale(0.9);
    box-shadow: 0 0 0 0 rgba(0, 230, 118, 0.7);
  }
  70% {
    transform: scale(1.1);
    box-shadow: 0 0 0 8px rgba(0, 230, 118, 0);
  }
  100% {
    transform: scale(0.9);
    box-shadow: 0 0 0 0 rgba(0, 230, 118, 0);
  }
}

/* Main Controls Container */
#controls {
  position: fixed;
  z-index: 5;
  left: 50%;
  bottom: 30px;
  transform: translateX(-50%);
  width: min(480px, calc(100% - 32px));
  display: flex;
  flex-direction: column;
  gap: 16px;
  transition: transform 0.5s cubic-bezier(0.16, 1, 0.3, 1), opacity 0.5s ease;
}




/* Glassmorphism Player Card */
.player-card {
  background: var(--color-bg-card);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border: 1px solid rgba(255, 255, 255, 0.3);
  border-radius: 24px;
  padding: 18px 20px;
  box-shadow: var(--shadow-premium);
  display: flex;
  flex-direction: column;
  gap: 12px;
  transition: background 0.4s ease, border-color 0.4s ease;
}

/* Playback Control Row */
.row {
  display: flex;
  align-items: center;
  gap: 12px;
}

.btn-ctrl {
  border: 0;
  background: transparent;
  font-size: 20px;
  width: 42px;
  height: 42px;
  border-radius: 50%;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--color-text-dark);
  transition: background-color 0.2s, transform 0.2s, opacity 0.2s;
  opacity: 0.8;
}

.btn-ctrl:hover {
  background-color: rgba(0, 0, 0, 0.06);
  opacity: 1;
  transform: scale(1.05);
}

.btn-ctrl:active {
  transform: scale(0.95);
}

#play-pause {
  background-color: var(--color-accent);
  color: var(--color-text-light);
  opacity: 1;
  box-shadow: 0 4px 12px rgba(55, 109, 104, 0.3);
}

#play-pause:hover {
  background-color: #43847e;
  box-shadow: 0 6px 16px rgba(55, 109, 104, 0.4);
}

/* Song Meta Information */
.track-info {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  justify-content: center;
}

.song-title {
  font-family: var(--font-display);
  font-size: 15px;
  font-weight: 700;
  color: var(--color-text-dark);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  letter-spacing: 0.01em;
}

.song-artist {
  font-size: 12px;
  color: var(--color-text-dark);
  opacity: 0.65;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  margin-top: 2px;
}

/* Progress Area */
.progress-area {
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin-top: 2px;
}

.slider-container {
  position: relative;
  width: 100%;
  height: 5px;
  background: rgba(0, 0, 0, 0.08);
  border-radius: 10px;
  cursor: pointer;
}

.progress-bar {
  height: 100%;
  width: 0%;
  background: var(--color-accent);
  border-radius: 10px;
  position: relative;
  transition: width 0.1s linear;
}

.progress-handle {
  position: absolute;
  right: -5px;
  top: 50%;
  transform: translateY(-50%);
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: var(--color-accent);
  box-shadow: 0 0 4px rgba(0,0,0,0.2);
  opacity: 0;
  transition: opacity 0.2s;
}

.slider-container:hover .progress-handle {
  opacity: 1;
}

.time-row {
  display: flex;
  justify-content: space-between;
  font-size: 10px;
  color: var(--color-text-dark);
  opacity: 0.6;
  font-weight: 500;
}

/* Footer links inside player */
.player-footer {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 11px;
  margin-top: 4px;
  border-top: 1px solid rgba(0, 0, 0, 0.05);
  padding-top: 8px;
}

.playlist-link {
  color: var(--color-text-dark);
  text-decoration: none;
  opacity: 0.7;
  display: flex;
  align-items: center;
  gap: 4px;
  font-weight: 500;
  transition: opacity 0.2s;
}

.playlist-link:hover {
  opacity: 1;
}

/* Edit Playlist Trigger */
.playlist-edit-btn {
  background: none;
  border: 0;
  cursor: pointer;
  opacity: 0.4;
  font-size: 11px;
  padding: 0 4px;
  transition: opacity 0.2s;
}

.playlist-edit-btn:hover {
  opacity: 0.8;
}

/* Scene Selector (The row of memory icons) */
.scene-selector {
  display: flex;
  justify-content: center;
  gap: 12px;
  background: rgba(243, 233, 212, 0.6);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border: 1px solid rgba(255, 255, 255, 0.2);
  border-radius: 20px;
  padding: 8px 12px;
}

.scene-btn {
  background: transparent;
  border: 0;
  font-size: 22px;
  width: 48px;
  height: 42px;
  border-radius: 12px;
  cursor: pointer;
  opacity: 0.5;
  transition: all 0.3s cubic-bezier(0.16, 1, 0.3, 1);
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
}

.scene-btn:hover {
  opacity: 0.9;
  transform: translateY(-2px);
  background-color: rgba(255, 255, 255, 0.25);
}

.scene-btn.active {
  opacity: 1;
  background-color: #ffffff;
  transform: translateY(-3px) scale(1.05);
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.15);
}

/* Small Indicator dot under active scene */
.scene-btn.active::after {
  content: '';
  position: absolute;
  bottom: 3px;
  width: 4px;
  height: 4px;
  border-radius: 50%;
  background: var(--color-accent);
}

/* Tactile Cassette Animation Overlay inside Player */
.cassette-holder {
  height: 60px;
  background: #1e201e;
  border-radius: 12px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
  overflow: hidden;
  box-shadow: inset 0 2px 8px rgba(0, 0, 0, 0.6);
}

.cassette-shell {
  width: 140px;
  height: 44px;
  background: #2a2c2a;
  border-radius: 6px;
  border: 1px solid #3c403c;
  position: relative;
  display: flex;
  align-items: center;
  justify-content: space-around;
  padding: 0 22px;
}

.cassette-label {
  position: absolute;
  inset: 4px;
  border: 1px solid #484c48;
  background: repeating-linear-gradient(
    45deg,
    #534d40,
    #534d40 4px,
    #5c5547 4px,
    #5c5547 8px
  );
  border-radius: 3px;
  z-index: 1;
  display: flex;
  align-items: center;
  justify-content: center;
}

.cassette-window {
  width: 54px;
  height: 16px;
  background: #0f100f;
  border-radius: 2px;
  border: 1px solid #3c403c;
  z-index: 2;
  display: flex;
  align-items: center;
  justify-content: space-around;
  padding: 0 4px;
}

.cassette-reel {
  width: 12px;
  height: 12px;
  border-radius: 50%;
  border: 2px dotted #7c827c;
  background: #1e201e;
  animation: spin 6s linear infinite;
  animation-play-state: paused;
}

.playing .cassette-reel {
  animation-play-state: running;
}

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

/* Custom Hotspots and Interactive Elements */

/* 1. Steering Wheel Horn Hotspot for Desi Truck */
#horn-hotspot {
  position: absolute;
  bottom: 8%;
  right: 12%;
  width: 180px;
  height: 180px;
  border-radius: 50%;
  cursor: pointer;
  z-index: 3;
  display: none;
  outline: none;
  -webkit-tap-highlight-color: transparent;
}

#horn-hotspot:hover .horn-indicator {
  opacity: 0.8;
  transform: scale(1.1);
}

.horn-indicator {
  position: absolute;
  inset: 0;
  border: 2px dashed rgba(255, 255, 255, 0.4);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  color: white;
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.1em;
  background: rgba(0, 0, 0, 0.2);
  opacity: 0;
  text-shadow: 0 1px 4px rgba(0, 0, 0, 0.8);
  transition: opacity 0.3s, transform 0.3s;
  pointer-events: none;
}

/* Micro-vibrations for Auto and Truck */
.engine-vibrate {
  animation: rumble 0.12s linear infinite;
}

@keyframes rumble {
  0% { transform: translate(0, 0) scale(1); }
  25% { transform: translate(0.3px, -0.3px) scale(1.0002); }
  50% { transform: translate(-0.3px, 0.3px) scale(0.9998); }
  75% { transform: translate(-0.3px, -0.3px) scale(1); }
  100% { transform: translate(0.3px, 0.3px) scale(1.0002); }
}

/* Custom alert styling for custom playlist loading */
.playlist-modal {
  position: fixed;
  z-index: 15;
  inset: 0;
  background: rgba(0,0,0,0.6);
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.3s ease;
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
}

.playlist-modal.show {
  opacity: 1;
  pointer-events: all;
}

.playlist-modal-content {
  background: #fdfaf2;
  border-radius: 20px;
  padding: 24px;
  width: min(380px, 90%);
  box-shadow: 0 20px 50px rgba(0,0,0,0.4);
  color: var(--color-text-dark);
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.playlist-modal-content h3 {
  font-family: var(--font-display);
  font-size: 18px;
  font-weight: 700;
}

.playlist-modal-content p {
  font-size: 12px;
  opacity: 0.7;
  line-height: 1.4;
}

.playlist-modal-content input {
  padding: 10px 14px;
  border-radius: 10px;
  border: 1px solid rgba(0,0,0,0.15);
  font-size: 14px;
  background: #fff;
  width: 100%;
}

.playlist-modal-content input:focus {
  outline: none;
  border-color: var(--color-accent);
}

.playlist-modal-buttons {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
  margin-top: 8px;
}

.modal-btn {
  padding: 8px 16px;
  border-radius: 8px;
  border: 0;
  cursor: pointer;
  font-size: 13px;
  font-weight: 600;
  transition: opacity 0.2s;
}

.modal-btn.cancel {
  background: transparent;
  color: var(--color-text-dark);
  opacity: 0.6;
}

.modal-btn.save {
  background: var(--color-accent);
  color: white;
}

.modal-btn:hover {
  opacity: 0.8;
}

/* Responsive Scaling for Small Screens */
@media (max-width: 600px) {
  #clock {
    top: 14px;
    right: 16px;
    font-size: 15px;
  }
  
  #controls {
    bottom: 12px;
    width: calc(100% - 20px);
    gap: 8px;
  }
  
  .player-card {
    padding: 10px 12px;
    border-radius: 16px;
    gap: 8px;
  }
  
  /* Hide heavy cassette illustration on mobile to make the player extremely compact */
  .cassette-holder {
    display: none !important;
  }
  
  .btn-ctrl {
    width: 32px;
    height: 32px;
    font-size: 14px;
  }
  
  .song-title {
    font-size: 13px;
  }

  .song-artist {
    font-size: 10px;
  }

  .progress-area {
    gap: 4px;
    margin-top: 0;
  }

  .time-row {
    font-size: 10px;
  }

  .player-footer {
    margin-top: 0;
    font-size: 11px;
  }
  
  .scene-selector {
    padding: 4px 8px;
    gap: 6px;
    border-radius: 16px;
  }
  
  .scene-btn {
    font-size: 16px;
    width: 36px;
    height: 32px;
  }
  
  #horn-hotspot {
    width: 120px;
    height: 120px;
    bottom: 15%;
    right: 5%;
  }

  #live-indicator {
    top: 14px;
    left: 16px;
    font-size: 13px;
  }
}
