/* =============================================
   HOLIDAY CURRENCY CONVERTER - STYLES
   Modern, clean, mobile-first design
   ============================================= */

/* CSS Variables */
:root {
  /* High Contrast Day Mode (default) - sunny holiday vibes! */
  --primary-gradient: linear-gradient(135deg, #ff6b6b 0%, #ff8e53 100%);
  --secondary-gradient: linear-gradient(135deg, #4ecdc4 0%, #44a08d 100%);
  --accent-gradient: linear-gradient(135deg, #f6d365 0%, #fda085 100%);

  --primary-color: #ff6b6b;
  --primary-dark: #ee5a5a;
  --secondary-color: #4ecdc4;
  --accent-color: #ff8e53;

  --bg-color: #fff9e6;
  --bg-gradient: linear-gradient(180deg, #fff9e6 0%, #ffe4b8 50%, #ffd699 100%);
  --card-bg: rgba(255, 255, 255, 0.95);
  --text-primary: #1a1a2e;
  --text-secondary: #3d3d5c;
  --text-muted: #6b6b8a;

  --border-color: rgba(255, 150, 100, 0.3);
  --shadow-sm: 0 2px 8px rgba(255, 150, 100, 0.2);
  --shadow-md: 0 4px 12px rgba(255, 150, 100, 0.25);
  --shadow-lg: 0 10px 30px rgba(255, 100, 50, 0.2);
  --shadow-xl: 0 20px 40px rgba(255, 100, 50, 0.25);

  --radius-sm: 8px;
  --radius-md: 12px;
  --radius-lg: 16px;
  --radius-xl: 24px;

  --safe-top: env(safe-area-inset-top, 0px);
  --safe-bottom: env(safe-area-inset-bottom, 0px);

  --header-height: 60px;
  --nav-height: 70px;
  --status-height: 32px;
}

/* Dark/Night Mode Theme */
[data-theme="dark"] {
  --primary-gradient: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  --secondary-gradient: linear-gradient(135deg, #f093fb 0%, #f5576c 100%);
  --accent-gradient: linear-gradient(135deg, #ffecd2 0%, #fcb69f 100%);

  --primary-color: #7c8cf0;
  --primary-dark: #667eea;
  --secondary-color: #9060c0;
  --accent-color: #f5576c;

  --bg-color: #0f1419;
  --card-bg: #1a2332;
  --text-primary: #f0f4f8;
  --text-secondary: #a0aec0;
  --text-muted: #718096;

  --border-color: #2d3748;
  --shadow-sm: 0 2px 4px rgba(0,0,0,0.4);
  --shadow-md: 0 4px 8px rgba(0,0,0,0.4);
  --shadow-lg: 0 10px 25px rgba(0,0,0,0.5);
  --shadow-xl: 0 20px 40px rgba(0,0,0,0.6);
}

/* Splash Screen */
.splash-screen {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: var(--bg-gradient, var(--bg-color));
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 9999;
  transition: opacity 0.4s ease, visibility 0.4s ease;
}

.splash-screen.hidden {
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
}

.splash-content {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 16px;
}

.splash-logo {
  width: 100px;
  height: 100px;
  animation: splashBounce 1s ease-in-out infinite;
}

.splash-text {
  font-size: 1.8rem;
  font-weight: 700;
  color: var(--primary-color);
}

.splash-loader {
  width: 40px;
  height: 4px;
  background: var(--border-color);
  border-radius: 2px;
  overflow: hidden;
  position: relative;
}

.splash-loader::after {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  height: 100%;
  width: 40%;
  background: var(--primary-color);
  border-radius: 2px;
  animation: splashLoad 1s ease-in-out infinite;
}

@keyframes splashBounce {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-10px); }
}

@keyframes splashLoad {
  0% { left: -40%; }
  100% { left: 100%; }
}

.splash-version {
  position: absolute;
  bottom: 24px;
  left: 0;
  right: 0;
  text-align: center;
  font-size: 0.75rem;
  color: var(--text-muted);
  opacity: 0.7;
}

/* =============================================
   ONBOARDING SCREEN
   ============================================= */

.onboarding-screen {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  width: 100%;
  height: 100%;
  background: var(--bg-gradient, var(--bg-color));
  display: none;
  align-items: center;
  justify-content: center;
  z-index: 9998;
}

.onboarding-screen.active {
  display: flex;
}

.onboarding-content {
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 24px;
  padding-top: calc(24px + env(safe-area-inset-top, 0px));
  padding-bottom: calc(24px + env(safe-area-inset-bottom, 0px));
  max-width: 400px;
  width: 100%;
  max-height: 100%;
  overflow-y: auto;
}

.onboarding-logo {
  width: 80px;
  height: 80px;
  margin-bottom: 16px;
}

.onboarding-title {
  font-size: 1.8rem;
  font-weight: 700;
  color: var(--text-primary);
  margin: 0 0 8px 0;
  text-align: center;
}

.onboarding-subtitle {
  font-size: 1rem;
  color: var(--text-secondary);
  margin: 0 0 32px 0;
  text-align: center;
}

.onboarding-form {
  width: 100%;
  display: flex;
  flex-direction: column;
  gap: 24px;
  margin-bottom: 32px;
}

.onboarding-field {
  width: 100%;
}

.onboarding-field label {
  display: block;
  font-size: 1rem;
  font-weight: 600;
  color: var(--text-primary);
  margin-bottom: 4px;
}

.onboarding-tip {
  font-size: 0.8rem;
  color: var(--text-secondary);
  margin: 0 0 10px 0;
}

.onboarding-input {
  width: 100%;
  padding: 14px 16px;
  background: var(--card-bg);
  border: 2px solid var(--border-color);
  border-radius: var(--radius-md);
  font-size: 1rem;
  color: var(--text-primary);
  transition: all 0.2s ease;
  -webkit-appearance: none;
  box-sizing: border-box;
}

.onboarding-input:focus {
  outline: none;
  border-color: var(--primary-color);
}

.onboarding-input::placeholder {
  color: var(--text-secondary);
}

.onboarding-input.input-error {
  border-color: #ff4444;
  animation: shake 0.4s ease;
}

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

.onboarding-currency-btn {
  width: 100%;
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 14px 16px;
  background: var(--card-bg);
  border: 2px solid var(--border-color);
  border-radius: var(--radius-md);
  font-size: 1rem;
  color: var(--text-primary);
  cursor: pointer;
  transition: all 0.2s ease;
  text-align: left;
}

.onboarding-currency-btn:hover,
.onboarding-currency-btn:focus {
  border-color: var(--primary-color);
  outline: none;
}

.onboarding-currency-btn span:first-child {
  font-size: 1.5rem;
}

.onboarding-currency-btn span:nth-child(2) {
  font-weight: 700;
}

.onboarding-currency-btn span:nth-child(3) {
  flex: 1;
  color: var(--text-secondary);
}

.onboarding-currency-btn svg {
  color: var(--text-secondary);
}

.onboarding-start-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  width: 100%;
  padding: 16px 24px;
  background: var(--primary-color);
  color: white;
  border: none;
  border-radius: var(--radius-md);
  font-size: 1.1rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s ease;
}

.onboarding-start-btn:hover {
  background: var(--primary-hover);
  transform: translateY(-1px);
}

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

/* Reset & Base */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
  touch-action: manipulation;
}

html {
  font-size: 16px;
  -webkit-tap-highlight-color: transparent;
}

body {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
  background: var(--bg-gradient, var(--bg-color));
  color: var(--text-primary);
  line-height: 1.5;
  min-height: 100vh;
  min-height: -webkit-fill-available;
  overflow-x: hidden;
  position: relative;
}

/* Tropical decorations - subtle waves at bottom */
body::before {
  content: '';
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  height: 120px;
  background:
    radial-gradient(ellipse 70% 50px at 50% 100%, rgba(64, 224, 208, 0.15) 0%, transparent 100%),
    radial-gradient(ellipse 50% 40px at 30% 100%, rgba(255, 127, 80, 0.12) 0%, transparent 100%),
    radial-gradient(ellipse 50% 40px at 70% 100%, rgba(255, 215, 0, 0.12) 0%, transparent 100%);
  pointer-events: none;
  z-index: 0;
}

[data-theme="dark"] body {
  background: var(--bg-color);
}

[data-theme="dark"] body::before {
  background:
    radial-gradient(ellipse 70% 50px at 50% 100%, rgba(102, 126, 234, 0.1) 0%, transparent 100%),
    radial-gradient(ellipse 50% 40px at 30% 100%, rgba(118, 75, 162, 0.08) 0%, transparent 100%);
}

[data-theme="dark"] body::after {
  opacity: 0.1;
}

input, button, select, textarea {
  font-family: inherit;
  font-size: inherit;
}

button {
  cursor: pointer;
  border: none;
  background: none;
}

/* App Container */
.app-container {
  max-width: 600px;
  margin: 0 auto;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  padding-bottom: var(--safe-bottom);
}

/* =============================================
   HEADER
   ============================================= */
.app-header {
  background: var(--primary-gradient);
  padding: 12px 16px;
  padding-top: calc(12px + var(--safe-top));
  display: flex;
  align-items: center;
  justify-content: space-between;
  position: sticky;
  top: 0;
  z-index: 100;
  box-shadow: var(--shadow-md);
}

.header-content {
  display: flex;
  align-items: center;
  gap: 12px;
}

.header-bob-icon {
  width: 42px;
  height: 42px;
  border-radius: 10px;
  animation: bobWiggle 3s ease-in-out infinite;
  filter: drop-shadow(0 2px 4px rgba(0,0,0,0.2));
}

@keyframes bobWiggle {
  0%, 100% { transform: rotate(-5deg); }
  50% { transform: rotate(5deg); }
}

.app-header h1 {
  color: white;
  font-size: 1.5rem;
  font-weight: 700;
  letter-spacing: 0.5px;
}

/* Title animation - "Bob on Holiday" → "HoliBobs" */
.app-title {
  position: relative;
  display: inline-block;
}

.app-title .title-initial,
.app-title .title-final {
  display: inline-block;
  white-space: nowrap;
}

.app-title .title-final {
  position: absolute;
  left: 0;
  top: 0;
  opacity: 0;
  visibility: hidden;
}

.app-title.animating .title-initial {
  animation: titleFadeOut 0.4s ease-in-out 1.2s forwards;
}

.app-title.animating .title-final {
  visibility: visible;
  animation: titleFadeIn 0.4s ease-in-out 1.2s forwards;
}

.app-title.animation-done .title-initial {
  display: none;
}

.app-title.animation-done .title-final {
  position: static;
  opacity: 1;
  visibility: visible;
}

@keyframes titleFadeOut {
  0% {
    opacity: 1;
    transform: translateY(0);
  }
  100% {
    opacity: 0;
    transform: translateY(-10px);
  }
}

@keyframes titleFadeIn {
  0% {
    opacity: 0;
    transform: translateY(10px);
  }
  100% {
    opacity: 1;
    transform: translateY(0);
  }
}

.header-actions {
  display: flex;
  gap: 8px;
}

.icon-btn {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: rgba(255,255,255,0.2);
  display: flex;
  align-items: center;
  justify-content: center;
  color: white;
  transition: all 0.2s ease;
}

.icon-btn:hover, .icon-btn:active {
  background: rgba(255,255,255,0.3);
  transform: scale(1.05);
}

.icon-btn svg {
  width: 20px;
  height: 20px;
}

/* =============================================
   RATE STATUS BAR
   ============================================= */
.rate-status {
  background: var(--card-bg);
  padding: 8px 16px;
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 0.85rem;
  color: var(--text-secondary);
  border-bottom: 1px solid var(--border-color);
}

.status-indicator {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #48bb78;
}

.status-indicator.offline {
  background: #f56565;
}

.status-indicator.updating {
  background: #ecc94b;
  animation: pulse 1s infinite;
}

@keyframes pulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.5; }
}

