/* CSS Variables for Theme */
:root {
  --primary-500: #3b82f6;
  --primary-600: #2563eb;
  --primary-700: #1d4ed8;
  --primary-400: #60a5fa;
  --gray-50: #f9fafb;
  --gray-100: #f3f4f6;
  --gray-200: #e5e7eb;
  --gray-300: #d1d5db;
  --gray-400: #9ca3af;
  --gray-500: #6b7280;
  --gray-600: #4b5563;
  --gray-700: #374151;
  --gray-800: #1f2937;
  --gray-900: #111827;
  --white: #ffffff;
  --black: #000000;
  --green-500: #10b981;
  --green-600: #059669;
  --green-700: #047857;
  --green-800: #065f46;
  --green-900: #064e3b;
  --red-500: #ef4444;
  --red-400: #f87171;
}

.dark {
  --bg-primary: var(--gray-900);
  --bg-secondary: var(--gray-800);
  --bg-tertiary: var(--gray-850);
  --text-primary: var(--white);
  --text-secondary: var(--gray-300);
  --text-tertiary: var(--gray-400);
  --border-color: var(--gray-700);
}

:root:not(.dark) {
  --bg-primary: var(--white);
  --bg-secondary: var(--gray-50);
  --bg-tertiary: var(--gray-100);
  --text-primary: var(--black);
  --text-secondary: var(--gray-700);
  --text-tertiary: var(--gray-500);
  --border-color: var(--gray-200);
}

/* Reset and Base Styles */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
  /* Prevent white flash by setting default background */
  background-color: #ffffff;
}

html.dark {
  background-color: #111827;
}

body {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
  background-color: var(--bg-primary);
  color: var(--text-primary);
  min-height: 100vh;
  transition: background-color 0.3s ease, color 0.3s ease;
  /* Prevent white flash by setting default background */
  background-color: #ffffff;
}

.dark body {
  background-color: #111827;
}

/* Header */
header {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 50;
  background-color: rgba(255, 255, 255, 0.8);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  height: 72px;
  min-height: 72px;
  border-bottom: 1px solid var(--border-color);
}

.dark header {
  background-color: rgba(17, 24, 39, 0.8);
}

