/* ============================================
   TravelPlug — Design System
   ============================================ */
@import url('https://cdn.jsdelivr.net/gh/orioncactus/pretendard@v1.3.9/dist/web/variable/pretendardvariable-dynamic-subset.min.css');

/* ---------- CSS Custom Properties ---------- */
:root {
  /* Core palette */
  --bg-base: #0f172a;
  --bg-surface: #1e293b;
  --bg-surface-hover: #334155;
  --bg-elevated: rgba(30, 41, 59, 0.85);
  --bg-glass: rgba(15, 23, 42, 0.92);

  --text-primary: #f1f5f9;
  --text-secondary: #94a3b8;
  --text-muted: #64748b;
  --text-accent: #60a5fa;

  --border-default: rgba(148, 163, 184, 0.12);
  --border-focus: #3b82f6;

  /* Accent */
  --accent: #3b82f6;
  --accent-soft: rgba(59, 130, 246, 0.15);
  --accent-glow: rgba(59, 130, 246, 0.3);

  /* Status */
  --status-ok-bg: rgba(16, 185, 129, 0.12);
  --status-ok-border: rgba(16, 185, 129, 0.25);
  --status-ok-text: #34d399;
  --status-ok-icon: #10b981;

  --status-warn-bg: rgba(245, 158, 11, 0.12);
  --status-warn-border: rgba(245, 158, 11, 0.25);
  --status-warn-text: #fbbf24;
  --status-warn-icon: #f59e0b;

  --status-danger-bg: rgba(239, 68, 68, 0.12);
  --status-danger-border: rgba(239, 68, 68, 0.25);
  --status-danger-text: #f87171;
  --status-danger-icon: #ef4444;

  /* Plug visuals */
  --plug-outline: #475569;
  --plug-pin: #94a3b8;
  --plug-accent: #64748b;

  /* Layout */
  --max-width: 480px;
  --radius-sm: 10px;
  --radius-md: 16px;
  --radius-lg: 24px;
  --radius-full: 9999px;

  /* Shadows */
  --shadow-sm: 0 1px 3px rgba(0, 0, 0, 0.3);
  --shadow-md: 0 4px 12px rgba(0, 0, 0, 0.4);
  --shadow-lg: 0 8px 30px rgba(0, 0, 0, 0.5);
  --shadow-glow: 0 0 20px var(--accent-glow);
}

/* ---------- Reset & Base ---------- */
*,
*::before,
*::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  scroll-behavior: smooth;
  -webkit-text-size-adjust: 100%;
}

body {
  font-family: 'Pretendard Variable', 'Pretendard', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  background: var(--bg-base);
  color: var(--text-primary);
  min-height: 100vh;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  padding-bottom: 80px;
}

/* ---------- Layout ---------- */
.container {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 0 16px;
}

/* ---------- Header ---------- */
.app-header {
  position: sticky;
  top: 0;
  z-index: 100;
  background: var(--bg-glass);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border-bottom: 1px solid var(--border-default);
  padding: 16px 0;
}

.header-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 16px;
}

.app-logo {
  display: flex;
  align-items: center;
  gap: 8px;
  text-decoration: none;
}