/* =============================================
   TAB NAVIGATION
   ============================================= */
.tab-nav {
  display: flex;
  background: var(--card-bg);
  border-bottom: 1px solid var(--border-color);
  position: sticky;
  top: calc(var(--header-height) + var(--safe-top));
  z-index: 90;
}

.tab-btn {
  flex: 1;
  padding: 12px 8px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  color: var(--text-muted);
  transition: all 0.2s ease;
  position: relative;
}

.tab-btn svg {
  width: 22px;
  height: 22px;
}

.tab-btn span {
  font-size: 0.75rem;
  font-weight: 500;
}

.tab-btn.active {
  color: var(--primary-color);
}

.tab-btn.active::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 50%;
  transform: translateX(-50%);
  width: 40px;
  height: 3px;
  background: var(--primary-gradient);
  border-radius: 3px 3px 0 0;
}

/* =============================================
   MAIN CONTENT
   ============================================= */
.main-content {
  flex: 1;
  padding: 12px;
  overflow-y: auto;
}

.tab-content {
  display: none;
}

.tab-content.active {
  display: block;
  animation: fadeIn 0.3s ease;
}

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

/* =============================================
   CONVERTER TAB - HOLIDAY THEME
   ============================================= */

/* Locale Greeting */
.locale-greeting {
  text-align: center;
  font-size: 0.85rem;
  color: var(--text-muted);
  margin-bottom: 8px;
  font-weight: 500;
  overflow: hidden;
  white-space: nowrap;
  pointer-events: none;
}

.greeting-scroll {
  display: inline-block;
  animation: greeting-scroll 12s linear infinite;
  padding-left: 100%;
}

.greeting-scroll-rtl {
  padding-left: 0;
  padding-right: 100%;
  animation-name: greeting-scroll-rtl;
}

.locale-greeting:hover .greeting-scroll {
  animation-play-state: paused;
}

@keyframes greeting-scroll {
  0% {
    transform: translateX(0);
  }
  100% {
    transform: translateX(-100%);
  }
}

@keyframes greeting-scroll-rtl {
  0% {
    transform: translateX(0);
  }
  100% {
    transform: translateX(100%);
  }
}

.greeting-translation {
  font-size: 0.75rem;
  opacity: 0.7;
}

/* Destination Header */
.destination-header {
  margin-bottom: 12px;
  display: flex;
  gap: 8px;
  align-items: stretch;
}

.dest-select-btn {
  flex: 1;
  padding: 12px 16px;
  display: flex;
  align-items: center;
  gap: 12px;
  background: linear-gradient(135deg, #f6d365 0%, #fda085 100%);
  border: none;
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-md);
  transition: all 0.2s ease;
  cursor: pointer;
  position: relative;
  z-index: 1;
}

.dest-select-btn:active {
  transform: scale(0.98);
}

.dest-flag {
  font-size: 1.75rem;
}

.dest-name {
  flex: 1;
  text-align: left;
  font-weight: 700;
  font-size: 1.1rem;
  color: #744210;
}

.dest-select-btn .chevron {
  color: #744210;
}

/* Price Comparison */
.price-comparison {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
  margin-bottom: 8px;
}

/* Price Cards Stack (Vertical Layout) */
.price-cards-stack {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-bottom: 12px;
  position: relative;
  z-index: 10;
}

.price-cards-stack .price-card {
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  border-radius: var(--radius-lg);
  padding: 8px 12px;
  box-shadow: var(--shadow-md);
  display: grid !important;
  grid-template-columns: 1fr auto !important;
  grid-template-rows: auto auto !important;
  gap: 6px 8px;
  align-items: center;
}

/* Hidden state for price cards (overrides grid !important) */
.price-cards-stack .price-card.card-hidden {
  display: none !important;
}

.price-cards-stack .price-card .price-card-row {
  display: contents !important;
}

.price-cards-stack .price-card.home {
  background: linear-gradient(135deg, #38a169 0%, #2f855a 100%);
}

.price-cards-stack .price-card#altPriceCard {
  background: linear-gradient(135deg, #4a5568 0%, #2d3748 100%);
}

/* Split-flap animation backgrounds for stacked cards */
.price-cards-stack .price-card.flip-animation::after {
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
}

.price-cards-stack .price-card.home.flip-animation::after {
  background: linear-gradient(135deg, #38a169 0%, #2f855a 100%);
}

.price-cards-stack .price-card#altPriceCard.flip-animation::after {
  background: linear-gradient(135deg, #4a5568 0%, #2d3748 100%);
}

/* Price Card Info (currency display) */
.price-cards-stack .price-card-info {
  grid-column: 1;
  grid-row: 1;
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 4px;
  pointer-events: none;
}

.price-cards-stack .price-flag {
  font-size: 1.75rem;
}

/* Currency code and name stacked vertically */
.price-currency-info {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  text-align: left;
  max-width: 100px;
  overflow: hidden;
}

.price-card-info .price-currency {
  font-weight: 800;
  font-size: 1rem;
  color: white;
  line-height: 1.2;
}

.price-card-info .price-currency-name {
  font-size: 0.7rem;
  color: rgba(255, 255, 255, 0.7);
  line-height: 1.2;
  white-space: nowrap;
  overflow-x: auto;
  max-width: 100%;
  scrollbar-width: none;
  -ms-overflow-style: none;
}

.price-card-info .price-currency-name::-webkit-scrollbar {
  display: none;
}

/* Price Card Value (input + buttons) */
.price-cards-stack .price-card-value {
  grid-column: 2;
  grid-row: 1;
  display: flex;
  align-items: center;
  gap: 6px;
  position: relative;
  z-index: 2;
}

.price-card-value input {
  width: 120px;
  height: 44px;
  padding: 0 12px;
  font-size: 1.5rem;
  font-weight: 700;
  text-align: center;
  border: none;
  border-radius: 9999px;
  background: rgba(255, 255, 255, 0.9);
  color: var(--text-primary);
  position: relative;
  z-index: 3;
  box-sizing: border-box;
  line-height: 44px;
}

.price-card-value input:focus {
  outline: none;
  background: white;
}

.price-cards-stack .price-adjust {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.2);
  color: white;
  font-size: 1.25rem;
  font-weight: 600;
  display: flex;
  align-items: center;
  justify-content: center;
  border: none;
  cursor: pointer;
  transition: transform 0.1s ease;
  pointer-events: auto;
  position: relative;
  z-index: 5;
  touch-action: manipulation;
  -webkit-tap-highlight-color: rgba(255, 255, 255, 0.3);
  user-select: none;
  -webkit-user-select: none;
}

.price-cards-stack .price-adjust:active {
  transform: scale(0.9);
  background: rgba(255, 255, 255, 0.3);
}

/* Home equivalent row */
.price-cards-stack .price-home-value {
  grid-column: 2;
  grid-row: 2;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 6px 8px;
  background: rgba(0, 0, 0, 0.15);
  border-radius: var(--radius-sm);
  pointer-events: none;
}

.price-cards-stack .price-home-value .home-flag {
  font-size: 0.9rem;
}

.price-cards-stack .price-home-value .home-amount {
  font-weight: 600;
  font-size: 0.95rem;
  color: white;
}

/* Surcharge indicator in cards */
.price-cards-stack .surcharge-indicator {
  grid-column: 1;
  grid-row: 2;
  font-size: 0.7rem;
  line-height: 1.2;
  color: rgba(255, 255, 255, 0.85);
  text-align: center;
  white-space: nowrap;
  align-self: center;
}

/* Controls row */
.controls-row {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 12px;
  margin-bottom: 10px;
}

/* Lock Toggle between cards */
.lock-toggle-row {
  display: flex;
  justify-content: center;
  align-items: center;
  margin-bottom: 8px;
}

.lock-toggle-btn {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 6px 12px;
  background: var(--card-bg);
  border: 2px solid var(--border-color);
  border-radius: var(--radius-md);
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--text-secondary);
  transition: all 0.2s ease;
}

