/* Modern, elegant design for OtherSideMap */
:root {
  --primary-color: #00796b;
  --primary-dark: #004d40;
  --primary-light: #48a999;
  --secondary-color: #ff6b6b;
  --background: #f8fafb;
  --surface: #ffffff;
  --text-primary: #2c3e50;
  --text-secondary: #546e7a;
  --border-color: #e0e7ed;
  --shadow-sm: 0 2px 4px rgba(0,0,0,0.08);
  --shadow-md: 0 4px 12px rgba(0,0,0,0.1);
  --shadow-lg: 0 8px 24px rgba(0,0,0,0.12);
  --radius-sm: 6px;
  --radius-md: 12px;
  --radius-lg: 20px;
}

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

body {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
  background: var(--background);
  color: var(--text-primary);
  line-height: 1.6;
  overflow-x: hidden;
}

/* Utility classes */
.text-center { text-align: center; }
.mb-1 { margin-bottom: 1rem; }
.mb-2 { margin-bottom: 2rem; }
.text-muted { color: #666; }
.font-mono { font-family: monospace; }

/* Layout container for centering and max-width */
.container {
  max-width: 1000px;
  margin: 0 auto;
  padding: 0.5rem 2rem 0 2rem;
}

#language-select {
  padding: 10px 15px;
  padding-left: 35px; /* Space for flag */
  border: 2px solid #159895;
  border-radius: 6px;
  background: #fff;
  color: #159895;
  font-weight: 600;
  font-size: 1.1rem;
  cursor: pointer;
  transition: all 0.2s ease;
  appearance: none;
  background-image: url('data:image/svg+xml;utf8,<svg fill="%23159895" height="20" viewBox="0 0 20 20" width="20" xmlns="http://www.w3.org/2000/svg"><path d="M7 10l5 5 5-5z"/></svg>');
  background-repeat: no-repeat;
  background-position: right 10px center;
  background-size: 20px;
  min-width: 120px;
  text-align: center;
  text-align-last: center;
}

#language-select {
  /* ... existing styles ... */
}

/* Flag styles for language selector */
#language-select option {
  padding-left: 30px;
}

/* Show current flag in the select */
#language-select {
  background-repeat: no-repeat, no-repeat;
  background-position: 10px center, right 10px center;
  background-size: 20px 15px, 20px;
}

/* Set initial flag based on language */
#language-select[data-flag="gb"] {
  background-image: url('https://flagcdn.com/20x15/gb.png'), url('data:image/svg+xml;utf8,<svg fill="%23159895" height="20" viewBox="0 0 20 20" width="20" xmlns="http://www.w3.org/2000/svg"><path d="M7 10l5 5 5-5z"/></svg>');
}

#language-select[data-flag="es"] {
  background-image: url('https://flagcdn.com/20x15/es.png'), url('data:image/svg+xml;utf8,<svg fill="%23159895" height="20" viewBox="0 0 20 20" width="20" xmlns="http://www.w3.org/2000/svg"><path d="M7 10l5 5 5-5z"/></svg>');
}

#language-select[data-flag="it"] {
  background-image: url('https://flagcdn.com/20x15/it.png'), url('data:image/svg+xml;utf8,<svg fill="%23159895" height="20" viewBox="0 0 20 20" width="20" xmlns="http://www.w3.org/2000/svg"><path d="M7 10l5 5 5-5z"/></svg>');
}

#language-select[data-flag="id"] {
  background-image: url('https://flagcdn.com/20x15/id.png'), url('data:image/svg+xml;utf8,<svg fill="%23159895" height="20" viewBox="0 0 20 20" width="20" xmlns="http://www.w3.org/2000/svg"><path d="M7 10l5 5 5-5z"/></svg>');
}

#language-select[data-flag="fr"] {
  background-image: url('https://flagcdn.com/20x15/fr.png'), url('data:image/svg+xml;utf8,<svg fill="%23159895" height="20" viewBox="0 0 20 20" width="20" xmlns="http://www.w3.org/2000/svg"><path d="M7 10l5 5 5-5z"/></svg>');
}

#language-select[data-flag="vi"] {
  background-image: url('https://flagcdn.com/20x15/vn.png'), url('data:image/svg+xml;utf8,<svg fill="%23159895" height="20" viewBox="0 0 20 20" width="20" xmlns="http://www.w3.org/2000/svg"><path d="M7 10l5 5 5-5z"/></svg>');
}

.language-switcher select:hover,
.language-switcher select:focus {
  /* ... existing hover styles ... */
}

.language-switcher select:hover,
.language-switcher select:focus {
  background: #159895;
  color: #fff;
}