.logo-icon {
  width: 36px;
  height: 36px;
  background: linear-gradient(135deg, #3b82f6, #8b5cf6);
  border-radius: var(--radius-sm);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 18px;
  color: white;
  box-shadow: var(--shadow-glow);
}

.logo-text {
  font-size: 22px;
  font-weight: 800;
  background: linear-gradient(135deg, #60a5fa, #a78bfa);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  letter-spacing: -0.5px;
}

.lang-toggle {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 6px 14px;
  background: var(--bg-surface);
  border: 1px solid var(--border-default);
  border-radius: var(--radius-full);
  color: var(--text-secondary);
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s;
}

.lang-toggle:hover {
  background: var(--bg-surface-hover);
  color: var(--text-primary);
  border-color: var(--accent);
}

.lang-toggle .globe-icon {
  font-size: 14px;
}

/* ---------- Search Inputs ---------- */
.search-area {
  display: flex;
  flex-direction: column;
  gap: 8px;
  position: relative;
}

.search-field {
  position: relative;
}

.search-label {
  position: absolute;
  left: 12px;
  top: 50%;
  transform: translateY(-50%);
  font-size: 10px;
  font-weight: 700;
  padding: 2px 6px;
  border-radius: 4px;
  z-index: 2;
  letter-spacing: 0.5px;
  pointer-events: none;
}

.search-label.from {
  color: #60a5fa;
  background: rgba(59, 130, 246, 0.15);
}

.search-label.to {
  color: #fb923c;
  background: rgba(251, 146, 60, 0.15);
}

.search-input {
  width: 100%;
  padding: 14px 16px 14px 56px;
  background: var(--bg-surface);
  border: 1.5px solid var(--border-default);
  border-radius: var(--radius-md);
  color: var(--text-primary);
  font-size: 14px;
  font-family: inherit;
  transition: all 0.2s;
  outline: none;
}

.search-input::placeholder {
  color: var(--text-muted);
}

.search-input:focus {
  background: var(--bg-surface-hover);
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-soft);
}

/* Swap button */
.swap-btn {
  position: absolute;
  right: 16px;
  top: 50%;
  transform: translateY(-50%);
  z-index: 10;
  width: 36px;
  height: 36px;
  background: var(--bg-surface);
  border: 1.5px solid var(--border-default);
  border-radius: 50%;
  color: var(--text-accent);
  font-size: 14px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.3s;
  box-shadow: var(--shadow-sm);
}

.swap-btn:hover {
  background: var(--accent-soft);
  border-color: var(--accent);
  box-shadow: var(--shadow-glow);
}

.swap-btn:active {
  transform: translateY(-50%) rotate(180deg);
}

/* Dropdown */
.search-dropdown {
  position: absolute;
  left: 0;
  right: 0;
  top: calc(100% + 4px);
  background: var(--bg-surface);
  border: 1px solid var(--border-default);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-lg);
  z-index: 50;
  max-height: 240px;
  overflow-y: auto;
  display: none;
}

.search-dropdown.show {
  display: block;
  animation: dropdownIn 0.2s ease-out;
}

.dropdown-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 16px;
  cursor: pointer;
  transition: background 0.15s;
  border-bottom: 1px solid var(--border-default);
}

.dropdown-item:last-child {
  border-bottom: none;
}

.dropdown-item:hover {
  background: var(--bg-surface-hover);
}

.dropdown-item-left {
  display: flex;
  align-items: center;
  gap: 12px;
}

.dropdown-flag {
  font-size: 11px;
  font-weight: 700;
  color: var(--text-accent);
  background: var(--accent-soft);
  padding: 4px 6px;
  border-radius: 4px;
  letter-spacing: 0.5px;
  letter-spacing: 0.5px;
  min-width: 28px;
  text-align: center;
  line-height: 1;
}

.dropdown-name {
  font-size: 14px;
  font-weight: 600;
  color: var(--text-primary);
}

.dropdown-types {
  font-size: 10px;
  color: var(--text-muted);
  font-weight: 500;
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.3px;
}

.dropdown-arrow {
  color: var(--text-muted);
  font-size: 10px;
}

/* Scrollbar for dropdown */
.search-dropdown::-webkit-scrollbar {
  width: 4px;
}

.search-dropdown::-webkit-scrollbar-track {
  background: transparent;
}

.search-dropdown::-webkit-scrollbar-thumb {
  background: var(--bg-surface-hover);
  border-radius: 4px;
}

/* ---------- Quick Select ---------- */
.quick-section {
  margin-top: 24px;
  margin-bottom: 24px;
}

.section-title {
  font-size: 11px;
  font-weight: 700;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 1px;
  margin-bottom: 12px;
  padding-left: 4px;
}