.lock-toggle-btn:active {
  transform: scale(0.98);
}

.lock-toggle-btn.locked {
  background: var(--primary-gradient);
  border-color: var(--primary-color);
  color: white;
}

.lock-toggle-btn svg {
  width: 16px;
  height: 16px;
}

/* Surcharge Controls */
.surcharge-row.hidden {
  display: none;
}

.surcharge-presets {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
  justify-content: center;
}

.surcharge-preset {
  padding: 8px 14px;
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  font-size: 0.85rem;
  font-weight: 600;
  background: var(--bg-color);
  color: var(--text-secondary);
  transition: all 0.2s ease;
}

.surcharge-preset:active {
  transform: scale(0.95);
}

.surcharge-custom {
  display: flex;
  align-items: center;
  gap: 8px;
}

.surcharge-custom.hidden {
  display: none;
}

.surcharge-label {
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--text-secondary);
}

.surcharge-input {
  width: 60px;
  padding: 6px 8px;
  border: 1px solid var(--border-color);
  border-radius: var(--radius-sm);
  font-size: 0.9rem;
  font-weight: 600;
  text-align: center;
  background: var(--bg-color);
  color: var(--text-primary);
}

.surcharge-input:focus {
  outline: none;
  border-color: var(--primary-color);
}

.surcharge-type-btn {
  padding: 6px 10px;
  border: 1px solid var(--border-color);
  border-radius: var(--radius-sm);
  font-size: 0.8rem;
  font-weight: 600;
  background: var(--bg-color);
  color: var(--text-muted);
  transition: all 0.2s ease;
}

.surcharge-type-btn.active {
  background: var(--primary-color);
  border-color: var(--primary-color);
  color: white;
}

.surcharge-toggle-btn {
  padding: 4px 8px;
  font-size: 0.75rem;
  color: var(--text-muted);
  background: transparent;
  border: none;
  text-decoration: underline;
}

.clear-prices-btn {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 6px 12px;
  background: var(--card-bg);
  border: 2px solid var(--border-color);
  border-radius: var(--radius-md);
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--text-secondary);
  transition: all 0.2s ease;
}

.clear-prices-btn:active {
  transform: scale(0.98);
}

.surcharge-adjust {
  width: 28px;
  height: 28px;
  border-radius: var(--radius-sm);
  background: var(--primary-color);
  color: white;
  font-size: 1.1rem;
  font-weight: 600;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  transition: all 0.2s ease;
  border: none;
}

.surcharge-adjust:active {
  transform: scale(0.9);
  opacity: 0.8;
}

.price-card {
  background: var(--card-bg);
  border-radius: var(--radius-lg);
  padding: 10px 8px;
  box-shadow: var(--shadow-md);
  text-align: center;
  min-width: 0; /* Allow shrinking */
  position: relative;
  transform-style: preserve-3d;
  perspective: 1000px;
}

/* Click-clack / split-flap animation */
.price-card.flip-animation {
  animation: splitFlapBounce 0.08s ease-out;
}

/* Split-flap display - horizontal split line (only during animation) */
.price-card.flip-animation::before {
  content: '';
  position: absolute;
  left: 0;
  right: 0;
  top: 50%;
  height: 2px;
  background: rgba(0, 0, 0, 0.3);
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.2);
  z-index: 10;
  pointer-events: none;
}

/* Top half flap that rotates down */
.price-card.flip-animation::after {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 50%;
  background: inherit;
  border-radius: var(--radius-lg) var(--radius-lg) 0 0;
  transform-origin: center bottom;
  animation: flapDown 0.1s ease-in forwards;
  z-index: 15;
  pointer-events: none;
  backface-visibility: hidden;
}

/* Quick bounce when flap lands */
@keyframes splitFlapBounce {
  0% {
    transform: translateY(0);
  }
  50% {
    transform: translateY(-1px);
  }
  100% {
    transform: translateY(0);
  }
}

/* Top flap rotating down quickly */
@keyframes flapDown {
  0% {
    transform: rotateX(0deg);
  }
  100% {
    transform: rotateX(-90deg);
  }
}

.price-card.local {
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
}

