/* main.css */

/* --- GOOGLE FONTS --- */
@import url('https://fonts.googleapis.com/css2?family=Cabinet+Grotesk:wght@800;900&family=Plus+Jakarta+Sans:wght@300;400;500;600;700&family=Space+Grotesk:wght@500;700&display=swap');

/* --- CUSTOM PROPERTIES --- */
:root {
  --font-sans: 'Plus Jakarta Sans', sans-serif;
  --font-title: 'Cabinet Grotesk', sans-serif;
  --font-mono: 'Space Grotesk', sans-serif;
  
  /* Color Palette - Cyber Cyberpunk Retro / Futuristic Dark */
  --bg-dark: #090714;
  --bg-mesh-1: #130a2a;
  --bg-mesh-2: #050b1a;
  
  --bg-card: rgba(15, 11, 30, 0.65);
  --bg-card-hover: rgba(22, 17, 43, 0.8);
  --border-glass: rgba(255, 255, 255, 0.05);
  --border-neon: rgba(139, 92, 246, 0.25);
  
  --primary: #8B5CF6;
  --primary-glow: rgba(139, 92, 246, 0.5);
  --secondary: #06B6D4;
  --secondary-glow: rgba(6, 182, 212, 0.5);
  --accent: #F43F5E;
  --accent-glow: rgba(244, 63, 94, 0.5);
  
  --text-main: #F8FAFC;
  --text-muted: #94A3B8;
  --text-dim: #64748B;
  
  --success: #10B981;
  --success-glow: rgba(16, 185, 129, 0.4);
  --warning: #F59E0B;
  --danger: #EF4444;
}

/* --- RESET & BASE STYLES --- */
* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
  -webkit-tap-highlight-color: transparent;
  outline: none;
}

html, body {
  width: 100%;
  height: 100%;
}

body {
  font-family: var(--font-sans);
  background-color: var(--bg-dark);
  background-image: 
    radial-gradient(at 0% 0%, var(--bg-mesh-1) 0px, transparent 50%),
    radial-gradient(at 100% 100%, var(--bg-mesh-2) 0px, transparent 50%),
    radial-gradient(at 50% 10%, rgba(139, 92, 246, 0.08) 0px, transparent 40%);
  background-attachment: fixed;
  color: var(--text-main);
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  overflow-x: hidden;
  position: relative;
  line-height: 1.5;
}

/* Dynamic Moving Mesh Backgrounds */
.mesh-glow {
  position: fixed;
  top: -20%;
  left: -20%;
  width: 140%;
  height: 140%;
  background: radial-gradient(circle, rgba(6,182,212,0.06) 0%, rgba(139,92,246,0.04) 30%, transparent 60%);
  z-index: -2;
  pointer-events: none;
  animation: floatMesh 25s ease-in-out infinite alternate;
}

@keyframes floatMesh {
  0% {
    transform: translate(0, 0) rotate(0deg);
  }
  100% {
    transform: translate(10%, 5%) rotate(15deg);
  }
}

/* Background Particle System */
.particle-bg {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: -1;
  overflow: hidden;
}

.particle {
  position: absolute;
  background-color: var(--secondary);
  border-radius: 50%;
  filter: blur(0.5px);
  opacity: 0.12;
  animation: floatUp linear infinite;
}

@keyframes floatUp {
  0% {
    transform: translateY(105vh) scale(0.8);
    opacity: 0.15;
  }
  50% {
    opacity: 0.25;
  }
  100% {
    transform: translateY(-10vh) scale(1.2);
    opacity: 0;
  }
}

/* --- APP WRAPPER (MOBILE-FIRST) --- */
.app-container {
  width: 100%;
  max-width: 440px;
  padding: 1.5rem 1.25rem;
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
  min-height: 100vh;
  justify-content: flex-start;
}

/* --- HEADER DESIGN --- */
header {
  text-align: center;
  padding: 1.25rem 0 0.5rem 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  position: relative;
}

.title-container {
  position: relative;
  z-index: 1;
}