.quick-scroll {
  display: flex;
  gap: 8px;
  overflow-x: auto;
  padding-bottom: 8px;
  padding-right: 32px;
  -ms-overflow-style: none;
  scrollbar-width: none;
  mask-image: linear-gradient(to right, #000 90%, transparent 100%);
  -webkit-mask-image: linear-gradient(to right, #000 90%, transparent 100%);
}

.quick-scroll::-webkit-scrollbar {
  display: none;
}

.quick-btn {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 7px 14px;
  background: var(--bg-surface);
  border: 1px solid var(--border-default);
  border-radius: var(--radius-full);
  color: var(--text-secondary);
  font-size: 12px;
  font-weight: 500;
  font-family: inherit;
  white-space: nowrap;
  cursor: pointer;
  transition: all 0.2s;
}

.quick-btn:hover {
  background: var(--accent-soft);
  border-color: var(--accent);
  color: var(--text-accent);
}

.quick-btn-icon {
  font-size: 13px;
  opacity: 0.7;
}

/* ---------- Comparison Card ---------- */
.comparison-section {
  display: none;
}

.comparison-section.show {
  display: block;
  animation: fadeSlideUp 0.4s ease-out;
}

.comparison-card {
  background: var(--bg-surface);
  border-radius: var(--radius-lg);
  padding: 28px 24px;
  border: 1px solid var(--border-default);
  margin-bottom: 20px;
}

.countries-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 28px;
}

.country-display {
  text-align: center;
  flex: 1;
}

.country-flag {
  font-size: 20px;
  font-weight: 800;
  letter-spacing: 1px;
  color: var(--text-accent);
  line-height: 1;
  margin-bottom: 8px;
  margin-bottom: 8px;
}

.country-name {
  font-size: 14px;
  font-weight: 700;
  color: var(--text-primary);
  margin-bottom: 4px;
}

.country-types {
  font-size: 10px;
  color: var(--text-muted);
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  letter-spacing: 0.5px;
}

.arrow-divider {
  color: var(--text-muted);
  font-size: 16px;
  opacity: 0.4;
  padding: 0 8px;
}

/* Plug visuals grid */
.plugs-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
}

.plug-visual-box {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  background: var(--bg-base);
  border-radius: var(--radius-md);
  padding: 20px 16px;
  border: 1px solid var(--border-default);
  aspect-ratio: 1;
  gap: 8px;
}

.plug-svg {
  width: 64px;
  height: 64px;
}

.plug-type-label {
  font-size: 11px;
  font-weight: 600;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

/* ---------- Verdict Card ---------- */
.verdict-card {
  border-radius: var(--radius-lg);
  padding: 20px;
  margin-bottom: 20px;
  display: flex;
  align-items: flex-start;
  gap: 16px;
  animation: fadeSlideUp 0.4s ease-out 0.1s both;
}

.verdict-card.ok {
  background: var(--status-ok-bg);
  border: 1px solid var(--status-ok-border);
}

.verdict-card.warn {
  background: var(--status-warn-bg);
  border: 1px solid var(--status-warn-border);
}

.verdict-card.danger {
  background: var(--status-danger-bg);
  border: 1px solid var(--status-danger-border);
}

.verdict-icon {
  font-size: 28px;
  flex-shrink: 0;
  margin-top: 2px;
}

.verdict-title {
  font-size: 17px;
  font-weight: 700;
  margin-bottom: 4px;
}

.verdict-card.ok .verdict-title {
  color: var(--status-ok-text);
}

.verdict-card.warn .verdict-title {
  color: var(--status-warn-text);
}

.verdict-card.danger .verdict-title {
  color: var(--status-danger-text);
}

.verdict-desc {
  font-size: 13px;
  color: var(--text-secondary);
  line-height: 1.6;
}

/* ---------- Stats Grid ---------- */
.stats-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
  margin-bottom: 20px;
  animation: fadeSlideUp 0.4s ease-out 0.15s both;
}

.stat-card {
  background: var(--bg-surface);
  padding: 16px;
  border-radius: var(--radius-md);
  border: 1px solid var(--border-default);
}

.stat-label {
  font-size: 10px;
  font-weight: 700;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.5px;
  margin-bottom: 6px;
}

.stat-value {
  font-size: 22px;
  font-weight: 700;
  color: var(--text-primary);
}