.price-card.alt {
  background: linear-gradient(135deg, #4a5568 0%, #2d3748 100%);
}

.price-card-header {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
  margin-bottom: 8px;
}

.price-flag {
  font-size: 1.5rem;
}

.price-currency {
  font-weight: 800;
  font-size: 1rem;
  color: white;
}

.price-label {
  font-size: 0.65rem;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: rgba(255,255,255,0.7);
}

.price-currency-name {
  display: block;
  font-size: 0.75rem;
  color: rgba(255,255,255,0.6);
  text-align: center;
  margin-bottom: 4px;
}

.price-input-wrapper {
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin-bottom: 8px;
}

.price-input-wrapper input {
  width: 100%;
  padding: 10px 8px;
  font-size: 1.75rem;
  font-weight: 700;
  text-align: center;
  border: none;
  border-radius: var(--radius-sm);
  background: rgba(255,255,255,0.9);
  color: var(--text-primary);
}

.price-input-wrapper input:focus {
  outline: none;
  background: white;
}

.price-adjust-row {
  display: flex;
  justify-content: center;
  gap: 8px;
}

.price-adjust {
  width: 44px;
  height: 28px;
  border-radius: var(--radius-sm);
  background: rgba(255,255,255,0.2);
  color: white;
  font-size: 1.25rem;
  font-weight: 600;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  transition: all 0.2s ease;
  border: none;
}

.price-adjust:active {
  transform: scale(0.9);
  background: rgba(255,255,255,0.3);
}

.price-home-value {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 8px;
  background: rgba(0,0,0,0.2);
  border-radius: var(--radius-sm);
}

.price-home-value .home-flag {
  font-size: 1rem;
}

.price-home-value .home-amount {
  font-weight: 700;
  font-size: 1.1rem;
  color: white;
}

.surcharge-indicator {
  display: block;
  font-size: 0.65rem;
  line-height: 1.4;
  color: rgba(255,255,255,0.85);
  text-align: center;
  margin-top: 6px;
  opacity: 0;
  transform: translateY(-5px);
  transition: opacity 0.3s ease, transform 0.3s ease;
}

.surcharge-indicator.animate {
  opacity: 1;
  transform: translateY(0);
}

.surcharge-indicator.animate-out {
  opacity: 0;
  transform: translateY(5px);
}

.surcharge-indicator:empty {
  display: none;
}

/* Surcharge row animation when opening */
.surcharge-row {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
  margin-bottom: 10px;
  padding: 12px;
  background: var(--card-bg);
  border-radius: var(--radius-md);
  border: 1px solid var(--border-color);
  animation: slideDown 0.3s ease-out;
}

@keyframes slideDown {
  0% {
    opacity: 0;
    transform: translateY(-10px);
  }
  100% {
    opacity: 1;
    transform: translateY(0);
  }
}

.surcharge-preset.active {
  background: var(--primary-color);
  border-color: var(--primary-color);
  color: white;
  animation: presetPulse 0.3s ease-out;
}

@keyframes presetPulse {
  0% {
    transform: scale(0.9);
  }
  50% {
    transform: scale(1.05);
  }
  100% {
    transform: scale(1);
  }
}

/* Deal Indicator */
.deal-indicator {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 10px 16px;
  background: linear-gradient(135deg, #48bb78 0%, #38a169 100%);
  border-radius: var(--radius-md);
  margin-bottom: 10px;
  box-shadow: var(--shadow-sm);
}

.deal-indicator.alt-better {
  background: linear-gradient(135deg, #ed8936 0%, #dd6b20 100%);
}

.deal-indicator.same {
  background: linear-gradient(135deg, #a0aec0 0%, #718096 100%);
}

.deal-icon {
  font-size: 1.1rem;
}

.deal-text {
  font-weight: 600;
  font-size: 0.9rem;
  color: white;
}

/* =============================================
   HOME CURRENCY CARD
   ============================================= */
.home-currency-card {
  background: linear-gradient(135deg, #38a169 0%, #2f855a 100%);
  border-radius: var(--radius-lg);
  padding: 12px 16px;
  margin-bottom: 12px;
  box-shadow: var(--shadow-md);
}

.home-card-header {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0;
  margin-bottom: 8px;
}

.home-card-flag {
  font-size: 1.5rem;
}

.home-card-currency {
  font-weight: 800;
  font-size: 1.1rem;
  color: white;
}

.home-card-label {
  font-size: 0.7rem;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: rgba(255,255,255,0.8);
}

.home-card-currency-name {
  display: block;
  font-size: 0.75rem;
  color: rgba(255,255,255,0.6);
  text-align: center;
  margin-bottom: 6px;
}

.home-surcharge {
  display: block;
  text-align: center;
  margin-top: 8px;
}

.home-card-input-wrapper {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 10px;
}

.home-card-input-wrapper input {
  flex: 1;
  min-width: 0;
  padding: 8px 12px;
  font-size: 1.75rem;
  font-weight: 700;
  text-align: center;
  border: none;
  border-radius: var(--radius-md);
  background: rgba(255,255,255,0.95);
  color: var(--text-primary);
}

.home-card-input-wrapper input:focus {
  outline: none;
  background: white;
  box-shadow: 0 0 0 3px rgba(255,255,255,0.3);
}

.home-adjust {
  width: 44px;
  height: 44px;
  border-radius: var(--radius-sm);
  background: rgba(255,255,255,0.25);
  color: white;
  font-size: 1.35rem;
  font-weight: 600;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s ease;
  border: none;
  flex-shrink: 0;
}

.home-adjust:active {
  transform: scale(0.9);
  background: rgba(255,255,255,0.35);
}

.home-conversions {
  display: flex;
  gap: 8px;
}

.home-conversion-item {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 10px 8px;
  background: rgba(0,0,0,0.2);
  border-radius: var(--radius-sm);
}

.home-conversion-item .conversion-flag {
  font-size: 1rem;
}

.home-conversion-item .conversion-amount {
  font-weight: 600;
  font-size: 0.9rem;
  color: white;
}

.home-conversion-item.local {
  background: rgba(102, 126, 234, 0.3);
}

.home-conversion-item.alt {
  background: rgba(74, 85, 104, 0.3);
}

.chevron {
  width: 20px;
  height: 20px;
  color: var(--text-muted);
}

/* Results Container */
.results-container {
  margin-top: 12px;
}

/* Primary Result Card */
.result-card {
  background: var(--primary-gradient);
  border-radius: var(--radius-lg);
  padding: 16px;
  text-align: center;
  box-shadow: var(--shadow-lg);
}

.result-card.primary {
  padding: 16px 20px;
}

.result-header {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  margin-bottom: 8px;
}

.result-flag {
  font-size: 1.5rem;
}

.result-label {
  font-size: 0.8rem;
  font-weight: 600;
  color: rgba(255,255,255,0.8);
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.result-amount {
  display: flex;
  align-items: baseline;
  justify-content: center;
  gap: 8px;
  margin-bottom: 8px;
}

.result-value {
  font-size: 2rem;
  font-weight: 800;
  color: white;
}

.result-card.secondary .result-value {
  font-size: 1.75rem;
}

.result-currency {
  font-size: 1.25rem;
  font-weight: 600;
  color: rgba(255,255,255,0.9);
}

.result-card.secondary .result-currency {
  font-size: 1rem;
}

.result-rate {
  color: rgba(255,255,255,0.8);
  font-size: 0.85rem;
}

/* Secondary Results */
.secondary-results {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
  gap: 10px;
  margin-top: 12px;
}

.result-card.secondary {
  background: linear-gradient(135deg, #4a5568 0%, #2d3748 100%);
  padding: 16px;
}

.result-card.secondary .result-header {
  margin-bottom: 6px;
}

.result-card.secondary .result-label {
  font-size: 0.7rem;
}

.result-card.secondary .result-flag {
  font-size: 1.25rem;
}

/* Currency Note */
.currency-note {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  margin-top: 12px;
  padding: 10px 16px;
  background: rgba(102, 126, 234, 0.1);
  border-radius: var(--radius-md);
  font-size: 0.85rem;
  color: var(--primary-color);
}

.currency-note svg {
  width: 16px;
  height: 16px;
  flex-shrink: 0;
}

/* Payment Info */
.payment-info {
  margin-top: 16px;
  background: var(--card-bg);
  border-radius: var(--radius-md);
  padding: 16px;
  box-shadow: var(--shadow-sm);
}

.payment-header {
  display: flex;
  align-items: center;
  gap: 8px;
  font-weight: 600;
  color: var(--text-primary);
  margin-bottom: 12px;
  padding-bottom: 8px;
  border-bottom: 1px solid var(--border-color);
}

.payment-header svg {
  width: 18px;
  height: 18px;
  color: var(--primary-color);
}

.payment-methods {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
}

.payment-method {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  padding: 10px 8px;
  background: var(--bg-color);
  border-radius: var(--radius-sm);
  text-align: center;
}

.payment-icon {
  font-size: 1.25rem;
}

.payment-label {
  font-size: 0.7rem;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.3px;
}

.payment-status {
  font-size: 0.75rem;
  font-weight: 600;
  padding: 2px 8px;
  border-radius: 10px;
  background: var(--border-color);
  color: var(--text-secondary);
}

.payment-status.essential,
.payment-status.widespread {
  background: #c6f6d5;
  color: #276749;
}

.payment-status.common {
  background: #bee3f8;
  color: #2b6cb0;
}

.payment-status.limited {
  background: #fefcbf;
  color: #b7791f;
}

.payment-status.rare {
  background: #fed7d7;
  color: #c53030;
}

.payment-tip {
  margin-top: 12px;
  padding: 10px 12px;
  background: rgba(102, 126, 234, 0.08);
  border-radius: var(--radius-sm);
  font-size: 0.8rem;
  color: var(--text-secondary);
  line-height: 1.5;
}

@media (prefers-color-scheme: dark) {
  .payment-status.essential,
  .payment-status.widespread {
    background: #22543d;
    color: #9ae6b4;
  }

  .payment-status.common {
    background: #2a4365;
    color: #90cdf4;
  }

  .payment-status.limited {
    background: #744210;
    color: #faf089;
  }

  .payment-status.rare {
    background: #742a2a;
    color: #feb2b2;
  }
}

/* Home Currency Equivalent */
.home-equivalent {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 8px;
  margin-top: 16px;
  padding: 12px 16px;
  background: var(--card-bg);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-sm);
}

.home-equivalent .label {
  color: var(--text-secondary);
  font-size: 0.9rem;
}

.home-equivalent .value {
  display: flex;
  align-items: center;
  gap: 6px;
  font-weight: 700;
  color: var(--text-primary);
}

.home-equivalent .value span:first-child {
  font-size: 1.1rem;
}

.also-in-usd .value {
  font-weight: 700;
  color: var(--text-primary);
}

/* =============================================
   COMPARE TAB
   ============================================= */
.compare-header {
  margin-bottom: 16px;
}

.compare-input-group {
  display: flex;
  gap: 12px;
  align-items: center;
}

.compare-input-group input {
  flex: 1;
  padding: 14px 16px;
  font-size: 1.25rem;
  font-weight: 700;
  border: 2px solid var(--border-color);
  border-radius: var(--radius-md);
  background: var(--card-bg);
}

.compare-input-group input:focus {
  outline: none;
  border-color: var(--primary-color);
}

.currency-pill {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 14px 16px;
  background: var(--primary-gradient);
  border-radius: var(--radius-md);
  color: white;
  font-weight: 600;
  font-size: 1rem;
}

.compare-list {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.compare-card {
  background: var(--card-bg);
  border-radius: var(--radius-md);
  padding: 16px;
  display: flex;
  align-items: center;
  gap: 12px;
  box-shadow: var(--shadow-sm);
  transition: all 0.2s ease;
}

.compare-card:hover {
  box-shadow: var(--shadow-md);
}

.compare-flag {
  font-size: 2rem;
}

.compare-info {
  flex: 1;
}

.compare-currency {
  font-weight: 700;
  font-size: 1.1rem;
  color: var(--text-primary);
}

.compare-name {
  font-size: 0.85rem;
  color: var(--text-secondary);
}

.compare-value {
  text-align: right;
}

.compare-amount {
  font-size: 1.25rem;
  font-weight: 700;
  color: var(--primary-color);
}

.compare-rate {
  font-size: 0.75rem;
  color: var(--text-muted);
}

.compare-remove {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: var(--bg-color);
  color: var(--text-muted);
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s ease;
}

.compare-remove:hover {
  background: #fed7d7;
  color: #c53030;
}

.add-currency-btn {
  width: 100%;
  padding: 16px;
  margin-top: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  background: var(--card-bg);
  border: 2px dashed var(--border-color);
  border-radius: var(--radius-md);
  color: var(--text-secondary);
  font-weight: 600;
  transition: all 0.2s ease;
}

.add-currency-btn:hover {
  border-color: var(--primary-color);
  color: var(--primary-color);
}

.add-currency-btn svg {
  width: 24px;
  height: 24px;
}

/* =============================================
   SCAMS/SAFETY TAB
   ============================================= */
.scams-destination {
  margin-bottom: 20px;
}

.scams-destination label {
  display: block;
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--text-secondary);
  margin-bottom: 8px;
}

.destination-select-btn {
  width: 100%;
  padding: 16px;
  display: flex;
  align-items: center;
  gap: 12px;
  background: var(--card-bg);
  border: 2px solid var(--border-color);
  border-radius: var(--radius-md);
  transition: all 0.2s ease;
  box-shadow: var(--shadow-sm);
}

.destination-select-btn:hover {
  border-color: var(--primary-color);
}

.destination-flag {
  font-size: 1.75rem;
}

.destination-name {
  flex: 1;
  text-align: left;
  font-weight: 600;
  color: var(--text-primary);
}

/* Safety Tabs */
.safety-tabs-container {
  margin-top: 16px;
}

.safety-tabs {
  display: flex;
  gap: 8px;
  margin-bottom: 16px;
}

.safety-tab {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 10px 12px;
  background: var(--card-bg);
  border: 2px solid var(--border-color);
  border-radius: var(--radius-md);
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--text-secondary);
  cursor: pointer;
  transition: all 0.2s ease;
}

.safety-tab svg {
  width: 16px;
  height: 16px;
}

.safety-tab:hover {
  border-color: var(--primary-color);
  color: var(--primary-color);
}

.safety-tab.active {
  background: var(--primary-color);
  border-color: var(--primary-color);
  color: white;
}

.safety-tab.active svg {
  color: white;
}

.safety-tab-content {
  display: none;
}

.safety-tab-content.active {
  display: block;
}

.no-country-message {
  text-align: center;
  padding: 32px 16px;
  color: var(--text-muted);
}

.no-country-message span {
  font-size: 2.5rem;
  display: block;
  margin-bottom: 8px;
}

.no-country-message p {
  font-size: 0.9rem;
}

.safety-section {
  margin-bottom: 24px;
}

.safety-section h3 {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 1rem;
  color: var(--text-primary);
  margin-bottom: 12px;
  padding-bottom: 8px;
  border-bottom: 2px solid var(--border-color);
}

.safety-section h3 svg {
  width: 20px;
  height: 20px;
  color: var(--primary-color);
}

.tips-box {
  background: #ebf8ff;
  border-left: 4px solid #4299e1;
  border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
  padding: 12px 16px;
  margin-bottom: 16px;
}

.tips-box ul {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.tips-box li {
  font-size: 0.9rem;
  color: var(--text-secondary);
  padding-left: 20px;
  position: relative;
}

.tips-box li::before {
  content: '✓';
  position: absolute;
  left: 0;
  color: #4299e1;
  font-weight: bold;
}

.general-tips-note {
  font-size: 0.85rem;
  color: var(--text-secondary);
  font-style: italic;
  margin: 0;
}

.scam-cards {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.scam-card {
  background: var(--card-bg);
  border-radius: var(--radius-md);
  padding: 16px;
  box-shadow: var(--shadow-sm);
  border-left: 4px solid var(--border-color);
}

.scam-card.high {
  border-left-color: #f56565;
}

.scam-card.medium {
  border-left-color: #ecc94b;
}

.scam-card.low {
  border-left-color: #48bb78;
}

.scam-header {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 8px;
}

.scam-icon {
  font-size: 1.5rem;
}

.scam-title {
  flex: 1;
  font-weight: 700;
  color: var(--text-primary);
}

.scam-severity {
  font-size: 0.7rem;
  font-weight: 600;
  text-transform: uppercase;
  padding: 4px 8px;
  border-radius: 4px;
  background: var(--bg-color);
}

.scam-card.high .scam-severity {
  background: #fed7d7;
  color: #c53030;
}

.scam-card.medium .scam-severity {
  background: #fefcbf;
  color: #b7791f;
}

.scam-card.low .scam-severity {
  background: #c6f6d5;
  color: #276749;
}

.scam-description {
  font-size: 0.9rem;
  color: var(--text-secondary);
  line-height: 1.6;
}

/* =============================================
   MODALS
   ============================================= */
.modal {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0,0,0,0.5);
  display: flex;
  align-items: flex-start;
  justify-content: center;
  z-index: 2500;
  opacity: 0;
  visibility: hidden;
  transition: all 0.3s ease;
  padding-top: 10vh;
  overflow-y: auto;
}

.modal.active {
  opacity: 1;
  visibility: visible;
}

.modal-content {
  background: var(--card-bg);
  width: 100%;
  max-width: 600px;
  max-height: 80vh;
  border-radius: var(--radius-xl);
  display: flex;
  flex-direction: column;
  transform: translateY(-20px);
  opacity: 0;
  transition: transform 0.3s ease, opacity 0.3s ease;
  margin-bottom: 20px;
}

.modal.active .modal-content {
  transform: translateY(0);
  opacity: 1;
}

.modal-header {
  padding: 20px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-bottom: 1px solid var(--border-color);
}

.modal-header h2 {
  font-size: 1.25rem;
  font-weight: 700;
}

.modal-close {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: var(--bg-color);
  font-size: 1.5rem;
  color: var(--text-muted);
  display: flex;
  align-items: center;
  justify-content: center;
}

.modal-search {
  padding: 12px 20px;
  display: flex;
  align-items: center;
  gap: 12px;
  background: var(--bg-color);
  margin: 16px 20px;
  border-radius: var(--radius-md);
  border: 1px solid var(--border-color);
}

.modal-search svg {
  width: 20px;
  height: 20px;
  color: var(--text-muted);
}

.modal-search input {
  flex: 1;
  border: none;
  background: transparent;
  font-size: 1rem;
  color: var(--text-primary);
}

.modal-search input:focus {
  outline: none;
}

/* GPS Location option in modal */
.locate-option {
  display: flex;
  align-items: center;
  gap: 12px;
  width: calc(100% - 40px);
  margin: 0 20px 16px;
  padding: 14px 16px;
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  border: none;
  border-radius: var(--radius-md);
  color: white;
  font-size: 1rem;
  font-weight: 600;
  cursor: pointer;
  transition: transform 0.2s, box-shadow 0.2s;
}

.locate-option:hover {
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(102, 126, 234, 0.4);
}

.locate-option:active {
  transform: translateY(0);
}

.locate-option svg {
  width: 22px;
  height: 22px;
  flex-shrink: 0;
}

.currency-list, .destination-list {
  flex: 1;
  overflow-y: auto;
  padding: 0 20px 20px;
}

.currency-item, .destination-item {
  padding: 14px 16px;
  display: flex;
  align-items: center;
  gap: 12px;
  border-radius: var(--radius-md);
  transition: background 0.2s ease;
  cursor: pointer;
}

.currency-item:hover, .destination-item:hover {
  background: var(--bg-color);
}

.currency-item .flag, .destination-item .flag {
  font-size: 1.5rem;
}

.currency-item .code {
  font-weight: 700;
  min-width: 50px;
}

.currency-item .name, .destination-item .name {
  flex: 1;
  color: var(--text-secondary);
}

/* Wallet Section */
.wallet-section {
  padding: 0 20px;
  margin-bottom: 8px;
}

.wallet-header {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--primary-color);
  padding: 8px 0;
  border-bottom: 1px solid var(--border-color);
  margin-bottom: 4px;
}

.wallet-icon {
  font-size: 1rem;
}

.wallet-list {
  display: flex;
  flex-direction: column;
}

.wallet-item {
  padding: 12px 16px;
  display: flex;
  align-items: center;
  gap: 12px;
  background: rgba(102, 126, 234, 0.08);
  border-radius: var(--radius-md);
  margin-bottom: 4px;
  cursor: pointer;
  transition: all 0.2s ease;
}

.wallet-item:hover {
  background: rgba(102, 126, 234, 0.15);
}

.wallet-item .flag {
  font-size: 1.5rem;
}

.wallet-item .name {
  flex: 1;
  font-weight: 500;
  color: var(--text-primary);
}

.wallet-item .remove-wallet {
  width: 24px;
  height: 24px;
  border-radius: 50%;
  background: transparent;
  color: var(--text-muted);
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s ease;
}

.wallet-item .remove-wallet:hover {
  background: #fed7d7;
  color: #c53030;
}

.destination-item .add-wallet {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: transparent;
  color: var(--text-muted);
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s ease;
  flex-shrink: 0;
}

.destination-item .add-wallet:hover {
  background: rgba(102, 126, 234, 0.15);
  color: var(--primary-color);
}

.destination-item .add-wallet.in-wallet {
  color: var(--primary-color);
}

.destination-item .add-wallet.in-wallet:hover {
  background: #fed7d7;
  color: #c53030;
}

/* =============================================
   SETTINGS MODAL
   ============================================= */
.settings-content {
  padding: 20px;
  overflow-y: auto;
}

.setting-group {
  margin-bottom: 24px;
}

.setting-group label {
  display: block;
  font-weight: 700;
  margin-bottom: 4px;
}

.setting-description {
  font-size: 0.85rem;
  color: var(--text-secondary);
  margin-bottom: 12px;
}

.setting-btn {
  width: 100%;
  padding: 14px 16px;
  display: flex;
  align-items: center;
  gap: 12px;
  background: var(--bg-color);
  border: 2px solid var(--border-color);
  border-radius: var(--radius-md);
  text-align: left;
  transition: all 0.2s ease;
}

.setting-btn:hover {
  border-color: var(--primary-color);
}

.setting-input-wrapper {
  position: relative;
  width: 100%;
}

.setting-input {
  width: 100%;
  padding: 14px 16px;
  padding-right: 40px;
  background: var(--bg-color);
  border: 2px solid var(--border-color);
  border-radius: var(--radius-md);
  font-size: 1rem;
  color: var(--text-primary);
  transition: all 0.2s ease;
  -webkit-appearance: none;
  -moz-appearance: none;
  appearance: none;
}

/* Hide search field decorations */
.setting-input::-webkit-search-decoration,
.setting-input::-webkit-search-cancel-button,
.setting-input::-webkit-search-results-button,
.setting-input::-webkit-search-results-decoration {
  -webkit-appearance: none;
  display: none;
}

.setting-input:focus {
  outline: none;
  border-color: var(--primary-color);
}

.setting-input::placeholder {
  color: var(--text-secondary);
}

.input-save-status {
  position: absolute;
  right: 14px;
  top: 50%;
  transform: translateY(-50%);
  font-size: 0.7rem;
  font-weight: 500;
  opacity: 0;
  transition: opacity 0.3s ease;
  color: var(--text-secondary);
}

.input-save-status.show {
  opacity: 1;
}

.input-save-status.saved {
  color: #4CAF50;
}

.setting-btn span:first-child {
  font-size: 1.5rem;
}

.setting-btn span:nth-child(2) {
  font-weight: 700;
}

.setting-btn span:nth-child(3) {
  flex: 1;
  color: var(--text-secondary);
}

.setting-action-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  width: 100%;
  padding: 14px;
  background: var(--primary-gradient);
  border-radius: var(--radius-md);
  color: white;
  font-weight: 600;
}

.setting-action-btn svg {
  width: 20px;
  height: 20px;
}

.setting-action-btn.secondary {
  background: var(--bg-color);
  border: 2px solid var(--border-color);
  color: var(--text-primary);
}

.setting-action-btn.secondary:hover {
  border-color: var(--primary-color);
}

/* QR Code Modal */
.qr-modal-content {
  max-width: 360px;
}

.qr-content {
  padding: 24px;
  text-align: center;
}

.qr-mascot {
  font-size: 3rem;
  margin-bottom: 8px;
  animation: bobBounce 2s ease-in-out infinite;
}

.qr-subtitle {
  font-size: 1rem;
  color: var(--text-secondary);
  margin-bottom: 20px;
}

.qr-code-container {
  display: flex;
  justify-content: center;
  padding: 16px;
  background: white;
  border-radius: var(--radius-md);
  margin-bottom: 16px;
  box-shadow: var(--shadow-sm);
}

.qr-code-container canvas {
  border-radius: var(--radius-sm);
}

.qr-url {
  font-size: 0.8rem;
  color: var(--text-muted);
  word-break: break-all;
  margin-bottom: 16px;
  padding: 8px 12px;
  background: var(--bg-color);
  border-radius: var(--radius-sm);
}

.qr-copy-btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 10px 20px;
  background: var(--primary-gradient);
  color: white;
  border-radius: var(--radius-md);
  font-weight: 600;
  transition: all 0.2s ease;
}

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

/* Toggle Switch */
.toggle {
  position: relative;
  display: inline-block;
  width: 52px;
  height: 28px;
}

.toggle input {
  opacity: 0;
  width: 0;
  height: 0;
}

.toggle-slider {
  position: absolute;
  cursor: pointer;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background-color: var(--border-color);
  transition: 0.3s;
  border-radius: 28px;
}

.toggle-slider:before {
  position: absolute;
  content: "";
  height: 22px;
  width: 22px;
  left: 3px;
  bottom: 3px;
  background-color: white;
  transition: 0.3s;
  border-radius: 50%;
  box-shadow: var(--shadow-sm);
}

.toggle input:checked + .toggle-slider {
  background: var(--primary-gradient);
}

.toggle input:checked + .toggle-slider:before {
  transform: translateX(24px);
}

.about-text {
  font-size: 0.85rem;
  color: var(--text-secondary);
  line-height: 1.6;
}

/* =============================================
   ADD TO HOME SCREEN
   ============================================= */
.a2hs-banner {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  background: var(--card-bg);
  padding: 16px 20px;
  padding-bottom: calc(16px + var(--safe-bottom));
  box-shadow: 0 -4px 20px rgba(0,0,0,0.15);
  display: none;
  z-index: 500;
}

.a2hs-banner.active {
  display: block;
  animation: slideUp 0.3s ease;
}

@keyframes slideUp {
  from { transform: translateY(100%); }
  to { transform: translateY(0); }
}

.a2hs-content {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 12px;
}

.a2hs-bob {
  font-size: 2.5rem;
  animation: bobWave 2s ease-in-out infinite;
}

@keyframes bobWave {
  0%, 100% { transform: rotate(0deg); }
  25% { transform: rotate(15deg); }
  75% { transform: rotate(-15deg); }
}

.a2hs-text {
  flex: 1;
}

.a2hs-text strong {
  display: block;
  margin-bottom: 2px;
}

.a2hs-text span {
  font-size: 0.85rem;
  color: var(--text-secondary);
}

.a2hs-actions {
  display: flex;
  gap: 12px;
}

.a2hs-btn {
  flex: 1;
  padding: 12px;
  border-radius: var(--radius-md);
  font-weight: 600;
  transition: all 0.2s ease;
}

.a2hs-btn.primary {
  background: var(--primary-gradient);
  color: white;
}

.a2hs-btn.secondary {
  background: var(--bg-color);
  color: var(--text-secondary);
}

/* iOS Instructions Modal */
.ios-a2hs-modal {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0,0,0,0.7);
  display: none;
  align-items: flex-end;
  justify-content: center;
  z-index: 1100;
}

.ios-a2hs-modal.active {
  display: flex;
  animation: fadeIn 0.3s ease;
}

.ios-a2hs-content {
  background: var(--card-bg);
  width: 100%;
  max-width: 400px;
  border-radius: var(--radius-xl) var(--radius-xl) 0 0;
  padding: 24px;
  padding-bottom: calc(24px + var(--safe-bottom));
  text-align: center;
  position: relative;
}

.ios-a2hs-content .modal-close {
  position: absolute;
  top: 16px;
  right: 16px;
}

.ios-a2hs-bob {
  font-size: 4rem;
  display: block;
  margin-bottom: 16px;
  animation: bobBounce 2s ease-in-out infinite;
}

.ios-a2hs-content h2 {
  margin-bottom: 8px;
}

.ios-a2hs-content > p {
  color: var(--text-secondary);
  margin-bottom: 20px;
}

.ios-instructions {
  text-align: left;
  list-style: none;
  margin-bottom: 20px;
}

.ios-instructions li {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 0;
  border-bottom: 1px solid var(--border-color);
}

.ios-instructions li:last-child {
  border-bottom: none;
}

.step-icon {
  width: 36px;
  height: 36px;
  background: var(--bg-color);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--primary-color);
}

.step-icon svg {
  width: 20px;
  height: 20px;
}

.ios-arrow {
  position: absolute;
  bottom: calc(100% - 10px);
  left: 50%;
  transform: translateX(-50%);
  color: white;
  animation: bounce 1s infinite;
}

.ios-arrow svg {
  width: 32px;
  height: 32px;
}

@keyframes bounce {
  0%, 100% { transform: translateX(-50%) translateY(0); }
  50% { transform: translateX(-50%) translateY(-8px); }
}

/* =============================================
   TOAST NOTIFICATION
   ============================================= */
.toast {
  position: fixed;
  bottom: 100px;
  left: 16px;
  right: 16px;
  transform: translateY(100px);
  background: var(--text-primary);
  color: white;
  padding: 12px 24px;
  border-radius: var(--radius-lg);
  font-weight: 500;
  opacity: 0;
  transition: all 0.3s ease;
  z-index: 1200;
  box-shadow: var(--shadow-lg);
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
}

.toast.active {
  opacity: 1;
  transform: translateY(0);
}

.toast-icon {
  width: 18px;
  height: 18px;
  flex-shrink: 0;
}

/* =============================================
   UPDATE AVAILABLE BANNER
   ============================================= */
.update-banner {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  gap: 16px;
  z-index: 9999;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.4s ease;
}

.update-banner::before {
  content: '';
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.7);
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
}