.header-container {
  max-width: 1280px;
  margin: 0 auto;
  padding: 0 1rem;
  height: 100%;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.logo {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  flex-shrink: 0;
  text-decoration: none;
  color: var(--text-primary);
}

.logo svg {
  width: 20px;
  height: 20px;
  color: var(--primary-500);
}

.logo span {
  font-weight: bold;
  font-size: 1.125rem;
  white-space: nowrap;
}

nav {
  display: none;
  align-items: center;
  gap: 1.5rem;
  flex-grow: 1;
  justify-content: center;
}

nav a {
  color: var(--text-primary);
  text-decoration: none;
  font-size: 1rem;
  white-space: nowrap;
  transition: color 0.3s;
  padding: 0.25rem 0;
}

nav a:hover {
  color: var(--primary-500);
}

.dark nav a:hover {
  color: var(--primary-400);
}

.more-menu {
  position: relative;
}

.more-menu-group {
  position: relative;
}

.more-menu button {
  background: none;
  border: none;
  color: var(--text-primary);
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 0.25rem;
  font-size: 1rem;
  white-space: nowrap;
  transition: color 0.3s;
  padding: 0.25rem 0;
}

.more-menu button:hover {
  color: var(--primary-500);
}

.dark .more-menu button:hover {
  color: var(--primary-400);
}

.more-menu svg {
  width: 16px;
  height: 16px;
  margin-left: 0.25rem;
  transition: transform 0.2s;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.more-menu-group:hover svg {
  transform: rotate(180deg);
}

.dropdown-menu {
  position: absolute;
  top: 100%;
  left: 0;
  margin-top: 0.5rem;
  width: 192px;
  background-color: var(--bg-primary);
  border: 1px solid var(--border-color);
  border-radius: 0.5rem;
  box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.1);
  opacity: 0;
  visibility: hidden;
  transition: all 0.2s;
  z-index: 50;
}

.more-menu-group:hover .dropdown-menu {
  opacity: 1;
  visibility: visible;
}

.dropdown-menu a {
  display: block;
  padding: 0.75rem 1rem;
  color: var(--text-primary);
  text-decoration: none;
  transition: background-color 0.2s, color 0.2s;
}

.dropdown-menu a:first-child {
  border-top-left-radius: 0.5rem;
  border-top-right-radius: 0.5rem;
}

.dropdown-menu a:last-child {
  border-bottom-left-radius: 0.5rem;
  border-bottom-right-radius: 0.5rem;
}

.dropdown-menu a:hover {
  background-color: var(--bg-secondary);
  color: var(--primary-500);
}

.dark .dropdown-menu a:hover {
  color: var(--primary-400);
}

.header-actions {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  flex-shrink: 0;
}

/* Language Switcher */
.language-switcher {
  position: relative;
}

.language-switcher-btn {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.5rem 0.75rem;
  background: none;
  border: 1px solid var(--border-color);
  border-radius: 0.5rem;
  color: var(--text-primary);
  cursor: pointer;
  font-size: 0.875rem;
  transition: all 0.2s;
}

.language-switcher-btn:hover {
  background-color: var(--bg-secondary);
  border-color: var(--primary-500);
}

.language-switcher-btn svg {
  width: 16px;
  height: 16px;
  transition: transform 0.2s;
}

.language-switcher-btn:focus {
  outline: none;
  border-color: var(--primary-500);
}

.language-dropdown {
  position: absolute;
  top: calc(100% + 0.5rem);
  right: 0;
  min-width: 180px;
  background-color: var(--bg-primary);
  border: 1px solid var(--border-color);
  border-radius: 0.5rem;
  box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.1);
  opacity: 0;
  visibility: hidden;
  transform: translateY(-10px);
  transition: all 0.2s;
  z-index: 100;
  overflow: hidden;
}

.language-dropdown.active {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
}

.language-option {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.75rem 1rem;
  color: var(--text-primary);
  text-decoration: none;
  transition: background-color 0.2s, color 0.2s;
  cursor: pointer;
}

.language-option:hover {
  background-color: var(--bg-secondary);
  color: var(--primary-500);
}

.language-option.active {
  background-color: var(--bg-secondary);
  color: var(--primary-500);
  font-weight: 500;
}

.language-flag {
  font-size: 1.25rem;
  line-height: 1;
}

.language-name {
  flex: 1;
}

/* Dark Mode Toggle */
.theme-toggle {
  position: relative;
  display: inline-flex;
  height: 28px;
  width: 56px;
  align-items: center;
  border-radius: 9999px;
  background-color: var(--gray-200);
  transition: background-color 0.3s;
  cursor: pointer;
  border: none;
}

.dark .theme-toggle {
  background-color: var(--primary-600);
}

.theme-toggle-slider {
  position: absolute;
  left: 4px;
  top: 50%;
  transform: translateY(-50%);
  height: 20px;
  width: 20px;
  border-radius: 50%;
  background-color: var(--white);
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
  transition: transform 0.3s;
}

.dark .theme-toggle-slider {
  transform: translateY(-50%) translateX(28px);
}

.theme-icon {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  width: 16px;
  height: 16px;
  z-index: 10;
}

.theme-icon.sun {
  left: 4px;
  color: #f59e0b;
  opacity: 1;
}

.dark .theme-icon.sun {
  opacity: 0;
}

.theme-icon.moon {
  right: 6px;
  color: var(--gray-700);
  opacity: 0;
}

.dark .theme-icon.moon {
  opacity: 1;
  color: var(--gray-900);
}

.mobile-menu-btn {
  display: block;
  padding: 0.5rem;
  background: none;
  border: none;
  color: var(--text-primary);
  cursor: pointer;
}

.mobile-menu {
  display: none;
  position: absolute;
  top: 100%;
  left: 0;
  width: 100%;
  background-color: var(--bg-primary);
  padding: 1rem;
  box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
  border-top: 1px solid var(--border-color);
}