.stat-tip {
  font-size: 10px;
  font-weight: 600;
  margin-top: 4px;
}

.stat-tip.safe {
  color: var(--status-ok-text);
}

.stat-tip.warning {
  color: var(--status-danger-text);
}

/* ---------- Checklist ---------- */
.checklist-card {
  background: linear-gradient(135deg, #1e293b, #0f172a);
  border-radius: var(--radius-lg);
  padding: 24px;
  border: 1px solid var(--border-default);
  position: relative;
  overflow: hidden;
  animation: fadeSlideUp 0.4s ease-out 0.2s both;
}

.checklist-bg-icon {
  position: absolute;
  top: 16px;
  right: 16px;
  font-size: 64px;
  opacity: 0.05;
  pointer-events: none;
}

.checklist-title {
  font-size: 17px;
  font-weight: 700;
  margin-bottom: 20px;
  display: flex;
  align-items: center;
  gap: 8px;
  color: var(--text-primary);
}

.checklist-title-icon {
  color: var(--text-accent);
}

.checklist-list {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 16px;
  position: relative;
  z-index: 1;
}

.checklist-item {
  display: flex;
  align-items: flex-start;
  gap: 14px;
}

.checklist-item-icon {
  width: 36px;
  height: 36px;
  background: rgba(30, 41, 59, 0.8);
  border-radius: var(--radius-sm);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-accent);
  font-size: 14px;
  flex-shrink: 0;
  transition: all 0.2s;
}

.checklist-item:hover .checklist-item-icon {
  background: var(--accent);
  color: white;
}

.checklist-item-text {
  font-size: 13px;
  font-weight: 600;
  color: var(--text-primary);
}

.checklist-item-sub {
  font-size: 11px;
  color: var(--text-muted);
  margin-top: 2px;
}

/* ---------- Welcome State ---------- */
.welcome-state {
  text-align: center;
  padding: 64px 20px;
}

.welcome-state.hidden {
  display: none;
}

.welcome-icon-wrap {
  position: relative;
  display: inline-block;
  margin-bottom: 24px;
}

.welcome-icon {
  opacity: 0.7;
}

.welcome-bolt {
  position: absolute;
  top: -4px;
  right: -8px;
  animation: welcomeBounce 2s ease-in-out infinite;
  opacity: 0.9;
}

.welcome-title {
  font-size: 20px;
  font-weight: 700;
  color: var(--text-primary);
  margin-bottom: 8px;
}

.welcome-desc {
  font-size: 14px;
  color: var(--text-muted);
  max-width: 260px;
  margin: 0 auto;
  line-height: 1.6;
}

/* ---------- Footer ---------- */
.app-footer {
  text-align: center;
  padding: 32px 16px 24px;
  margin-top: 40px;
}

.footer-text {
  font-size: 11px;
  color: var(--text-muted);
  margin-bottom: 8px;
}

.footer-copyright {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  font-size: 11px;
  color: var(--text-muted);
  opacity: 0.8;
}

.footer-divider {
  opacity: 0.5;
  font-size: 10px;
}

.footer-email {
  display: flex;
  align-items: center;
  gap: 4px;
  color: var(--text-muted);
  text-decoration: none;
  transition: color 0.2s;
}

.footer-email:hover {
  color: var(--text-accent);
}

/* ---------- Animations ---------- */
@keyframes fadeSlideUp {
  from {
    opacity: 0;
    transform: translateY(12px);
  }

  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes dropdownIn {
  from {
    opacity: 0;
    transform: translateY(-4px);
  }

  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes welcomeBounce {

  0%,
  100% {
    transform: translateY(0);
  }

  50% {
    transform: translateY(-6px);
  }
}

/* ---------- Utility ---------- */
.hidden {
  display: none !important;
}

/* ---------- Responsive ---------- */
@media (max-width: 480px) {
  .container {
    padding: 0 12px;
  }

  .comparison-card {
    padding: 20px 16px;
  }

  .country-flag {
    font-size: 36px;
  }

  .plug-svg {
    width: 52px;
    height: 52px;
  }
}