.update-banner-content {
  position: relative;
  background: linear-gradient(135deg, #48bb78 0%, #38a169 100%);
  border-radius: var(--radius-lg);
  padding: 24px 32px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 16px;
  box-shadow: var(--shadow-lg);
  max-width: calc(100% - 32px);
  transform: translateY(-20px);
  transition: transform 0.4s ease;
}

.update-banner.active {
  opacity: 1;
  pointer-events: auto;
}

.update-banner.active .update-banner-content {
  transform: translateY(0);
}

.update-bob-icon {
  width: 64px;
  height: 64px;
  border-radius: 16px;
  animation: bobExcited 0.5s ease-in-out infinite;
}

@keyframes bobExcited {
  0%, 100% { transform: scale(1) rotate(0deg); }
  50% { transform: scale(1.1) rotate(10deg); }
}

.update-text {
  color: white;
}

.update-text strong {
  display: block;
  font-size: 1.05rem;
  margin-bottom: 2px;
}

.update-text span {
  font-size: 0.9rem;
  opacity: 0.9;
}

.update-btn {
  padding: 10px 24px;
  background: white;
  color: #38a169;
  border-radius: var(--radius-sm);
  font-weight: 700;
  font-size: 0.95rem;
  transition: all 0.2s ease;
}

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

/* =============================================
   RESPONSIVE DESIGN
   ============================================= */

/* Tablet */
@media (min-width: 768px) {
  .app-container {
    padding: 20px;
  }

  .app-header {
    border-radius: var(--radius-lg);
    margin-bottom: 8px;
  }

  .rate-status {
    border-radius: var(--radius-md);
    margin-bottom: 8px;
  }

  .tab-nav {
    border-radius: var(--radius-md);
    margin-bottom: 8px;
    position: relative;
    top: auto;
  }

  .main-content {
    background: var(--card-bg);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-md);
  }

  .modal-content {
    border-radius: var(--radius-xl);
    margin: 20px;
    max-height: calc(100vh - 40px);
  }

  .result-value {
    font-size: 3rem;
  }

  .compare-list {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 16px;
  }

  .scam-cards {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 16px;
  }
}