h1.app-title {
  font-family: var(--font-title);
  font-size: 2.75rem;
  font-weight: 900;
  line-height: 0.95;
  text-transform: uppercase;
  letter-spacing: -0.04em;
  background: linear-gradient(to right, #ffffff, #c084fc 40%, #06b6d4 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  filter: drop-shadow(0 2px 20px rgba(139, 92, 246, 0.35));
}

.title-sub {
  font-family: var(--font-mono);
  font-size: 0.72rem;
  font-weight: 700;
  text-transform: uppercase;
  color: var(--secondary);
  letter-spacing: 0.28em;
  margin-top: 0.4rem;
  opacity: 0.9;
  text-shadow: 0 0 10px rgba(6, 182, 212, 0.4);
}

/* --- SECTOR DIA (LABORAL/FINDE) --- */
.day-selector-card {
  background: var(--bg-card);
  border: 1px solid var(--border-glass);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border-radius: 20px;
  padding: 1rem;
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  box-shadow: 0 12px 30px rgba(0, 0, 0, 0.4);
  position: relative;
}

.day-buttons {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 0.4rem;
}

.day-btn {
  background: rgba(255, 255, 255, 0.02);
  border: 1px solid var(--border-glass);
  color: var(--text-muted);
  padding: 0.7rem 0.5rem;
  border-radius: 10px;
  font-family: var(--font-sans);
  font-size: 0.78rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.25s cubic-bezier(0.25, 1, 0.5, 1);
}

.day-btn:hover {
  background: rgba(255, 255, 255, 0.06);
  color: var(--text-main);
  border-color: rgba(255, 255, 255, 0.15);
}

.day-btn.active {
  background: linear-gradient(135deg, var(--primary), #4f46e5);
  color: #fff;
  border-color: rgba(255, 255, 255, 0.1);
  box-shadow: 
    0 0 15px var(--primary-glow),
    inset 0 1px 1px rgba(255, 255, 255, 0.2);
}

.day-info-text {
  font-size: 0.72rem;
  color: var(--text-muted);
  text-align: center;
  line-height: 1.4;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.35rem;
  background: rgba(0, 0, 0, 0.25);
  padding: 0.4rem 0.75rem;
  border-radius: 8px;
  border: 1px solid rgba(255, 255, 255, 0.02);
}

/* --- THE SEARCH BOX (ESTOY EN...) --- */
.search-card {
  background: var(--bg-card);
  border: 1px solid var(--border-glass);
  backdrop-filter: blur(24px);
  -webkit-backdrop-filter: blur(24px);
  border-radius: 24px;
  padding: 1.75rem;
  box-shadow: 
    0 15px 35px rgba(0, 0, 0, 0.45),
    0 0 1px 1px rgba(255, 255, 255, 0.05) inset;
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
  position: relative;
  overflow: hidden;
}

.search-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 3px;
  background: linear-gradient(90deg, var(--primary), var(--secondary), var(--accent));
}

.humor-phrase-container {
  min-height: 6rem;
  display: flex;
  align-items: center;
  justify-content: center;
}

.humor-phrase {
  font-family: var(--font-mono);
  font-weight: 700;
  font-size: 1.18rem;
  text-align: center;
  line-height: 1.6;
  text-transform: uppercase;
  letter-spacing: -0.01em;
  transition: opacity 0.2s ease, transform 0.2s ease;
}

.stop-placeholder {
  display: inline-block;
  background: rgba(255, 255, 255, 0.03);
  border-bottom: 2px dashed rgba(6, 182, 212, 0.6);
  color: var(--secondary);
  padding: 0.1rem 0.5rem;
  margin: 0.1rem 0.2rem;
  border-radius: 6px;
  cursor: pointer;
  transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
  text-shadow: 0 0 6px rgba(6, 182, 212, 0.2);
  border: 1px solid rgba(6, 182, 212, 0.1);
}

.stop-placeholder:hover {
  background: rgba(6, 182, 212, 0.15);
  color: white;
  border-bottom-color: white;
  box-shadow: 0 0 12px rgba(6, 182, 212, 0.3);
}

.stop-placeholder.filled {
  color: var(--accent);
  border: 1px solid rgba(244, 63, 94, 0.2);
  border-bottom: 2px solid var(--accent);
  background: rgba(244, 63, 94, 0.08);
  font-weight: 800;
  text-shadow: 0 0 6px rgba(244, 63, 94, 0.2);
}

.swap-btn-container {
  display: flex;
  justify-content: center;
  margin-top: -0.5rem;
  margin-bottom: -0.5rem;
}

.swap-btn {
  background: #18142b;
  border: 1px solid rgba(255, 255, 255, 0.08);
  width: 42px;
  height: 42px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-muted);
  cursor: pointer;
  transition: all 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
  box-shadow: 0 6px 15px rgba(0,0,0,0.4);
  z-index: 2;
  font-size: 1.1rem;
}