.mobile-menu.active {
  display: block;
}

.mobile-menu a {
  display: block;
  padding: 0.75rem 0;
  color: var(--text-primary);
  text-decoration: none;
  transition: color 0.3s;
}

.mobile-menu a:hover {
  color: var(--primary-500);
}

/* Main Content */
main {
  padding-top: 72px;
}

.container {
  max-width: 1280px;
  margin: 0 auto;
  padding: 0 1rem;
}

section {
  padding: 4rem 0;
}

/* Hero Section */
.hero {
  padding: 1rem 0 5rem;
  background-color: var(--bg-primary);
}

.hero-card {
  max-width: 1024px;
  margin: 0 auto;
  background-color: var(--bg-primary);
  border-radius: 1rem;
  box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.1);
  overflow: hidden;
}

.hero-header {
  padding: 1.5rem 2.5rem;
  background-color: var(--bg-secondary);
  border-bottom: 1px solid var(--border-color);
}

.hero-content {
  display: flex;
  flex-direction: column;
  gap: 2rem;
  align-items: center;
}

.hero-text {
  width: 100%;
  flex: 1;
}

.hero-text h1 {
  font-size: 1.25rem;
  font-weight: bold;
  color: var(--text-primary);
  line-height: 1.2;
  margin-bottom: 1rem;
  word-break: break-word;
  overflow-wrap: break-word;
  max-width: 100%;
}