/* Desktop */
@media (min-width: 1024px) {
  body {
    background: linear-gradient(135deg, #667eea22 0%, #764ba222 100%);
  }

  .app-container {
    max-width: 800px;
    margin: 40px auto;
    border-radius: var(--radius-xl);
    box-shadow: var(--shadow-xl);
    background: var(--bg-color);
    overflow: hidden;
    min-height: auto;
  }

  .app-header {
    border-radius: 0;
    margin-bottom: 0;
  }

  .rate-status {
    border-radius: 0;
    margin-bottom: 0;
  }

  .tab-nav {
    border-radius: 0;
    margin-bottom: 0;
  }

  .main-content {
    border-radius: 0;
    min-height: 500px;
  }

  .modal-content {
    max-width: 500px;
    max-height: 80vh;
    margin: auto;
    border-radius: var(--radius-xl);
  }
}

/* Large screens */
@media (min-width: 1200px) {
  .compare-list, .scam-cards {
    grid-template-columns: repeat(3, 1fr);
  }
}

/* Dark mode - apply when system prefers AND no manual theme set */
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --primary-gradient: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    --primary-color: #7c8cf0;
    --primary-dark: #667eea;
    --secondary-color: #9060c0;
    --bg-color: #0f1419;
    --card-bg: #1a2332;
    --text-primary: #f0f4f8;
    --text-secondary: #a0aec0;
    --text-muted: #718096;
    --border-color: #2d3748;
  }
}

