:root {
  --color-primary: #667eea;
  --color-secondary: #764ba2;
  --color-bg: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  --color-surface: #ffffff;
  --color-text: #1f2937;
  --color-text-secondary: #6b7280;
  --color-border: #e5e7eb;
  --space-xs: 8px;
  --space-sm: 12px;
  --space-md: 16px;
  --space-lg: 24px;
  --radius: 12px;
  --shadow: 0 4px 6px rgba(0, 0, 0, 0.07);
  --shadow-lg: 0 10px 25px rgba(0, 0, 0, 0.15);
}

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

body {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  background: var(--color-bg);
  color: var(--color-text);
  line-height: 1.6;
  padding: var(--space-lg);
  min-height: 100vh;
}

.container {
  max-width: 1200px;
  margin: 0 auto;
}

.header {
  background: white;
  border-radius: var(--radius);
  padding: var(--space-lg);
  margin-bottom: var(--space-lg);
  box-shadow: var(--shadow-lg);
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.header h1 {
  font-size: 28px;
  color: var(--color-text);
  margin: 0;
}

.btn-back {
  background: var(--color-primary);
  color: white;
  border: none;
  padding: 12px 24px;
  border-radius: var(--radius);
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.3s;
}

.btn-back:hover {
  background: var(--color-secondary);
  transform: translateY(-2px);
}

.continent-tabs {
  background: white;
  border-radius: var(--radius);
  padding: var(--space-md);
  margin-bottom: var(--space-lg);
  box-shadow: var(--shadow);
  display: flex;
  gap: var(--space-sm);
  flex-wrap: wrap;
}

.tab-btn {
  background: white;
  border: 2px solid var(--color-border);
  padding: var(--space-sm) var(--space-md);
  border-radius: var(--radius);
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.3s;
}

.tab-btn:hover {
  border-color: var(--color-primary);
  background: rgba(102, 126, 234, 0.1);
}

.tab-btn.active {
  background: linear-gradient(135deg, var(--color-primary) 0%, var(--color-secondary) 100%);
  color: white;
  border-color: transparent;
}

.search-bar {
  background: white;
  border-radius: var(--radius);
  padding: var(--space-md);
  margin-bottom: var(--space-lg);
  box-shadow: var(--shadow);
}

.search-bar input {
  width: 100%;
  padding: var(--space-md);
  border: 2px solid var(--color-border);
  border-radius: var(--radius);
  font-size: 16px;
  transition: all 0.3s;
}

.search-bar input:focus {
  outline: none;
  border-color: var(--color-primary);
  box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
}

#continentContent {
  background: white;
  border-radius: var(--radius);
  padding: var(--space-lg);
  box-shadow: var(--shadow-lg);
}

.continent-title {
  font-size: 24px;
  font-weight: 700;
  color: var(--color-text);
  margin-bottom: var(--space-lg);
  padding-bottom: var(--space-md);
  border-bottom: 2px solid var(--color-border);
}

.countries-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: var(--space-md);
}

.country-card {
  border: 2px solid var(--color-border);
  border-radius: var(--radius);
  padding: var(--space-md);
  transition: all 0.3s;
  display: flex;
  align-items: center;
  gap: var(--space-md);
}

.country-card:hover {
  border-color: var(--color-primary);
  box-shadow: var(--shadow);
  transform: translateY(-2px);
}

.country-card.hidden {
  display: none;
}

.flag-container {
  flex-shrink: 0;
  width: 60px;
  height: 40px;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  border-radius: 4px;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.flag-container img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.country-info {
  flex: 1;
}

.country-name {
  font-size: 16px;
  font-weight: 700;
  color: var(--color-text);
  margin-bottom: 4px;
}

.capital-name {
  font-size: 14px;
  color: var(--color-text-secondary);
}

.country-count {
  text-align: center;
  padding: var(--space-md);
  color: var(--color-text-secondary);
  font-size: 14px;
  margin-top: var(--space-md);
  border-top: 1px solid var(--color-border);
}

@media (max-width: 768px) {
  body {
    padding: var(--space-sm);
  }

  .header {
    flex-direction: column;
    gap: var(--space-md);
    align-items: flex-start;
  }

  .header h1 {
    font-size: 22px;
  }

  .continent-tabs {
    flex-direction: column;
  }

  .tab-btn {
    width: 100%;
  }

  .countries-grid {
    grid-template-columns: 1fr;
  }
}