.container > * {
  margin-bottom: 2rem;
}

.container > *:last-child {
  margin-bottom: 0;
}

header {
  margin-top: 0.5rem;
  margin-bottom: 2rem;
  border-radius: 12px;
  box-shadow: var(--shadow-md);
}

.header-content {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 2rem;
  text-align: center;
}

.header-text {
  flex: 1 1 0;
  text-align: center;
}

.header-logo {
  flex-shrink: 0;
  transition: transform 0.2s ease;
  text-decoration: none;
}

.header-logo:hover {
  transform: scale(1.05);
}

.header-logo,
.header-logo img{
  width:120px;   /* pick a size that looks good */
  height:120px;
  object-fit:contain;
}

header h1 {
  font-size: 2.5rem;
  font-weight: 700;
  margin-bottom: 0.5rem;
  letter-spacing: -0.5px;
}

.tagline {
  font-size: 1.1rem;
  opacity: 0.9;
  font-weight: 300;
}

nav {
  background: rgba(0,0,0,0.1);
  backdrop-filter: blur(10px);
  padding: 0.5rem 0;
}

nav ul {
  list-style: none;
  display: flex;
  justify-content: center;
  flex-wrap: wrap;
  gap: 2rem;
  max-width: 1200px;
  margin: 0 auto;
}

/* Focus states for accessibility */
*:focus {
  outline: 2px solid #159895;
  outline-offset: 2px;
}

.search-bar input:focus {
  border-color: #159895;
  box-shadow: 0 0 0 3px rgba(21, 152, 149, 0.1);
}

/* --- Styles migrated from es/index.html --- */
.hero {
  margin-top: 2rem;
  margin-bottom: 3rem;
  padding: 2.5rem 2rem;
  text-align: center;
  background: #fff;
  border-radius: 8px;
  box-shadow: 0 2px 8px rgba(0,0,0,0.03);
}

.hero h2 {
  font-size: 2rem;
  color: #1a5f7a;
  margin-bottom: 1.2rem;
  font-weight: bold;
}

.lead {
  font-size: 1.1rem;
  color: #555;
  margin-bottom: 1.5rem;
  line-height: 1.7;
}

.search-container {
  margin-bottom: 1.5rem;
}

.search-bar {
  display: flex;
  gap: 0.5rem;
  margin-bottom: 0.8rem;
  background: white;
  padding: 0.5rem;
  border: 2px solid #ddd;
  border-radius: 4px;
}

.search-bar input {
  flex: 1;
  padding: 0.7rem;
  border: 1px solid #ccc;
  border-radius: 3px;
  font-size: 1rem;
  font-family: inherit;
}

.search-bar input:focus {
  outline: none;
  border-color: #159895;
}

.search-bar button {
  padding: 0.7rem 1.5rem;
  background: #159895;
  color: white;
  border: none;
  border-radius: 3px;
  cursor: pointer;
  font-size: 1rem;
  font-family: inherit;
  transition: all 0.2s ease;
}

.search-bar button:hover {
  background: #117a6f;
}

.quick-searches {
  font-size: 0.9rem;
  color: #666;
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  align-items: center;
  justify-content: center;
}

.quick-btn, .btn-calculate, button {
  min-height: 44px;
  min-width: 44px;
}

.quick-btn {
  background: none;
  border: 1px solid #159895;
  color: #159895;
  padding: 0.3rem 0.8rem;
  margin: 0.2rem;
  border-radius: 3px;
  cursor: pointer;
  font-size: 0.85rem;
  transition: all 0.2s ease;
}

.quick-btn:hover {
  background: #159895;
  color: white;
  transform: translateY(-2px);
  box-shadow: 0 4px 8px rgba(21, 152, 149, 0.2);
}

.maps-container {
  max-width: 900px;
  margin: 2rem auto 1rem auto;
  box-sizing: border-box;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1rem;
  margin-bottom: 1rem;
}

.map-wrapper {
  border: 1px solid #ddd;
  border-radius: 4px;
  overflow: hidden;
  position: relative;
  touch-action: none;
}

.map-wrapper h3 {
  background: #f5f5f5;
  padding: 0.7rem;
  font-size: 1rem;
  font-weight: normal;
  border-bottom: 1px solid #ddd;
}

#map-origin, #map-antipode {
  height: 350px;
  width: 100%;
}

.map-loading {
  background: #f0f0f0;
  animation: pulse 1.5s ease-in-out infinite;
}

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

.coord-display {
  padding: 0.7rem;
  background: #f9f9f9;
  font-size: 0.9rem;
  font-family: monospace;
  color: #666;
}