/* Dark theme specific overrides */
[data-theme="dark"] .amount-input-wrapper input,
[data-theme="dark"] .compare-input-group input,
[data-theme="dark"] .price-input-wrapper input,
[data-theme="dark"] .home-card-input-wrapper input {
  background: var(--bg-color);
  color: var(--text-primary);
}

[data-theme="dark"] .price-card-value input {
  background: rgba(255, 255, 255, 0.95);
  color: #1a202c;
}

[data-theme="dark"] .tips-box {
  background: #2a4365;
  border-left-color: #63b3ed;
}

[data-theme="dark"] .scam-card.high .scam-severity {
  background: #742a2a;
  color: #feb2b2;
}

[data-theme="dark"] .scam-card.medium .scam-severity {
  background: #744210;
  color: #faf089;
}

[data-theme="dark"] .scam-card.low .scam-severity {
  background: #22543d;
  color: #9ae6b4;
}

[data-theme="dark"] .setup-content {
  background: var(--card-bg);
}

/* Theme Toggle Button */
.theme-toggle {
  position: relative;
  overflow: visible;
  z-index: 1001;
}

.theme-toggle .sun-icon,
.theme-toggle .moon-icon {
  position: absolute;
  transition: transform 0.6s cubic-bezier(0.68, -0.55, 0.265, 1.55),
              opacity 0.4s ease;
  pointer-events: none;
}

.theme-toggle .sun-icon {
  transform: translateY(0) rotate(0deg) scale(1);
  opacity: 1;
}

.theme-toggle .moon-icon {
  transform: translateY(30px) rotate(-90deg) scale(0.5);
  opacity: 0;
}

[data-theme="dark"] .theme-toggle .sun-icon {
  transform: translateY(-30px) rotate(180deg) scale(0.5);
  opacity: 0;
}

[data-theme="dark"] .theme-toggle .moon-icon {
  transform: translateY(0) rotate(0deg) scale(1);
  opacity: 1;
}

/* Theme toggle pulse on click */
.theme-toggle.animating {
  animation: togglePulse 0.6s ease-out;
}

@keyframes togglePulse {
  0% { transform: scale(1); }
  30% { transform: scale(1.3); }
  100% { transform: scale(1); }
}

/* =============================================
   THEME TRANSITION OVERLAY (Circular Reveal)
   ============================================= */
.theme-transition-overlay {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  pointer-events: none;
  z-index: 1000;
  overflow: hidden;
}

.theme-transition-overlay.transitioning {
  pointer-events: all;
}