.gradient-text {
  background: linear-gradient(135deg, var(--primary-500), var(--primary-400));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.hero-text p {
  font-size: 0.8125rem;
  color: var(--text-secondary);
  opacity: 0.8;
  margin-bottom: 1rem;
  word-break: break-word;
  overflow-wrap: break-word;
  line-height: 1.5;
  max-width: 100%;
}

.features-list {
  display: flex;
  gap: 1.5rem;
  flex-wrap: wrap;
}

.feature-item {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.feature-item svg {
  width: 20px;
  height: 20px;
  color: var(--primary-500);
}

.feature-item span {
  color: var(--text-secondary);
}

.hero-controls {
  width: 100%;
  flex: 1;
}

.state-select-wrapper {
  margin-bottom: 1rem;
}

.state-select-wrapper label {
  display: block;
  font-size: 0.875rem;
  font-weight: 500;
  color: var(--text-primary);
  margin-bottom: 0.25rem;
}

.state-select {
  width: 100%;
  padding: 0.75rem;
  border: 1px solid var(--border-color);
  border-radius: 0.5rem;
  background-color: var(--bg-primary);
  color: var(--text-primary);
  font-size: 1rem;
  outline: none;
  transition: border-color 0.2s, box-shadow 0.2s;
}

.state-select:focus {
  border-color: var(--primary-500);
  box-shadow: 0 0 0 2px rgba(59, 130, 246, 0.1);
}

/* 可选工具开关样式 */
.optional-tools {
  display: flex;
  gap: 1rem;
  margin-bottom: 1rem;
  padding: 1rem;
  background: var(--bg-secondary);
  border-radius: 0.5rem;
  border: 1px solid var(--border-color);
  overflow: visible;
}

.tool-option {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.75rem;
  background: var(--bg-primary);
  border-radius: 0.375rem;
  position: relative;
  overflow: visible;
}

.tool-label {
  font-size: 0.875rem;
  font-weight: 500;
  color: var(--text-primary);
  cursor: pointer;
  user-select: none;
  flex: 1;
  min-width: 0;
  margin-right: 0.75rem;
  line-height: 1.4;
}

.toggle-switch {
  position: relative;
  display: inline-block;
  width: 44px;
  height: 24px;
  cursor: pointer;
  flex-shrink: 0;
}

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

/* 小屏手机下的可选工具开关自适应优化 */
@media (max-width: 640px) {
  .optional-tools {
    flex-direction: column;
    align-items: stretch;
    gap: 0.75rem;
  }

  .tool-option {
    padding: 0.85rem 0.9rem;
  }

  .tool-label {
    font-size: 0.95rem;
    line-height: 1.4;
  }

  /* 按桌面版等比例缩小的开关尺寸（整体略小，但比例一致） */
  .toggle-switch {
    width: 36px;  /* 44px 的约 0.8 倍 */
    height: 20px; /* 24px 的约 0.8 倍 */
  }

  /* 同样按比例缩小圆点和位移，让闭合/开启刚好贴边 */
  .toggle-slider:before {
    width: 16px;
    height: 16px;
    left: 2px;
    bottom: 2px;
  }

  .toggle-switch input:checked + .toggle-slider:before {
    /* 36 - 2(左) - 16(圆点) - 2(右) ≈ 16px */
    transform: translateX(16px);
  }
}

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

.dark .toggle-slider {
  background-color: var(--gray-600);
}

.toggle-slider:before {
  position: absolute;
  content: "";
  height: 18px;
  width: 18px;
  left: 3px;
  bottom: 3px;
  background-color: white;
  transition: 0.3s;
  border-radius: 50%;
}

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

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

.toggle-switch input:focus + .toggle-slider {
  box-shadow: 0 0 0 2px rgba(59, 130, 246, 0.2);
}

.generate-btn {
  width: 100%;
  padding: 1rem 1.5rem;
  background-color: var(--primary-600);
  color: white;
  border: none;
  border-radius: 0.5rem;
  font-weight: 500;
  font-size: 1rem;
  cursor: pointer;
  transition: background-color 0.3s;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
}

.generate-btn:hover {
  background-color: var(--primary-700);
}

.generate-btn:disabled {
  background-color: var(--gray-500);
  cursor: not-allowed;
  opacity: 0.7;
}

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

/* Results Section */
.results-section {
  padding: 1.5rem 2.5rem;
  background-color: var(--bg-primary);
}

.results-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 1rem;
}

.results-header h2,
.results-header h3 {
  font-size: 1.5rem;
  font-weight: bold;
  color: var(--text-primary);
}

.results-actions {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.btn {
  padding: 0.5rem 1rem;
  border-radius: 0.5rem;
  font-weight: 600;
  font-size: 0.875rem;
  cursor: pointer;
  transition: all 0.3s;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  border: none;
}

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

.btn-primary:hover {
  background-color: var(--primary-700);
}

.btn-green {
  background-color: var(--green-800);
  color: white;
}

.btn-green:hover {
  background-color: var(--green-900);
}

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

.address-result {
  background-color: var(--bg-secondary);
  border-radius: 0.5rem;
  padding: 0.75rem;
  min-height: 200px;
}

.address-result.empty {
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-tertiary);
}

.address-list {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.address-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.75rem;
}

.address-row-full {
  grid-template-columns: 1fr;
}

/* Fila combinada: Código postal + SMS temporal (escritorio: izquierda/derecha, móvil: SMS encima del código postal) */
.address-row-zip-sms {
  display: flex;
  gap: 0.75rem;
}

.address-row-zip-sms .address-card {
  flex: 1 1 0;
}

.address-card {
  background-color: var(--bg-primary);
  padding: 0.75rem;
  border-radius: 0.5rem;
  border: 1px solid var(--border-color);
  transition: all 0.2s;
}

.address-card:hover {
  border-color: var(--primary-500);
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}

.address-card .flex {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.address-card label {
  font-size: 0.875rem;
  font-weight: 500;
  color: var(--text-tertiary);
}

.address-card .text-base {
  font-size: 1rem;
  font-weight: 600;
  color: var(--text-primary);
}

.copy-status {
  display: flex;
  align-items: center;
  transition: color 0.2s;
}

.copy-status svg {
  width: 16px;
  height: 16px;
}

.address-card:hover .copy-status svg {
  color: var(--primary-500);
}

/* Saved Addresses Section */
.saved-section {
  max-width: 1024px;
  margin: 2rem auto 0;
  background-color: var(--bg-primary);
  border-radius: 1rem;
  box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.1);
  padding: 1.5rem 2.5rem;
}

.saved-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 1.5rem;
}