.swap-btn:hover {
  color: var(--secondary);
  border-color: var(--secondary);
  transform: rotate(180deg) scale(1.1);
  box-shadow: 0 0 12px rgba(6, 182, 212, 0.3);
}

.search-buttons {
  display: flex;
  gap: 0.6rem;
}

.btn-primary {
  flex: 2;
  background: linear-gradient(135deg, var(--accent), #e11d48);
  border: none;
  color: white;
  padding: 0.95rem;
  border-radius: 14px;
  font-family: var(--font-title);
  font-weight: 800;
  font-size: 1.05rem;
  cursor: pointer;
  box-shadow: 0 6px 20px var(--accent-glow);
  transition: all 0.25s cubic-bezier(0.25, 1, 0.5, 1);
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  border: 1px solid rgba(255, 255, 255, 0.1);
}

.btn-primary:hover {
  transform: translateY(-2px) scale(1.02);
  box-shadow: 0 8px 25px rgba(244, 63, 94, 0.7);
}

.btn-primary:active {
  transform: translateY(0);
}

.btn-secondary {
  flex: 1;
  background: rgba(255, 255, 255, 0.02);
  border: 1px solid var(--border-glass);
  color: var(--text-muted);
  border-radius: 14px;
  font-family: var(--font-sans);
  font-weight: 600;
  font-size: 0.85rem;
  cursor: pointer;
  transition: all 0.2s ease;
}

.btn-secondary:hover {
  background: rgba(255, 255, 255, 0.07);
  color: var(--text-main);
  border-color: rgba(255, 255, 255, 0.15);
}

/* --- RESULTS SECTION --- */
.results-container {
  display: flex;
  flex-direction: column;
  gap: 1.1rem;
}

.results-header-text {
  font-family: var(--font-title);
  font-size: 0.9rem;
  font-weight: 800;
  text-transform: uppercase;
  color: var(--secondary);
  letter-spacing: 0.12em;
  padding-left: 0.5rem;
  text-shadow: 0 0 10px rgba(6, 182, 212, 0.2);
}

.route-card {
  background: var(--bg-card);
  border: 1px solid var(--border-glass);
  border-radius: 20px;
  overflow: hidden;
  box-shadow: 0 10px 25px rgba(0,0,0,0.3);
  animation: slideInUp 0.5s cubic-bezier(0.16, 1, 0.3, 1) both;
  transition: all 0.3s cubic-bezier(0.16, 1, 0.3, 1);
  position: relative;
}

.route-card:hover {
  background: var(--bg-card-hover);
  border-color: rgba(255, 255, 255, 0.1);
  transform: translateY(-2px);
  box-shadow: 0 12px 30px rgba(0, 0, 0, 0.4);
}

.route-card.next-soon {
  border: 1px solid rgba(16, 185, 129, 0.35);
  box-shadow: 0 8px 25px rgba(16, 185, 129, 0.15);
}

.route-card.next-soon::after {
  content: '';
  position: absolute;
  top: 0;
  right: 0;
  width: 4px;
  height: 100%;
  background: var(--success);
}

@keyframes slideInUp {
  from {
    opacity: 0;
    transform: translateY(24px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.card-header {
  padding: 1.1rem;
  display: flex;
  justify-content: space-between;
  align-items: center;
  border-bottom: 1px solid rgba(255,255,255,0.03);
  background: rgba(255, 255, 255, 0.01);
}

.line-badge {
  background: linear-gradient(135deg, var(--primary), #7c3aed);
  color: white;
  padding: 0.35rem 0.75rem;
  border-radius: 8px;
  font-weight: 900;
  font-family: var(--font-mono);
  font-size: 0.9rem;
  box-shadow: 0 0 12px var(--primary-glow);
  border: 1px solid rgba(255,255,255,0.15);
}

.line-info {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 0.2rem;
}

.line-name {
  font-size: 0.75rem;
  color: var(--text-muted);
  font-weight: 600;
}

.card-body {
  padding: 1.25rem;
  display: flex;
  flex-direction: column;
  gap: 0.9rem;
}

.main-time {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
}

.departure-time {
  font-family: var(--font-title);
  font-size: 2.5rem;
  font-weight: 900;
  color: white;
  text-shadow: 0 0 15px rgba(255,255,255,0.15);
  letter-spacing: -0.02em;
}

.time-countdown {
  font-family: var(--font-mono);
  font-weight: 700;
  font-size: 0.82rem;
  padding: 0.3rem 0.6rem;
  border-radius: 8px;
  text-transform: uppercase;
  border: 1px solid transparent;
}

.time-countdown.soon {
  background: rgba(16, 185, 129, 0.12);
  color: var(--success);
  border-color: rgba(16, 185, 129, 0.25);
  box-shadow: 0 0 8px rgba(16, 185, 129, 0.15);
  animation: pulseCountdown 1s infinite alternate;
}

@keyframes pulseCountdown {
  0% { transform: scale(1); opacity: 0.95; }
  100% { transform: scale(1.05); opacity: 1; box-shadow: 0 0 12px rgba(16, 185, 129, 0.3); }
}

.time-countdown.warn {
  background: rgba(245, 158, 11, 0.12);
  color: var(--warning);
  border-color: rgba(245, 158, 11, 0.25);
}

.time-countdown.late {
  background: rgba(239, 68, 68, 0.12);
  color: #f87171;
  border-color: rgba(239, 68, 68, 0.25);
}

.humor-verdict {
  font-size: 0.85rem;
  line-height: 1.45;
  color: var(--text-main);
  background: rgba(255, 255, 255, 0.01);
  border-left: 3px solid var(--accent);
  padding: 0.6rem 0.85rem;
  border-radius: 0 8px 8px 0;
  border-top: 1px solid rgba(255,255,255,0.01);
  border-right: 1px solid rgba(255,255,255,0.01);
  border-bottom: 1px solid rgba(255,255,255,0.01);
}

.intermediate-notice {
  font-size: 0.72rem;
  color: var(--warning);
  display: flex;
  align-items: flex-start;
  gap: 0.4rem;
  background: rgba(245, 158, 11, 0.04);
  padding: 0.5rem 0.75rem;
  border-radius: 8px;
  border: 1px dashed rgba(245, 158, 11, 0.18);
  line-height: 1.4;
}

.card-actions {
  padding: 0.8rem 1.25rem;
  background: rgba(0, 0, 0, 0.2);
  display: flex;
  justify-content: center;
  border-top: 1px solid rgba(255,255,255,0.02);
}

.btn-view-schedules {
  background: transparent;
  border: none;
  color: var(--secondary);
  font-family: var(--font-mono);
  font-size: 0.74rem;
  font-weight: 700;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 0.25rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  transition: all 0.2s ease;
}

.btn-view-schedules:hover {
  color: white;
  text-shadow: 0 0 8px var(--secondary-glow);
}

/* Expanded Schedules Panel & Route Timeline */
.expanded-schedules {
  display: none;
  background: rgba(0, 0, 0, 0.35);
  border-top: 1px solid rgba(255,255,255,0.03);
  padding: 1.25rem;
}

.expanded-schedules.open {
  display: block;
  animation: slideDown 0.35s cubic-bezier(0.16, 1, 0.3, 1);
}

.expanded-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 0.4rem;
  margin-top: 0.6rem;
}

.schedule-pill {
  background: rgba(255,255,255,0.02);
  border: 1px solid rgba(255, 255, 255, 0.05);
  padding: 0.45rem;
  border-radius: 8px;
  font-family: var(--font-mono);
  font-size: 0.75rem;
  text-align: center;
  font-weight: 600;
  color: var(--text-muted);
  transition: all 0.2s ease;
}

.schedule-pill.past {
  opacity: 0.3;
  text-decoration: line-through;
}

.schedule-pill.next-active {
  background: rgba(6, 182, 212, 0.15);
  border-color: var(--secondary);
  color: white;
  box-shadow: 0 0 10px rgba(6, 182, 212, 0.25);
  font-weight: 700;
}

/* Route visual timeline */
.route-timeline-container {
  margin-top: 0.2rem;
  margin-bottom: 0.8rem;
}

.timeline-title {
  font-size: 0.72rem;
  color: var(--text-muted);
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin-bottom: 0.5rem;
}

.timeline-track {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  overflow-x: auto;
  padding: 0.4rem 0.2rem 0.6rem 0.2rem;
}

/* Scrollbar on timeline */
.timeline-track::-webkit-scrollbar {
  height: 4px;
}
.timeline-track::-webkit-scrollbar-thumb {
  background: rgba(255, 255, 255, 0.05);
  border-radius: 2px;
}

.timeline-node {
  display: flex;
  flex-direction: column;
  align-items: center;
  min-width: 70px;
  text-align: center;
}

.node-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: var(--text-dim);
  border: 2px solid var(--bg-dark);
  z-index: 2;
  transition: all 0.2s ease;
}

.node-dot.highlight {
  background: var(--secondary);
  box-shadow: 0 0 8px var(--secondary-glow);
}

.node-dot.accent-highlight {
  background: var(--accent);
  box-shadow: 0 0 8px var(--accent-glow);
}

.node-label {
  font-size: 0.62rem;
  color: var(--text-muted);
  margin-top: 0.35rem;
  font-weight: 500;
  white-space: nowrap;
}

.node-label.active {
  color: white;
  font-weight: 700;
}

.timeline-line {
  height: 2px;
  background: rgba(255, 255, 255, 0.05);
  min-width: 25px;
  flex-shrink: 0;
  margin-top: -14px;
}

.timeline-line.active {
  background: var(--secondary);
}

/* Empty State / No Results */
.no-results {
  background: var(--bg-card);
  border: 1px dashed var(--accent);
  border-radius: 20px;
  padding: 2.25rem 1.5rem;
  text-align: center;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.8rem;
  animation: fadeIn 0.4s ease;
  box-shadow: inset 0 0 15px rgba(244, 63, 94, 0.05);
}

.no-results-icon {
  font-size: 2.25rem;
  animation: shake 1.5s infinite;
}

.no-results-msg {
  font-family: var(--font-title);
  font-size: 1.1rem;
  font-weight: 800;
  color: white;
  text-transform: uppercase;
}

.no-results-sub {
  font-size: 0.82rem;
  color: var(--text-muted);
  line-height: 1.5;
}

/* --- FOOTER & DOWNLOAD --- */
footer {
  margin-top: auto;
  padding: 2rem 0 1.5rem 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1.25rem;
  border-top: 1px solid var(--border-glass);
}

.footer-buttons {
  width: 100%;
  display: flex;
  flex-direction: column;
  gap: 0.6rem;
}

.btn-download-pdf {
  width: 100%;
  background: rgba(255, 255, 255, 0.02);
  border: 1px solid var(--border-glass);
  color: var(--text-main);
  padding: 0.85rem;
  border-radius: 12px;
  font-size: 0.82rem;
  font-weight: 600;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  transition: all 0.25s ease;
}

.btn-download-pdf:hover {
  background: rgba(6, 182, 212, 0.08);
  border-color: var(--secondary);
  box-shadow: 0 0 12px rgba(6, 182, 212, 0.2);
}

.copyright {
  font-family: var(--font-mono);
  font-size: 0.68rem;
  color: var(--text-dim);
  text-transform: uppercase;
  letter-spacing: 0.1em;
  text-align: center;
  line-height: 1.4;
}

.copyright span {
  color: var(--accent);
  font-weight: 800;
}

.version-toggle-btn {
  background: transparent;
  border: none;
  color: var(--text-dim);
  font-family: var(--font-sans);
  font-size: 0.68rem;
  cursor: pointer;
  text-decoration: underline;
  transition: color 0.2s ease;
}

.version-toggle-btn:hover {
  color: white;
}

/* --- CHANGELOG SECTION --- */
.changelog-section {
  display: none;
  background: rgba(0, 0, 0, 0.3);
  border: 1px solid var(--border-glass);
  border-radius: 14px;
  padding: 1.1rem;
  margin-top: 0.25rem;
  width: 100%;
  box-shadow: inset 0 2px 10px rgba(0,0,0,0.5);
}

.changelog-section.open {
  display: block;
  animation: slideDown 0.35s cubic-bezier(0.16, 1, 0.3, 1);
}

.changelog-title {
  font-family: var(--font-title);
  font-size: 0.8rem;
  font-weight: 800;
  text-transform: uppercase;
  color: var(--accent);
  margin-bottom: 0.75rem;
  letter-spacing: 0.06em;
}

.changelog-list {
  display: flex;
  flex-direction: column;
  gap: 0.8rem;
  max-height: 160px;
  overflow-y: auto;
  padding-right: 0.25rem;
}

.changelog-list::-webkit-scrollbar {
  width: 4px;
}
.changelog-list::-webkit-scrollbar-thumb {
  background: rgba(255, 255, 255, 0.06);
  border-radius: 2px;
}

.changelog-item {
  border-bottom: 1px solid rgba(255, 255, 255, 0.03);
  padding-bottom: 0.6rem;
}

.changelog-item:last-child {
  border-bottom: none;
  padding-bottom: 0;
}

.changelog-header {
  display: flex;
  justify-content: space-between;
  font-family: var(--font-mono);
  font-size: 0.68rem;
  font-weight: 700;
  margin-bottom: 0.3rem;
}

.changelog-version {
  color: var(--secondary);
}

.changelog-date {
  color: var(--text-dim);
}

.changelog-message {
  font-size: 0.74rem;
  line-height: 1.45;
  color: var(--text-muted);
}

/* --- MODAL SELECTOR --- */
.modal-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(4, 3, 9, 0.75);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  z-index: 100;
  display: flex;
  align-items: flex-end; /* Mobile native bottom sheet draw */
  justify-content: center;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}

.modal-overlay.open {
  opacity: 1;
  pointer-events: auto;
}

.modal-content {
  width: 100%;
  max-width: 440px;
  background: #0d0a1b;
  border-radius: 28px 28px 0 0;
  border: 1px solid var(--border-neon);
  border-bottom: none;
  padding: 1.5rem 1.5rem 2rem 1.5rem;
  display: flex;
  flex-direction: column;
  gap: 1.1rem;
  max-height: 85vh;
  transform: translateY(100%);
  transition: transform 0.35s cubic-bezier(0.16, 1, 0.3, 1);
  box-shadow: 
    0 -10px 40px rgba(139, 92, 246, 0.2),
    inset 0 1px 1px rgba(255, 255, 255, 0.05);
}

.modal-overlay.open .modal-content {
  transform: translateY(0);
}

.modal-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.modal-title {
  font-family: var(--font-title);
  font-size: 1.15rem;
  font-weight: 900;
  text-transform: uppercase;
  letter-spacing: 0.02em;
  color: white;
  background: linear-gradient(to right, white, var(--secondary));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

.modal-close {
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid var(--border-glass);
  color: var(--text-muted);
  width: 32px;
  height: 32px;
  border-radius: 50%;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  transition: all 0.2s ease;
  font-size: 1.2rem;
}

.modal-close:hover {
  background: rgba(255, 255, 255, 0.08);
  color: white;
  transform: scale(1.05);
}

.modal-search-input {
  width: 100%;
  background: rgba(255, 255, 255, 0.02);
  border: 1px solid var(--border-glass);
  color: white;
  padding: 0.85rem 1.1rem;
  border-radius: 14px;
  font-family: var(--font-sans);
  font-size: 0.92rem;
  outline: none;
  transition: all 0.25s ease;
}

.modal-search-input:focus {
  border-color: var(--secondary);
  box-shadow: 0 0 10px rgba(6, 182, 212, 0.25);
  background: rgba(255, 255, 255, 0.04);
}

.modal-list {
  display: flex;
  flex-direction: column;
  gap: 0.45rem;
  overflow-y: auto;
  max-height: 48vh;
  padding-right: 0.2rem;
}

.modal-list::-webkit-scrollbar {
  width: 4px;
}
.modal-list::-webkit-scrollbar-thumb {
  background: rgba(255, 255, 255, 0.05);
  border-radius: 2px;
}

.modal-item {
  background: rgba(255, 255, 255, 0.01);
  border: 1px solid var(--border-glass);
  color: var(--text-muted);
  padding: 0.9rem 1.1rem;
  border-radius: 12px;
  text-align: left;
  font-family: var(--font-sans);
  font-weight: 600;
  font-size: 0.88rem;
  cursor: pointer;
  transition: all 0.25s cubic-bezier(0.16, 1, 0.3, 1);
}

.modal-item:hover {
  background: rgba(139, 92, 246, 0.08);
  border-color: var(--primary);
  color: white;
  padding-left: 1.35rem;
}

.modal-item.selected {
  background: linear-gradient(135deg, var(--secondary), #0891b2);
  color: white;
  border-color: transparent;
  box-shadow: 0 5px 12px rgba(6, 182, 212, 0.25);
}

/* --- ANIMATIONS & SHAKES --- */
@keyframes shake {
  0%, 100% { transform: translateX(0); }
  20%, 60% { transform: translateX(-8px); }
  40%, 80% { transform: translateX(8px); }
}

.shake {
  animation: shake 0.45s ease-in-out;
}

@keyframes fadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

@keyframes slideDown {
  from { transform: translateY(-12px); opacity: 0; }
  to { transform: translateY(0); opacity: 1; }
}

/* Glitch styling */
.glitch-active {
  animation: glitch-anim 0.25s linear infinite;
  text-shadow: 2.5px 0 0 rgba(239, 68, 68, 0.85), -2.5px 0 0 rgba(6, 182, 212, 0.85);
}

@keyframes glitch-anim {
  0% { transform: translate(0) }
  20% { transform: translate(-3px, 2px) }
  40% { transform: translate(-2px, -3px) }
  60% { transform: translate(3px, 1px) }
  80% { transform: translate(1px, -2px) }
  100% { transform: translate(0) }
}

.confetti-canvas {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  z-index: 999;
}

/* Theme helper colors */
.neon-red { color: #F43F5E; text-shadow: 0 0 8px rgba(244, 63, 94, 0.4); }
.neon-purple { color: #C084FC; text-shadow: 0 0 8px rgba(192, 132, 252, 0.4); }
.neon-yellow { color: #F59E0B; text-shadow: 0 0 8px rgba(245, 158, 11, 0.4); }
.neon-cyan { color: #22D3EE; text-shadow: 0 0 8px rgba(34, 211, 238, 0.4); }
.neon-pink { color: #F472B6; text-shadow: 0 0 8px rgba(244, 114, 182, 0.4); }
.neon-green { color: #34D399; text-shadow: 0 0 8px rgba(52, 211, 153, 0.4); }
.neon-orange { color: #FB923C; text-shadow: 0 0 8px rgba(251, 146, 60, 0.4); }