.theme-transition-overlay::before {
  content: '';
  position: absolute;
  left: var(--reveal-x, 50%);
  top: var(--reveal-y, 30px);
  width: 0;
  height: 0;
  border-radius: 50%;
  background: var(--reveal-color, #0f1419);
  transform: translate(-50%, -50%);
  transition: none;
  z-index: 0;
}

.theme-transition-overlay.transitioning::before {
  animation: circularReveal 0.8s cubic-bezier(0.4, 0, 0.2, 1) forwards;
}

@keyframes circularReveal {
  0% {
    width: 0;
    height: 0;
    opacity: 1;
  }
  100% {
    width: 300vmax;
    height: 300vmax;
    opacity: 1;
  }
}

.theme-transition-overlay.collapsing::before {
  animation: circularCollapse 0.6s cubic-bezier(0.4, 0, 0.2, 1) forwards;
}

@keyframes circularCollapse {
  0% {
    width: 300vmax;
    height: 300vmax;
    opacity: 1;
  }
  100% {
    width: 0;
    height: 0;
    opacity: 0;
  }
}

/* Stars Container */
.stars-container {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  overflow: hidden;
  opacity: 0;
  transition: opacity 0.5s ease;
  z-index: 1;
}

.theme-transition-overlay.to-dark .stars-container {
  opacity: 1;
}

.star {
  position: absolute;
  background: white;
  border-radius: 50%;
  animation: starTwinkle 1.5s ease-in-out infinite;
}

.star::after {
  content: '';
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 200%;
  height: 200%;
  background: radial-gradient(circle, rgba(255,255,255,0.3) 0%, transparent 70%);
  border-radius: 50%;
}

@keyframes starTwinkle {
  0%, 100% {
    opacity: 0.3;
    transform: scale(0.8);
  }
  50% {
    opacity: 1;
    transform: scale(1.2);
  }
}

/* Shooting star */
.shooting-star {
  position: absolute;
  width: 100px;
  height: 2px;
  background: linear-gradient(90deg, white 0%, transparent 100%);
  transform: rotate(-45deg);
  animation: shootingStar 1s ease-out forwards;
  opacity: 0;
}

@keyframes shootingStar {
  0% {
    opacity: 0;
    transform: rotate(-45deg) translateX(0);
  }
  10% {
    opacity: 1;
  }
  100% {
    opacity: 0;
    transform: rotate(-45deg) translateX(300px);
  }
}

/* Sunrise animation when switching to light */
.theme-transition-overlay.to-light .stars-container {
  opacity: 1;
}

.sunrise-container {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  overflow: hidden;
  z-index: 10;
}

/* Night sky background that fades to day */
.sunrise-sky {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: linear-gradient(to bottom, #0a1628 0%, #1a237e 30%, #283593 60%, #3949ab 100%);
  animation: skyTransition 2s ease-out forwards;
}

@keyframes skyTransition {
  0% {
    background: linear-gradient(to bottom, #0a1628 0%, #1a237e 30%, #283593 60%, #3949ab 100%);
  }
  30% {
    background: linear-gradient(to bottom, #1a237e 0%, #5c6bc0 20%, #ff8a65 50%, #ffab91 80%, #ffe0b2 100%);
  }
  60% {
    background: linear-gradient(to bottom, #64b5f6 0%, #90caf9 30%, #ffcc80 60%, #ffe0b2 80%, #fff8e1 100%);
  }
  100% {
    background: linear-gradient(to bottom, #87ceeb 0%, #b3e5fc 40%, #fff9c4 70%, #fff9e6 100%);
  }
}

/* Stars that fade out as dawn arrives */
.sunrise-stars {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  animation: starsFadeOut 1.2s ease-out forwards;
}

.sunrise-star {
  position: absolute;
  background: white;
  border-radius: 50%;
  animation: starTwinkle 1s ease-in-out infinite;
}

@keyframes starsFadeOut {
  0% { opacity: 1; }
  60% { opacity: 0.3; }
  100% { opacity: 0; }
}

/* The moon - sets from upper-right to bottom-right */
.sunrise-moon {
  position: absolute;
  top: 15%;
  right: 15%;
  font-size: 3rem;
  animation: moonSet 2s ease-in forwards;
  filter: drop-shadow(0 0 10px rgba(255, 255, 200, 0.8));
}

@keyframes moonSet {
  0% {
    top: 15%;
    right: 15%;
    opacity: 1;
    transform: rotate(0deg);
  }
  60% {
    top: 50%;
    right: 5%;
    opacity: 0.6;
    transform: rotate(-20deg);
  }
  100% {
    top: 90%;
    right: 0%;
    opacity: 0;
    transform: rotate(-30deg);
  }
}

/* The sun - rises from bottom-left (east) to upper-right arc */
.sunrise-sun {
  position: absolute;
  bottom: -40px;
  left: 5%;
  width: 70px;
  height: 70px;
  border-radius: 50%;
  background: radial-gradient(circle, #fff9c4 0%, #ffee58 30%, #ffca28 60%, #ff9800 100%);
  box-shadow:
    0 0 40px 20px rgba(255, 235, 59, 0.6),
    0 0 80px 40px rgba(255, 193, 7, 0.4),
    0 0 120px 60px rgba(255, 152, 0, 0.2);
  animation: sunArc 2s cubic-bezier(0.25, 0.1, 0.25, 1) forwards;
}

@keyframes sunArc {
  0% {
    bottom: -40px;
    left: 5%;
    transform: scale(0.8);
    opacity: 0;
    box-shadow:
      0 0 40px 20px rgba(255, 87, 34, 0.8),
      0 0 80px 40px rgba(255, 87, 34, 0.5),
      0 0 120px 60px rgba(255, 87, 34, 0.3);
  }
  15% {
    opacity: 1;
    box-shadow:
      0 0 40px 20px rgba(255, 138, 101, 0.7),
      0 0 80px 40px rgba(255, 138, 101, 0.4),
      0 0 120px 60px rgba(255, 138, 101, 0.2);
  }
  50% {
    bottom: 35%;
    left: 35%;
    transform: scale(1);
    box-shadow:
      0 0 40px 20px rgba(255, 235, 59, 0.6),
      0 0 80px 40px rgba(255, 193, 7, 0.4),
      0 0 120px 60px rgba(255, 152, 0, 0.2);
  }
  100% {
    bottom: 50%;
    left: 70%;
    transform: scale(1.1);
    opacity: 1;
    box-shadow:
      0 0 50px 25px rgba(255, 235, 59, 0.5),
      0 0 100px 50px rgba(255, 193, 7, 0.3),
      0 0 150px 75px rgba(255, 152, 0, 0.15);
  }
}

/* Horizon glow */
.sunrise-horizon {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  height: 30%;
  background: linear-gradient(to top, rgba(255, 138, 101, 0.4) 0%, transparent 100%);
  animation: horizonGlow 2s ease-out forwards;
}

@keyframes horizonGlow {
  0% {
    opacity: 0;
    background: linear-gradient(to top, rgba(255, 87, 34, 0.6) 0%, transparent 100%);
  }
  30% {
    opacity: 1;
    background: linear-gradient(to top, rgba(255, 138, 101, 0.5) 0%, transparent 100%);
  }
  100% {
    opacity: 0.3;
    background: linear-gradient(to top, rgba(255, 236, 179, 0.3) 0%, transparent 100%);
  }
}

/* Flying birds during sunrise */
.sunrise-birds {
  position: absolute;
  top: 35%;
  left: -5%;
  font-size: 1.2rem;
  opacity: 0;
  animation: birdsFly 2.5s ease-out 0.8s forwards;
}

@keyframes birdsFly {
  0% {
    opacity: 0;
    transform: translate(0, 0) scaleX(1);
  }
  20% {
    opacity: 0.7;
  }
  50% {
    transform: translate(40vw, -15vh) scaleX(1);
  }
  100% {
    opacity: 0;
    transform: translate(100vw, -25vh) scaleX(1);
  }
}

/* Location Detection Modal */
.location-modal {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.6);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  z-index: 1000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
  opacity: 0;
  visibility: hidden;
  transition: all 0.3s ease;
}

.location-modal.active {
  opacity: 1;
  visibility: visible;
}

.location-modal-content {
  background: var(--card-bg);
  border-radius: var(--radius-xl);
  padding: 40px 32px;
  text-align: center;
  max-width: 340px;
  width: 100%;
  transform: scale(0.9) translateY(20px);
  transition: transform 0.3s ease;
  box-shadow: var(--shadow-lg);
}

.location-modal.active .location-modal-content {
  transform: scale(1) translateY(0);
}

.location-modal-icon {
  font-size: 5rem;
  margin-bottom: 20px;
  line-height: 1;
}

.location-modal-title {
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--text-primary);
  margin-bottom: 8px;
}

.location-modal-subtitle {
  font-size: 1rem;
  color: var(--text-secondary);
  margin-bottom: 32px;
}

.location-modal-actions {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.location-modal-btn {
  padding: 16px 24px;
  border-radius: var(--radius-md);
  font-weight: 700;
  font-size: 1.1rem;
  transition: all 0.2s ease;
  width: 100%;
}

.location-modal-btn.yes {
  background: var(--primary-gradient);
  color: white;
  box-shadow: 0 4px 12px rgba(255, 107, 107, 0.3);
}

.location-modal-btn.yes:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 16px rgba(255, 107, 107, 0.4);
}

.location-modal-btn.no {
  background: transparent;
  color: var(--text-secondary);
  border: 2px solid var(--border-color);
}

.location-modal-btn.no:hover {
  background: var(--bg-color);
  color: var(--text-primary);
}

/* Reduced motion */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}

/* =============================================
   SETUP WIZARD MODAL
   ============================================= */
.setup-modal {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  z-index: 2000;
  display: none;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 20px;
}

.setup-modal.active {
  display: flex;
  animation: fadeIn 0.3s ease;
}

.setup-content {
  background: var(--card-bg);
  border-radius: var(--radius-xl);
  padding: 24px;
  width: 100%;
  max-width: 380px;
  box-shadow: var(--shadow-lg);
}

.setup-header {
  text-align: center;
  margin-bottom: 24px;
}

.bob-mascot {
  font-size: 4rem;
  margin-bottom: 8px;
  animation: bobBounce 2s ease-in-out infinite;
}

@keyframes bobBounce {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-10px); }
}

.setup-header h2 {
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--text-primary);
  margin-bottom: 4px;
}

.setup-header p {
  color: var(--text-secondary);
  font-size: 0.95rem;
}

.setup-step {
  margin-bottom: 16px;
}

.setup-step label {
  display: block;
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--text-primary);
  margin-bottom: 8px;
}

.setup-step .optional {
  font-weight: 400;
  color: var(--text-muted);
}

.setup-currency-btn,
.setup-dest-btn {
  width: 100%;
  padding: 14px 16px;
  display: flex;
  align-items: center;
  gap: 12px;
  background: var(--bg-color);
  border: 2px solid var(--border-color);
  border-radius: var(--radius-md);
  transition: all 0.2s ease;
}

.setup-currency-btn:active,
.setup-dest-btn:active {
  border-color: var(--primary-color);
  transform: scale(0.98);
}

.setup-currency-btn .flag,
.setup-dest-btn .flag {
  font-size: 1.5rem;
}

.setup-currency-btn .code {
  font-weight: 700;
  font-size: 1.1rem;
  color: var(--text-primary);
}

.setup-currency-btn .name,
.setup-dest-btn .name {
  flex: 1;
  text-align: left;
  color: var(--text-secondary);
  font-size: 0.9rem;
}

.setup-currency-btn .chevron,
.setup-dest-btn .chevron {
  width: 20px;
  height: 20px;
  color: var(--text-muted);
}

.setup-actions {
  display: flex;
  gap: 12px;
  margin-top: 24px;
}

.setup-btn {
  flex: 1;
  padding: 14px 20px;
  border-radius: var(--radius-md);
  font-weight: 600;
  font-size: 1rem;
  transition: all 0.2s ease;
}

.setup-btn.primary {
  background: linear-gradient(135deg, #f6d365 0%, #fda085 100%);
  color: #744210;
  box-shadow: var(--shadow-md);
}

.setup-btn.primary:active {
  transform: scale(0.98);
}

.setup-btn.secondary {
  background: transparent;
  color: var(--text-secondary);
  border: 1px solid var(--border-color);
}

/* App Footer */
.app-footer {
  padding: 20px 16px;
  padding-bottom: calc(20px + var(--safe-bottom));
  text-align: center;
  margin-top: 20px;
}

.footer-content {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
}

.footer-love {
  font-size: 13px;
  color: var(--text-muted);
  opacity: 0.8;
}

.activity-text {
  display: inline-block;
  font-weight: 600;
  color: var(--primary-color);
  transition: opacity 0.4s ease, transform 0.4s ease;
}

.activity-text.fade-out {
  opacity: 0;
  transform: translateY(-8px);
}

.activity-text.fade-in {
  animation: activityFadeIn 0.4s ease forwards;
}

@keyframes activityFadeIn {
  0% {
    opacity: 0;
    transform: translateY(8px);
  }
  100% {
    opacity: 1;
    transform: translateY(0);
  }
}

.footer-meta {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 11px;
  color: var(--text-muted);
  opacity: 0.6;
}

.footer-rates {
  display: flex;
  align-items: center;
  gap: 4px;
}

.footer-rates .status-indicator {
  width: 6px;
  height: 6px;
}

.footer-divider {
  opacity: 0.5;
}

.footer-version {
  font-family: monospace;
}

/* Flag Icons sizing */
.fi {
  border-radius: 2px;
  box-shadow: 0 1px 2px rgba(0,0,0,0.1);
}

.fi-sm {
  font-size: 1rem;
}

.fi-lg {
  font-size: 1.5rem;
}

.price-flag .fi,
.dest-flag .fi,
.destination-flag .fi,
.banner-flag .fi {
  font-size: 1.5rem;
}

.home-flag .fi {
  font-size: 1rem;
}

.currency-item .flag .fi,
.destination-item .flag .fi,
.wallet-item .flag .fi {
  font-size: 1.5rem;
}

.setting-btn .fi {
  font-size: 1.5rem;
}

.setup-currency-btn .fi,
.setup-dest-btn .fi {
  font-size: 1.5rem;
}

/* Print styles */
@media print {
  .app-header,
  .tab-nav,
  .a2hs-banner,
  .modal,
  .toast,
  .setup-modal,
  .app-footer {
    display: none !important;
  }

  .tab-content {
    display: block !important;
  }

  .app-container {
    max-width: none;
  }
}