.saved-header h2,
.saved-header h3 {
  font-size: 1.5rem;
  font-weight: bold;
  color: var(--text-primary);
}

.export-menu-wrapper {
  position: relative;
}

.export-menu {
  position: absolute;
  right: 0;
  top: 100%;
  margin-top: 0.5rem;
  width: 160px;
  background-color: var(--bg-primary);
  border: 1px solid var(--border-color);
  border-radius: 0.5rem;
  box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.1);
  display: none;
  z-index: 10;
}

.export-menu.active {
  display: block;
}

.export-menu button {
  width: 100%;
  text-align: left;
  padding: 0.5rem 1rem;
  font-size: 0.875rem;
  color: var(--text-secondary);
  background: none;
  border: none;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 0.5rem;
  transition: background-color 0.2s;
}

.export-menu button:hover {
  background-color: var(--bg-secondary);
}

.address-table {
  width: 100%;
  background-color: var(--bg-primary);
  border-radius: 0.75rem;
  overflow: hidden;
}

.table-header {
  padding: 0.75rem 1.5rem;
  background-color: var(--bg-secondary);
}

.table-header-row {
  display: flex;
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--text-tertiary);
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.table-header-row > div {
  padding: 0.5rem;
}

.table-body {
  border-top: 1px solid var(--border-color);
}

.table-row {
  padding: 1rem 1.5rem;
  border-bottom: 1px solid var(--border-color);
  display: flex;
  align-items: center;
  transition: background-color 0.2s;
}

.table-row:hover {
  background-color: var(--bg-secondary);
}

.table-cell {
  font-size: 0.875rem;
  color: var(--text-secondary);
  padding: 0.5rem;
}

.table-actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 0.5rem;
}

.table-actions button {
  background: none;
  border: none;
  color: var(--gray-400);
  cursor: pointer;
  padding: 0.25rem;
  transition: color 0.2s;
}

.table-actions button:hover {
  color: var(--primary-500);
}

.table-actions button.delete:hover {
  color: var(--red-500);
}

.empty-state {
  padding: 2rem;
  text-align: center;
  color: var(--text-tertiary);
}

/* Modal */
.modal-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background-color: rgba(0, 0, 0, 0.5);
  z-index: 100;
  backdrop-filter: blur(4px);
}

.modal-overlay.active {
  display: block;
}

.modal {
  display: none;
  position: fixed;
  inset: 0;
  z-index: 101;
  align-items: center;
  justify-content: center;
  pointer-events: none;
}

.modal.active {
  display: flex;
  pointer-events: auto;
}

.modal.active {
  display: flex;
}

.modal-content {
  width: 100%;
  max-width: 520px;
  background-color: var(--bg-primary);
  border-radius: 1rem;
  box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.1);
  border: 1px solid var(--border-color);
  margin: 1.5rem;
  pointer-events: auto;
  max-height: 90vh;
  overflow-y: auto;
}

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

.modal-header h3 {
  font-size: 1rem;
  font-weight: 600;
  color: var(--text-primary);
}

.modal-close {
  padding: 0.75rem;
  background-color: var(--bg-secondary);
  border: 2px solid var(--border-color);
  color: var(--text-primary);
  cursor: pointer;
  border-radius: 0.5rem;
  transition: all 0.2s;
  display: flex;
  align-items: center;
  justify-content: center;
  min-width: 44px;
  min-height: 44px;
  font-size: 1.5rem;
  font-weight: bold;
  line-height: 1;
}

.modal-close:hover {
  background-color: var(--red-500);
  color: white;
  border-color: var(--red-500);
  transform: scale(1.05);
}

.modal-close:active {
  transform: scale(0.95);
}

.modal-close svg {
  width: 24px;
  height: 24px;
  flex-shrink: 0;
}

/* If using text × symbol */
.modal-close:not(:has(svg)) {
  font-size: 1.75rem;
  padding: 0.5rem 0.875rem;
}

.modal-body {
  padding: 1rem;
}