.distance-info {
  background: #e8f4f0;
  padding: 1rem;
  border-radius: 4px;
  font-size: 0.95rem;
  border: 1px solid #c3e6de;
}

.distance-info p {
  margin: 0.3rem 0;
}

.distance-info span {
  font-weight: bold;
  color: #1a5f7a;
}

.tools-section {
  max-width: 900px;
  margin: 3rem auto 3.5rem auto;
  background: #fff;
  padding: 2.5rem 2rem;
  border-radius: 8px;
  box-shadow: 0 2px 8px rgba(0,0,0,0.03);
}

.tool-inputs {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1rem;
  margin: 1rem 0;
}

.tool-inputs input {
  padding: 0.5rem;
  border: 1px solid #ccc;
  border-radius: 3px;
  font-size: 0.95rem;
  width: 100%;
  margin-bottom: 0.5rem;
}

.tool-inputs label {
  display: block;
  margin-top: 0.5rem;
  margin-bottom: 0.3rem;
  font-weight: 500;
  color: #555;
}

.btn-calculate {
  background: #159895;
  color: white;
  border: none;
  padding: 0.6rem 1.2rem;
  border-radius: 3px;
  cursor: pointer;
  font-size: 0.95rem;
  margin-top: 0.5rem;
  transition: all 0.2s ease;
}

.btn-calculate:hover {
  background: #117a6f;
}

.result-box {
  background: white;
  padding: 1rem;
  border: 1px solid #ddd;
  border-radius: 3px;
  margin-top: 1rem;
  font-size: 0.9rem;
}

/* Sections styling */
section {
  margin-bottom: 2.5rem;
  padding: 2rem;
  background: #fff;
  border-radius: 8px;
  box-shadow: 0 2px 4px rgba(0,0,0,0.05);
}

section:nth-child(even) {
  background: #fafafa;
}

section h2, .tools-section h2, .hero h2 {
  font-size: 2rem;
  margin-top: 0;
  margin-bottom: 1rem;
  font-weight: bold;
  color: #1a5f7a;
}

section h3, .tools-section h3 {
  font-size: 1.25rem;
  margin: 1rem 0 0.5rem 0;
  font-weight: bold;
  color: #159895;
}

section p, .tools-section p, .hero p, section ul, section li {
  margin-bottom: 1.2rem;
  font-size: 1.08rem;
  line-height: 1.7;
}

section ul, .fact-list {
  margin-left: 1.5rem;
  margin-bottom: 1.5rem;
}

.fact-list li {
  margin-bottom: 1.5rem;
  padding-left: 1.5rem;
  position: relative;
}

.fact-list li::before {
  content: "🌍";
  position: absolute;
  left: 0;
}

.faq-item {
  margin-bottom: 1rem;
  border-bottom: 1px solid #e0e0e0;
  padding-bottom: 1rem;
}

.faq-item:last-child {
  border-bottom: none;
}

.faq-item summary {
  cursor: pointer;
  font-weight: bold;
  color: #1a5f7a;
  margin-bottom: 0.5rem;
}

.faq-item p {
  margin-top: 0.5rem;
  font-size: 0.95rem;
  color: #555;
}

.toast {
  position: fixed;
  bottom: 2rem;
  left: 50%;
  transform: translateX(-50%) translateY(100px);
  background: #333;
  color: white;
  padding: 0.8rem 1.5rem;
  border-radius: 4px;
  opacity: 0;
  transition: all 0.3s ease;
  z-index: 9999;
  font-size: 0.9rem;
}

.toast.show {
  transform: translateX(-50%) translateY(0);
  opacity: 1;
}

footer {
  margin-top: 3rem;
  padding: 2rem 0 0.5rem 0;
  text-align: center;
  background: none;
  color: #888;
}

footer a {
  color: #159895;
  text-decoration: none;
  margin: 0 1rem;
}

footer a:hover {
  text-decoration: underline;
}

/* Antipode city pair layout improvements */
.antipode-list {
  margin: 2.5rem 0;
  display: flex;
  flex-direction: column;
  gap: 2rem;
}

.antipode-pair {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 2rem;
  padding: 1.5rem 1rem;
  background: #f5f5f5;
  border: 1px solid #e0e0e0;
  border-radius: 8px;
  box-shadow: 0 2px 8px rgba(0,0,0,0.03);
}

.city {
  flex: 1 1 0;
  text-align: center;
  padding: 0 1rem;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.2rem;
}

