/* ============================================================
   RESET & BASE
   ============================================================ */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html, body {
  width: 100%;
  max-width: 100vw;
  min-height: 100vh;
  overflow-x: hidden;
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  -webkit-font-smoothing: antialiased;
  background: linear-gradient(135deg, #f5f7fa 0%, #e4e5e6 100%);
}

/* Animated background (rtp-web-player style) */
body::before {
  content: '';
  position: fixed;
  top: -50%;
  left: -50%;
  width: 200%;
  height: 200%;
  background:
    radial-gradient(circle at 20% 80%, rgba(139, 100, 225, 0.08) 0%, transparent 50%),
    radial-gradient(circle at 80% 20%, rgba(205, 172, 234, 0.08) 0%, transparent 50%),
    radial-gradient(circle at 40% 40%, rgba(139, 100, 225, 0.05) 0%, transparent 50%);
  animation: backgroundMove 20s ease infinite;
  z-index: -1;
}

@keyframes backgroundMove {
  0%, 100% { transform: translate(0, 0) rotate(0deg); }
  33%       { transform: translate(-10px, -10px) rotate(120deg); }
  66%       { transform: translate(10px, -10px) rotate(240deg); }
}

body {
  display: flex;
  justify-content: center;
}

/* ============================================================
   LAYOUT
   ============================================================ */
.app-container {
  width: 100%;
  max-width: 1100px;
  min-height: 100vh;
  padding: 1rem;
  display: flex;
  flex-direction: column;
  align-items: center;
  color: #333;
}

/* ============================================================
   HEADER
   ============================================================ */
.app-header {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  padding: 0 1rem;
  margin-bottom: 1.5rem;
  position: relative;
  animation: headerFadeIn 0.6s ease-out;
}

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

.app-logo {
  height: 80px;
  width: auto;
  max-width: 280px;
  object-fit: contain;
  animation: logoStandby 5s ease-in-out infinite;
}

@keyframes logoStandby {
  0%, 100% { transform: translateY(0) scale(1); }
  50%       { transform: translateY(-3px) scale(1.015); }
}

/* Language selector */
.language-selector {
  position: absolute;
  right: 1rem;
  display: flex;
  gap: 2px;
  background: rgba(255, 255, 255, 0.95);
  padding: 4px;
  border-radius: 28px;
  box-shadow: 0 2px 10px rgba(139, 100, 225, 0.15), 0 1px 3px rgba(0,0,0,0.08);
  backdrop-filter: blur(10px);
  border: 1px solid rgba(139, 100, 225, 0.1);
}

.lang-btn {
  padding: 8px 16px;
  border: none;
  background: transparent;
  color: #6b7280;
  font-weight: 600;
  font-size: 0.875rem;
  cursor: pointer;
  border-radius: 24px;
  transition: all 0.2s ease;
  min-width: 40px;
  line-height: 1;
}

.lang-btn:hover:not(.active) {
  color: #8B64E1;
  background: rgba(139, 100, 225, 0.08);
}

.lang-btn.active {
  background: linear-gradient(135deg, #8B64E1 0%, #CDACEA 100%);
  color: white;
  box-shadow: 0 2px 6px rgba(139, 100, 225, 0.3);
  font-weight: 700;
}

.lang-btn:focus { outline: none; }

/* ============================================================
   MAIN CONTENT (two-column)
   ============================================================ */
.main-content {
  display: flex;
  justify-content: center;
  gap: 1rem;
  width: 100%;
  max-width: 1080px;
  margin: 0 auto 1rem auto;
  flex-wrap: wrap;
}

/* ============================================================
   SCENARIO CARD
   ============================================================ */
.scenario-card {
  flex: 1;
  min-width: 280px;
  max-width: 480px;
  background: white;
  border-radius: 16px;
  padding: 1.25rem;
  box-shadow: 0 10px 25px rgba(0, 0, 0, 0.05);
  border: 1px solid rgba(139, 100, 225, 0.1);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 16px;
  position: relative;
  animation: assistantStandby 6s ease-in-out infinite;
  transition: box-shadow 0.3s ease, transform 0.3s ease;
}

@keyframes assistantStandby {
  0%, 100% { transform: translateY(0);    box-shadow: 0 10px 25px rgba(0,0,0,0.05); }
  40%       { transform: translateY(-2px); box-shadow: 0 12px 28px rgba(139,100,225,0.09); }
}

.scenario-card:hover {
  animation-play-state: paused;
  transform: translateY(-8px) scale(1.02);
  box-shadow: 0 20px 40px rgba(139, 100, 225, 0.15);
}

/* ============================================================
   SCENARIO TITLE
   ============================================================ */
.scenario-title {
  font-size: 1.6rem;
  font-weight: 600;
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  text-align: center;
  margin: 0;
  letter-spacing: -0.02em;
}

/* ============================================================
   VVB LOGO VISUALIZER
   ============================================================ */
.vvb-logo-container {
  width: 100%;
  max-width: 280px;
  height: 180px;
  display: flex;
  justify-content: center;
  align-items: center;
  position: relative;
}

.background-glow {
  position: absolute;
  width: 300px;
  height: 300px;
  background: radial-gradient(circle, rgba(139, 100, 225, 0.15) 0%, transparent 70%);
  border-radius: 50%;
  filter: blur(40px);
  pointer-events: none;
  opacity: 0;
  transition: opacity 0.5s ease;
}

.background-glow.active {
  opacity: 1;
  animation: glowPulse 2s ease-in-out infinite;
}

@keyframes glowPulse {
  0%, 100% { transform: scale(1);   opacity: 0.6; }
  50%       { transform: scale(1.1); opacity: 1; }
}

.vvb-logo {
  width: 75%;
  height: auto;
  max-height: 160px;
}

/* Idle bar animation (CSS-driven, before call) */
@keyframes idleBar {
  0%, 100% { transform: scaleY(1); }
  50%       { transform: scaleY(1.3); }
}

.vvb-logo.idle .bar-up,
.vvb-logo.idle .bar-down {
  animation: idleBar 4s ease-in-out infinite;
}

.vvb-logo.idle .bar-up:nth-child(1)  { animation-delay: 0.00s; }
.vvb-logo.idle .bar-up:nth-child(2)  { animation-delay: 0.20s; }
.vvb-logo.idle .bar-up:nth-child(3)  { animation-delay: 0.40s; }
.vvb-logo.idle .bar-up:nth-child(4)  { animation-delay: 0.60s; }
.vvb-logo.idle .bar-up:nth-child(5)  { animation-delay: 0.80s; }
.vvb-logo.idle .bar-up:nth-child(6)  { animation-delay: 1.00s; }
.vvb-logo.idle .bar-up:nth-child(7)  { animation-delay: 1.20s; }
.vvb-logo.idle .bar-up:nth-child(8)  { animation-delay: 1.40s; }
.vvb-logo.idle .bar-up:nth-child(9)  { animation-delay: 1.60s; }
.vvb-logo.idle .bar-up:nth-child(10) { animation-delay: 1.80s; }
.vvb-logo.idle .bar-up:nth-child(11) { animation-delay: 2.00s; }
.vvb-logo.idle .bar-up:nth-child(12) { animation-delay: 2.20s; }
.vvb-logo.idle .bar-up:nth-child(13) { animation-delay: 2.40s; }
.vvb-logo.idle .bar-up:nth-child(14) { animation-delay: 2.60s; }
.vvb-logo.idle .bar-up:nth-child(15) { animation-delay: 2.80s; }
.vvb-logo.idle .bar-up:nth-child(16) { animation-delay: 3.00s; }

.vvb-logo.idle .bar-down:nth-child(1)  { animation-delay: 0.10s; }
.vvb-logo.idle .bar-down:nth-child(2)  { animation-delay: 0.30s; }
.vvb-logo.idle .bar-down:nth-child(3)  { animation-delay: 0.50s; }
.vvb-logo.idle .bar-down:nth-child(4)  { animation-delay: 0.70s; }
.vvb-logo.idle .bar-down:nth-child(5)  { animation-delay: 0.90s; }
.vvb-logo.idle .bar-down:nth-child(6)  { animation-delay: 1.10s; }
.vvb-logo.idle .bar-down:nth-child(7)  { animation-delay: 1.30s; }
.vvb-logo.idle .bar-down:nth-child(8)  { animation-delay: 1.50s; }
.vvb-logo.idle .bar-down:nth-child(9)  { animation-delay: 1.70s; }
.vvb-logo.idle .bar-down:nth-child(10) { animation-delay: 1.90s; }
.vvb-logo.idle .bar-down:nth-child(11) { animation-delay: 2.10s; }
.vvb-logo.idle .bar-down:nth-child(12) { animation-delay: 2.30s; }
.vvb-logo.idle .bar-down:nth-child(13) { animation-delay: 2.50s; }
.vvb-logo.idle .bar-down:nth-child(14) { animation-delay: 2.70s; }
.vvb-logo.idle .bar-down:nth-child(15) { animation-delay: 2.90s; }
.vvb-logo.idle .bar-down:nth-child(16) { animation-delay: 3.10s; }

/* ============================================================
   CONNECT BUTTON
   ============================================================ */
.btn-connect {
  width: 100%;
  max-width: 280px;
  padding: 0.85rem 1.5rem;
  font-size: 1rem;
  font-weight: 600;
  background: linear-gradient(90deg, #8B64E1, #CDACEA);
  color: white;
  border: none;
  border-radius: 12px;
  cursor: pointer;
  transition: all 0.3s ease;
  box-shadow: 0 4px 10px rgba(139, 100, 225, 0.25);
  -webkit-tap-highlight-color: transparent;
}

.btn-connect:hover:not(:disabled) {
  background: linear-gradient(90deg, #7850c9, #b797d6);
  transform: translateY(-2px);
  box-shadow: 0 6px 14px rgba(139, 100, 225, 0.35);
}

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

.btn-connect.connected {
  background: linear-gradient(90deg, #e74c3c, #c0392b);
  box-shadow: 0 4px 10px rgba(231, 76, 60, 0.3);
}

.btn-connect.connected:hover:not(:disabled) {
  background: linear-gradient(90deg, #c0392b, #a93226);
  box-shadow: 0 6px 14px rgba(231, 76, 60, 0.4);
}

.btn-connect:disabled {
  background: #d1d5db;
  color: #9ca3af;
  cursor: not-allowed;
  transform: none;
  box-shadow: none;
}

/* ============================================================
   SCENARIO INFO BOX
   ============================================================ */
.scenario-info-box {
  width: 100%;
  max-width: 280px;
  padding: 14px 18px;
  background: rgba(255, 255, 255, 0.95);
  border-radius: 14px;
  backdrop-filter: blur(20px);
  border: 1px solid rgba(102, 126, 234, 0.1);
  box-shadow: 0 2px 12px rgba(0, 0, 0, 0.04);
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  cursor: pointer;
  overflow: hidden;
}

.scenario-info-box:not(.expanded) { max-height: 52px; }
.scenario-info-box.expanded        { max-height: 300px; box-shadow: 0 4px 20px rgba(0,0,0,0.08); }

.scenario-info-box:hover { transform: translateY(-1px); }

.scenario-info-box h3 {
  color: #1a202c;
  font-size: 0.95rem;
  font-weight: 500;
  margin: 0;
  display: flex;
  align-items: center;
  gap: 8px;
}

.scenario-info-box h3::before {
  content: '';
  width: 18px;
  height: 18px;
  flex-shrink: 0;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%238B64E1' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Ccircle cx='12' cy='12' r='10'%3E%3C/circle%3E%3Cpath d='M12 16v-4'%3E%3C/path%3E%3Cpath d='M12 8h.01'%3E%3C/path%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-size: contain;
}

.scenario-info-box h3::after {
  content: '';
  width: 14px;
  height: 14px;
  flex-shrink: 0;
  margin-left: auto;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%238B64E1' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='6 9 12 15 18 9'%3E%3C/polyline%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-size: contain;
  transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.scenario-info-box.expanded h3::after { transform: rotate(180deg); }

.scenario-info-box p {
  color: #4a5568;
  font-size: 0.85rem;
  line-height: 1.6;
  opacity: 0;
  transform: translateY(-8px);
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  margin: 10px 0 0 0;
}

.scenario-info-box.expanded p {
  opacity: 1;
  transform: translateY(0);
}

/* ============================================================
   DISCLAIMER POPUP
   ============================================================ */
.disclaimer-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.7);
  display: none;
  justify-content: center;
  align-items: center;
  z-index: 1000;
  backdrop-filter: blur(8px);
}

.disclaimer-overlay.show { display: flex; }

.disclaimer-popup {
  background: white;
  border-radius: 16px;
  padding: 30px;
  width: 90%;
  max-width: 500px;
  box-shadow: 0 15px 40px rgba(139, 100, 225, 0.4);
  text-align: center;
  animation: popupEntrance 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
  position: relative;
  border: 1px solid rgba(139, 100, 225, 0.1);
  overflow: hidden;
}

.disclaimer-popup::before {
  content: '';
  position: absolute;
  top: 0; left: 0;
  width: 100%;
  height: 5px;
  background: linear-gradient(90deg, #8B64E1, #CDACEA);
}

@keyframes popupEntrance {
  from { opacity: 0; transform: scale(0.9) translateY(20px); }
  to   { opacity: 1; transform: scale(1) translateY(0); }
}

.disclaimer-popup h3 {
  color: #8B64E1;
  margin: 0 0 16px;
  font-size: 1.7rem;
  font-weight: 700;
}

.disclaimer-popup p {
  margin-bottom: 20px;
  line-height: 1.6;
  color: #555;
  font-size: 1rem;
}

.disclaimer-countdown-container {
  margin: 8px auto 18px;
  width: 64px;
  height: 64px;
  display: flex;
  justify-content: center;
  align-items: center;
}

.disclaimer-countdown {
  display: flex;
  justify-content: center;
  align-items: center;
  font-size: 2rem;
  font-weight: 700;
  color: #8B64E1;
  width: 64px;
  height: 64px;
  border-radius: 50%;
  background: white;
  border: 3px solid #8B64E1;
  box-shadow: 0 0 15px rgba(139, 100, 225, 0.2);
  animation: pulseBorder 1s ease infinite alternate;
}

@keyframes pulseBorder {
  from { box-shadow: 0 0 5px rgba(139, 100, 225, 0.3); }
  to   { box-shadow: 0 0 20px rgba(139, 100, 225, 0.7); }
}

.disclaimer-buttons {
  margin-top: 24px;
  display: flex;
  justify-content: center;
  gap: 12px;
}

.disclaimer-buttons button {
  padding: 12px 24px;
  border-radius: 12px;
  cursor: pointer;
  font-weight: 600;
  font-size: 1rem;
  border: none;
  transition: all 0.3s ease;
  box-shadow: 0 4px 10px rgba(0,0,0,0.1);
  width: auto;
}

.cancel-button {
  background: #f2f2f2;
  color: #555;
  border: 1px solid #e0e0e0 !important;
}

.cancel-button:hover {
  background: #e0e0e0;
  transform: translateY(-2px);
}

.connect-now-button {
  background: linear-gradient(90deg, #8B64E1, #CDACEA);
  color: white;
}

.connect-now-button:hover {
  background: linear-gradient(90deg, #7850c9, #b797d6);
  transform: translateY(-2px);
  box-shadow: 0 6px 15px rgba(139, 100, 225, 0.3);
}

/* ============================================================
   FOOTER
   ============================================================ */
.footer-trademark {
  text-align: center;
  color: #666;
  font-size: 13px;
  margin-top: auto;
  padding: 1.5rem 0 1rem;
  user-select: none;
}

/* ============================================================
   RESPONSIVE
   ============================================================ */
@media (max-width: 1000px) {
  .main-content {
    flex-direction: column;
    align-items: center;
  }

  .scenario-card {
    width: 100%;
    max-width: 520px;
  }
}

@media (max-width: 600px) {
  .app-header {
    flex-wrap: wrap;
    justify-content: center;
    gap: 0.75rem;
    margin-bottom: 1rem;
  }

  .app-logo {
    height: 54px;
    margin-bottom: 0;
  }

  .language-selector {
    position: static;
    order: 2;
  }

  .scenario-title { font-size: 1.3rem; }

  .scenario-card { padding: 1rem; }

  .vvb-logo-container {
    height: 150px;
    max-width: 220px;
  }

  .disclaimer-popup { padding: 22px 18px; }

  .disclaimer-popup h3 { font-size: 1.4rem; }

  .disclaimer-buttons {
    flex-direction: column;
    align-items: stretch;
  }

  .disclaimer-buttons button { width: 100%; }
}

@media (max-width: 400px) {
  .scenario-title { font-size: 1.1rem; }
  .app-logo { height: 44px; }

  .vvb-logo-container {
    height: 130px;
    max-width: 190px;
  }
}