.modal-body label {
  display: block;
  font-size: 0.875rem;
  color: var(--text-tertiary);
  margin-bottom: 0.5rem;
}

.modal-body textarea,
.modal-body input {
  width: 100%;
  font-size: 0.875rem;
  background-color: var(--bg-secondary);
  border: 1px solid var(--border-color);
  border-radius: 0.5rem;
  padding: 0.75rem;
  color: var(--text-primary);
  resize: none;
}

.modal-body textarea {
  height: 160px;
  overflow-y: auto;
}

.modal-footer {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  padding: 0.5rem 1rem 1rem;
}

/* Responsive */
@media (min-width: 768px) {
  nav {
    display: flex;
  }

  .mobile-menu-btn {
    display: none;
  }

  .hero-content {
    flex-direction: row;
  }

  .hero-text h1 {
    font-size: 1.75rem;
  }

  .results-header h2,
  .results-header h3,
  .saved-header h2,
  .saved-header h3 {
    font-size: 1.875rem;
  }

  .modal {
    align-items: flex-start;
  }

  .modal-content {
    margin-top: 5rem;
  }
}

@media (min-width: 1024px) {
  .hero-text h1 {
    font-size: 1.875rem;
  }
}

/* Utility Classes */
.hidden {
  display: none !important;
}

@media (min-width: 768px) {
  .hidden.md\:flex {
    display: flex !important;
  }
  
  .hidden.md\:block {
    display: block !important;
  }
}

.text-center {
  text-align: center;
}

.mt-2 {
  margin-top: 0.5rem;
}

.mb-4 {
  margin-bottom: 1rem;
}

/* Footer Styles */
.site-footer {
  background-color: var(--gray-900);
  color: var(--white);
  padding: 3rem 0 1.5rem;
  margin-top: 4rem;
}

.footer-container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 1.5rem;
}

.footer-content {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 2rem;
  margin-bottom: 2rem;
}

.footer-section h3 {
  font-size: 1rem;
  font-weight: 600;
  margin-bottom: 1rem;
  color: var(--white);
}

.footer-logo {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  margin-bottom: 1rem;
}

.footer-logo svg {
  width: 24px;
  height: 24px;
  color: var(--primary-500);
}

.footer-logo span {
  font-size: 1.25rem;
  font-weight: bold;
  color: var(--white);
}

.footer-description {
  font-size: 0.875rem;
  color: rgba(255, 255, 255, 0.7);
  line-height: 1.6;
  max-width: 300px;
}

.footer-section ul {
  list-style: none;
  padding: 0;
  margin: 0;
}

.footer-section ul li {
  margin-bottom: 0.5rem;
}

.footer-section ul li a {
  color: rgba(255, 255, 255, 0.7);
  text-decoration: none;
  font-size: 0.875rem;
  transition: color 0.2s;
}

.footer-section ul li a:hover {
  color: var(--primary-400);
}

.footer-bottom {
  border-top: 1px solid rgba(255, 255, 255, 0.1);
  padding-top: 1.5rem;
  text-align: center;
}

.footer-bottom p {
  color: rgba(255, 255, 255, 0.7);
  font-size: 0.875rem;
  margin: 0;
}

/* Friendship Links Styles */
#friendship-links {
  background-color: var(--gray-800);
  padding: 2rem 0;
  border-top: 1px solid rgba(255, 255, 255, 0.1);
  margin-top: 0;
}

.friendship-links-container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 1rem;
}

.friendship-links-title {
  font-size: 1rem;
  font-weight: 600;
  color: var(--white);
  margin-bottom: 1rem;
  text-align: center;
}

.friendship-links-list {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 1rem;
  align-items: center;
}

.friendship-link {
  color: rgba(255, 255, 255, 0.7);
  text-decoration: none;
  font-size: 0.875rem;
  padding: 0.5rem 1rem;
  border-radius: 0.375rem;
  transition: all 0.2s ease;
  border: 1px solid rgba(255, 255, 255, 0.1);
  background-color: rgba(255, 255, 255, 0.05);
}