.city img {
  width: 40px;
  height: 30px;
  object-fit: cover;
  border-radius: 2px;
  margin-bottom: 0.3rem;
  box-shadow: 0 1px 3px rgba(0,0,0,0.2);
}

.city h4 {
  font-size: 1.1rem;
  margin-bottom: 0.2rem;
  font-weight: bold;
}

.city p {
  font-size: 0.95rem;
  color: #444;
  margin: 0;
}

.city small {
  font-size: 0.85rem;
  color: #888;
}

.connection {
  font-size: 2.2rem;
  color: #159895;
  padding: 0 1.5rem;
  min-width: 2.5rem;
  text-align: center;
}

.loading-spinner {
  display: inline-block;
  width: 14px;
  height: 14px;
  border: 2px solid rgba(255,255,255,0.3);
  border-top-color: white;
  border-radius: 50%;
  animation: spin 1s linear infinite;
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

.header-content{
  padding:0 1.5rem;   /* push everything inwards equally */
}

/* Responsive design improvements */
@media (max-width: 1100px) {
  .container {
    max-width: 98vw;
    padding: 0 1rem;
  }
  .maps-container, .tools-section {
    max-width: 100vw;
    padding: 0;
  }
}

@media (max-width: 768px) {
  .header-content {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    gap: 1rem;
    padding: 1.5rem;
  }

  .header-logo {
    order: 1;
    margin: 0 auto;
  }

  .header-text {
    order: 2;
    width: 100%;
  }

  #language-select {
    order: 3;
    margin: 0 auto;
  }
}

@media (max-width: 900px) {
  section, .tools-section, .hero {
    padding: 1.5rem 1rem;
    margin-bottom: 2rem;
  }
  section h2, .tools-section h2, .hero h2 {
    font-size: 1.3rem;
    margin-top: 0;
    margin-bottom: 0.8rem;
  }
  section h3, .tools-section h3 {
    font-size: 1.05rem;
    margin: 0.8rem 0 0.4rem 0;
  }
  section p, .tools-section p, .hero p, section ul, section li {
    font-size: 0.98rem;
    margin-bottom: 0.7rem;
  }
  .maps-container, .tools-section {
    padding: 0.5rem 0;
  }
}

@media (max-width: 768px) {
  body {
    font-size: 16px;
  }
  
  
  header h1 {
    font-size: 1.8rem;
  }
  
  .hero {
    padding: 1.2rem 0.5rem;
  }
  
  /* Better mobile search bar */
  .search-bar {
    flex-direction: row;
    position: relative;
    padding: 0;
  }
  
  .search-bar input {
    width: 100%;
    border-radius: 3px 0 0 3px;
    border-right: none;
  }
  
  .search-bar button {
    border-radius: 0 3px 3px 0;
    width: auto;
    flex-shrink: 0;
  }
  
  /* Quick search buttons responsive */
  .quick-searches {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    align-items: center;
  }
  
  .quick-btn {
    flex: 1 1 calc(50% - 0.25rem);
    min-width: 120px;
  }
  
  /* Maps responsive */
  .maps-container {
    grid-template-columns: 1fr;
  }
  
  #map-origin, #map-antipode {
    height: 280px;
  }
  
  /* Antipode pairs responsive */
  .antipode-pair {
    flex-direction: column;
    gap: 1rem;
    padding: 1rem 0.5rem;
  }
  
  .connection {
    transform: rotate(90deg);
    font-size: 1.5rem;
    padding: 0.5rem 0;
  }
  
  .tool-inputs {
    grid-template-columns: 1fr;
  }
  
  .container {
    padding: 0 0.5rem;
  }
  
  main > section, .tools-section {
    padding: 1rem 0.5rem;
  }
}

@media (max-width: 600px) {
  .city {
    padding: 0 0.5rem;
  }
}
/* Add this to your existing style.css file */

/* Language Switcher Styles */
.language-switcher {
  margin-left: auto;
  display: flex;
  gap: 10px;
}

.language-switcher a {
  padding: 5px 10px;
  text-decoration: none;
  color: #159895;
  border: 1px solid #159895;
  border-radius: 4px;
  transition: all 0.3s ease;
  font-weight: 500;
  font-size: 0.9rem;
}

.language-switcher a:hover,
.language-switcher a.active {
  background: #159895;
  color: white;
}

/* Update header to accommodate language switcher */
.header-content {
  display: flex;
  align-items: center;
  gap: 2rem;
  flex-wrap: wrap;
}

@media (max-width: 768px) {
  .header-content {
    justify-content: space-between;
  }
  
  .language-switcher {
    order: 3;
    width: 100%;
    justify-content: center;
    margin-top: 1rem;
  }
}