.friendship-link:hover {
  color: var(--white);
  background-color: rgba(255, 255, 255, 0.1);
  border-color: rgba(255, 255, 255, 0.2);
  transform: translateY(-2px);
}

/* Mobile Friendship Links */
@media (max-width: 768px) {
  #friendship-links {
    padding: 1.5rem 0;
  }

  .friendship-links-list {
    gap: 0.75rem;
  }

  .friendship-link {
    font-size: 0.8125rem;
    padding: 0.5rem 0.75rem;
  }
}

/* FAQ Section Styles */
#faq-section {
  max-width: 1200px;
  margin: 2rem auto;
  padding: 0 1rem;
}

.faq-container {
  width: 100%;
}

.faq-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1.5rem;
}

.faq-card {
  background-color: var(--bg-primary);
  border-radius: 1rem;
  padding: 1.5rem;
  box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
  border: 1px solid var(--border-color);
}

.faq-card-wide {
  grid-column: span 3;
}

.faq-title {
  font-size: 1.125rem;
  font-weight: 600;
  color: var(--text-primary);
  margin-bottom: 1rem;
}

.faq-content {
  font-size: 0.875rem;
  color: var(--text-secondary);
  line-height: 1.6;
  margin-bottom: 1rem;
}

.faq-list {
  list-style: none;
  padding: 0;
  margin: 0;
}

.faq-list li {
  font-size: 0.875rem;
  color: var(--text-secondary);
  line-height: 1.8;
  padding-left: 1.5rem;
  position: relative;
  margin-bottom: 0.5rem;
}

.faq-list li::before {
  content: "•";
  position: absolute;
  left: 0;
  color: var(--primary-500);
  font-weight: bold;
}

.postcode-system {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1.5rem;
  margin-top: 1rem;
}

.postcode-item {
  padding: 1rem;
  background-color: var(--bg-secondary);
  border-radius: 0.5rem;
  border: 1px solid var(--border-color);
}

.postcode-item-title {
  font-size: 0.9375rem;
  font-weight: 600;
  color: var(--text-primary);
  margin-bottom: 0.5rem;
}

.postcode-item-content {
  font-size: 0.8125rem;
  color: var(--text-secondary);
  line-height: 1.6;
  margin: 0;
}

/* Mobile FAQ */
@media (max-width: 1024px) {
  .faq-grid {
    grid-template-columns: repeat(2, 1fr);
  }
  
  .faq-card-wide {
    grid-column: span 2;
  }
  
  .postcode-system {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 768px) {
  .faq-grid {
    grid-template-columns: 1fr;
  }
  
  .faq-card-wide {
    grid-column: span 1;
  }
  
  #faq-section {
    margin: 1.5rem auto;
    padding: 0 1rem;
  }
  
  .faq-card {
    padding: 1rem;
  }
}

/* Mobile Footer */
@media (max-width: 768px) {
  .footer-content {
    grid-template-columns: 1fr;
    gap: 1.5rem;
  }
  
  .footer-description {
    max-width: 100%;
  }
}

/* Mobile Optimizations */
@media (max-width: 768px) {
  /* Improve touch targets */
  .btn, button {
    min-height: 44px;
    min-width: 44px;
  }
  
  /* Better spacing for mobile */
  .container {
    padding-left: 1rem;
    padding-right: 1rem;
  }
  
  /* Improve address cards on mobile - only for generation pages */
  .results-section .address-card {
    padding: 1rem;
  }
  
  /* Vertical layout for address cards on mobile (generation pages only) */
  .results-section .address-card .flex {
    flex-direction: column;
    align-items: flex-start;
    gap: 0.5rem;
    position: relative;
  }
  
  /* Label row with copy button - keep them on same line */
  .results-section .address-card .flex-shrink-0 {
    flex-shrink: 0;
    width: 100%;
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-right: 0;
  }
  
  /* Content below label */
  .results-section .address-card .flex-1 {
    min-width: 0;
    width: 100%;
    margin-right: 0;
    margin-top: 0;
  }
  
  .results-section .address-card .text-base {
    word-break: break-word;
    overflow-wrap: break-word;
    line-height: 1.5;
    font-size: 0.9375rem;
    text-align: left;
    width: 100%;
  }
  
  /* Email field optimization */
  .results-section .address-card[data-field="email"] .flex-1 {
    width: 100%;
    min-width: 0;
    margin-right: 0;
  }
  
  .results-section .address-card[data-field="email"] .text-base {
    text-align: left;
    word-break: break-word;
    overflow-wrap: break-word;
    max-width: 100%;
  }
  
  /* Copy button stays in original position (next to label) */
  .results-section .address-card .copy-status {
    flex-shrink: 0;
    margin-left: auto;
    margin-top: 0;
    min-width: 24px;
    padding: 0.25rem;
  }
  
  .results-section .address-card .copy-status svg {
    width: 18px;
    height: 18px;
  }
  
  /* Label styling */
  .results-section .address-card label {
    font-size: 0.8125rem;
    white-space: nowrap;
    margin-right: 0.5rem;
    flex-shrink: 0;
  }
  
  .address-row {
    grid-template-columns: 1fr;
    gap: 0.5rem;
  }

  /* En móvil: en la fila código postal + SMS temporal, mostrar SMS encima del código postal */
  .address-row-zip-sms {
    flex-direction: column;
  }
  
  .address-row-zip-sms .sms-card {
    order: 1;
  }
  
  .address-row-zip-sms .zip-card {
    order: 2;
  }
  
  /* Better modal on mobile */
  .modal-content {
    margin: 1rem;
    max-height: calc(100vh - 2rem);
  }
  
  /* Improve form inputs on mobile */
  input, select, textarea {
    font-size: 16px; /* Prevents zoom on iOS */
  }
  
  /* Better header on mobile */
  header {
    padding: 0.75rem 1rem;
  }
  
  /* Optimize header actions spacing on mobile */
  .header-actions {
    gap: 0.5rem;
  }
  
  /* Ensure language switcher button is clickable on mobile */
  .language-switcher-btn {
    min-width: 44px;
    min-height: 44px;
    padding: 0.5rem;
    font-size: 0.75rem;
  }
  
  /* Hide language text on very small screens, show only flag */
  @media (max-width: 360px) {
    .language-switcher-btn span:first-child {
      display: none;
    }
    .language-switcher-btn {
      padding: 0.5rem;
      min-width: 40px;
    }
  }
  
  /* Improve saved addresses table on mobile */
  .address-table {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
  }
  
  /* Better spacing */
  .hero-card {
    padding: 1rem;
  }
  
  .results-section, .saved-section {
    padding: 1rem;
  }
  
  /* Optimize hero-text for mobile (Spanish site) */
  .hero-text h1 {
    font-size: 1.125rem;
    line-height: 1.3;
  }
  
  .hero-text p {
    font-size: 0.75rem;
    line-height: 1.5;
  }
  
  /* Optimize results-header and saved-header for mobile (Spanish site) */
  .results-header,
  .saved-header {
    flex-direction: column;
    align-items: flex-start;
    gap: 0.75rem;
  }
  
  .results-header h2,
  .results-header h3,
  .saved-header h2,
  .saved-header h3 {
    font-size: 1rem;
    line-height: 1.4;
    word-break: break-word;
    overflow-wrap: break-word;
    max-width: 100%;
    flex-shrink: 1;
    margin-bottom: 0;
  }
  
  .results-actions {
    width: 100%;
    justify-content: flex-end;
    flex-wrap: wrap;
    gap: 0.5rem;
  }
  
  .saved-header > div {
    width: 100%;
    justify-content: flex-end;
    flex-wrap: wrap;
    gap: 0.5rem;
  }
}


    }
    .language-switcher-btn {
      padding: 0.5rem;
      min-width: 40px;
    }
  }
  
  /* Improve saved addresses table on mobile */
  .address-table {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
  }
  
  /* Better spacing */
  .hero-card {
    padding: 1rem;
  }
  
  .results-section, .saved-section {
    padding: 1rem;
  }
}

