/* GEOWIKI Design System */
/* Premium Educational Platform */

/* ===== CSS VARIABLES ===== */

/* Colors */
:root {
  /* PREMIUM DARK THEME */
  --bg-dark: #0B1220;
  --bg-dark-2: #111B2D;
  --bg-dark-3: #1A2847;
  
  /* Primary Palette */
  --primary-color: #4DA3FF;
  --primary-dark: #3B7DD6;
  --primary-light: #6CBFFF;
  --secondary-color: #7CFFB2;
  --accent-color: #FF6B9D;

  /* Level Colors */
  --beginner-color: #7CFFB2;
  --confident-color: #4DA3FF;
  --expert-color: #8B5CF6;
  --pro-color: #FF6B9D;
  --geo-color: #FFB347;

  /* Neutral Colors */
  --text-primary: #FFFFFF;
  --text-secondary: #B0C4DE;
  --text-light: #808A9D;
  --bg-primary: #0B1220;
  --bg-secondary: #111B2D;
  --bg-tertiary: #1A2847;

  /* Glass Effect - Premium */
  --glass-bg: rgba(77, 163, 255, 0.08);
  --glass-border: rgba(77, 163, 255, 0.2);
  --glass-backdrop: rgba(11, 18, 32, 0.7);

  /* Gradients */
  --primary-gradient: linear-gradient(135deg, #4DA3FF 0%, #7CFFB2 100%);
  --secondary-gradient: linear-gradient(135deg, #FF6B9D 0%, #4DA3FF 100%);
  --accent-gradient: linear-gradient(135deg, #4DA3FF 0%, #8B5CF6 100%);

  /* Shadows */
  --shadow-soft: 0 4px 6px -1px rgba(0, 0, 0, 0.3);
  --shadow-medium: 0 10px 15px -3px rgba(0, 0, 0, 0.4);
  --shadow-large: 0 20px 25px -5px rgba(0, 0, 0, 0.5);
  --shadow-glow: 0 0 30px rgba(77, 163, 255, 0.4);
  --shadow-glow-secondary: 0 0 30px rgba(124, 255, 178, 0.3);

  /* Spacing Scale */
  --spacing-xs: 0.5rem;    /* 8px */
  --spacing-sm: 1rem;      /* 16px */
  --spacing-md: 1.5rem;    /* 24px */
  --spacing-lg: 2rem;      /* 32px */
  --spacing-xl: 3rem;      /* 48px */
  --spacing-2xl: 4rem;     /* 64px */
  --spacing-3xl: 6rem;     /* 96px */
  --spacing-4xl: 8rem;     /* 128px */

  /* Border Radius */
  --border-radius: 0.75rem;   /* 12px */
  --border-radius-lg: 1.25rem;   /* 20px */
  --border-radius-xl: 1.5rem;    /* 24px */
  --border-radius-2xl: 2rem;     /* 32px */

  /* Typography */
  --font-family-primary: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  --font-family-heading: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;

  /* Font Sizes */
  --text-xs: 0.875rem;    /* 14px */
  --text-sm: 1rem;        /* 16px */
  --text-base: 1.125rem;  /* 18px */
  --text-lg: 1.25rem;     /* 20px */
  --text-xl: 1.5rem;      /* 24px */
  --text-2xl: 1.875rem;   /* 30px */
  --text-3xl: 2.25rem;    /* 36px */
  --text-4xl: 3rem;       /* 48px */
  --text-5xl: 3.75rem;    /* 60px */
  --text-6xl: 4.5rem;     /* 72px */
  --text-7xl: 5.625rem;   /* 90px */

  /* Font Weights */
  --font-light: 300;
  --font-normal: 400;
  --font-medium: 500;
  --font-semibold: 600;
  --font-bold: 700;
  --font-extrabold: 800;

  /* Transitions */
  --transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  --transition-fast: all 0.15s cubic-bezier(0.4, 0, 0.2, 1);
  --transition-slow: all 0.5s cubic-bezier(0.4, 0, 0.2, 1);

  /* Z-index Scale */
  --z-dropdown: 1000;
  --z-sticky: 1020;
  --z-fixed: 1030;
  --z-modal-backdrop: 1040;
  --z-modal: 1050;
  --z-popover: 1060;
  --z-tooltip: 1070;
}

/* ===== BASE STYLES ===== */

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

html {
  scroll-behavior: smooth;
}

body {
  font-family: var(--font-family-primary);
  font-size: var(--text-base);
  line-height: 1.6;
  color: var(--text-primary);
  background: var(--bg-primary);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

/* ===== TYPOGRAPHY ===== */

h1, h2, h3, h4, h5, h6 {
  font-family: var(--font-family-heading);
  font-weight: var(--font-bold);
  line-height: 1.2;
  margin-bottom: var(--spacing-md);
}

h1 { font-size: var(--text-5xl); }
h2 { font-size: var(--text-4xl); }
h3 { font-size: var(--text-3xl); }
h4 { font-size: var(--text-2xl); }
h5 { font-size: var(--text-xl); }
h6 { font-size: var(--text-lg); }

p {
  margin-bottom: var(--spacing-md);
}

a {
  color: var(--primary-color);
  text-decoration: none;
  transition: var(--transition);
}

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

/* ===== UTILITY CLASSES ===== */

/* Spacing */
.m-0 { margin: 0; }
.mt-xs { margin-top: var(--spacing-xs); }
.mt-sm { margin-top: var(--spacing-sm); }
.mt-md { margin-top: var(--spacing-md); }
.mt-lg { margin-top: var(--spacing-lg); }
.mt-xl { margin-top: var(--spacing-xl); }
.mt-2xl { margin-top: var(--spacing-2xl); }

.mb-xs { margin-bottom: var(--spacing-xs); }
.mb-sm { margin-bottom: var(--spacing-sm); }
.mb-md { margin-bottom: var(--spacing-md); }
.mb-lg { margin-bottom: var(--spacing-lg); }
.mb-xl { margin-bottom: var(--spacing-xl); }
.mb-2xl { margin-bottom: var(--spacing-2xl); }

.p-xs { padding: var(--spacing-xs); }
.p-sm { padding: var(--spacing-sm); }
.p-md { padding: var(--spacing-md); }
.p-lg { padding: var(--spacing-lg); }
.p-xl { padding: var(--spacing-xl); }
.p-2xl { padding: var(--spacing-2xl); }

/* Text Colors */
.text-primary { color: var(--text-primary); }
.text-secondary { color: var(--text-secondary); }
.text-light { color: var(--text-light); }
.text-white { color: white; }

/* Background Colors */
.bg-primary { background: var(--bg-primary); }
.bg-secondary { background: var(--bg-secondary); }
.bg-tertiary { background: var(--bg-tertiary); }

/* Flex Utilities */
.flex { display: flex; }
.flex-col { flex-direction: column; }
.items-center { align-items: center; }
.justify-center { justify-content: center; }
.justify-between { justify-content: space-between; }
.gap-xs { gap: var(--spacing-xs); }
.gap-sm { gap: var(--spacing-sm); }
.gap-md { gap: var(--spacing-md); }
.gap-lg { gap: var(--spacing-lg); }
.gap-xl { gap: var(--spacing-xl); }

/* Grid Utilities */
.grid { display: grid; }
.grid-cols-1 { grid-template-columns: repeat(1, minmax(0, 1fr)); }
.grid-cols-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.grid-cols-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.grid-cols-4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }

/* Border Radius */
.rounded { border-radius: var(--border-radius); }
.rounded-lg { border-radius: var(--border-radius-lg); }
.rounded-xl { border-radius: var(--border-radius-xl); }
.rounded-2xl { border-radius: var(--border-radius-2xl); }

/* Shadows */
.shadow-soft { box-shadow: var(--shadow-soft); }
.shadow-medium { box-shadow: var(--shadow-medium); }
.shadow-large { box-shadow: var(--shadow-large); }
.shadow-glow { box-shadow: var(--shadow-glow); }

/* Transitions */
.transition { transition: var(--transition); }
.transition-fast { transition: var(--transition-fast); }
.transition-slow { transition: var(--transition-slow); }

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

@media (max-width: 768px) {
  :root {
    --text-5xl: 2.5rem;
    --text-4xl: 2rem;
    --text-3xl: 1.75rem;
    --text-2xl: 1.5rem;
  }

  .grid-cols-2,
  .grid-cols-3,
  .grid-cols-4 {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 480px) {
  :root {
    --spacing-xl: 1.25rem;
    --spacing-2xl: 1.5rem;
    --spacing-3xl: 2rem;
  }
}

/* ===== SEARCH BAR ===== */
.search-bar-container {
  margin: 0;
}

.search-bar {
  position: relative;
  display: flex;
  gap: var(--spacing-xs);
  width: 100%;
  max-width: 600px;
  margin: 0 auto;
}

.search-input {
  flex: 1;
  padding: var(--spacing-md) var(--spacing-lg);
  background: var(--glass-bg);
  border: 1px solid var(--glass-border);
  border-radius: var(--border-radius-lg);
  color: var(--text-primary);
  font-family: var(--font-family-primary);
  font-size: var(--text-sm);
  backdrop-filter: blur(10px);
  transition: var(--transition);
}

.search-input:focus {
  outline: none;
  border-color: var(--primary-color);
  background: rgba(77, 163, 255, 0.15);
  box-shadow: 0 0 20px rgba(77, 163, 255, 0.3);
}

.search-input::placeholder {
  color: var(--text-light);
}

.search-btn {
  padding: var(--spacing-md) var(--spacing-lg);
  background: linear-gradient(135deg, var(--primary-color), var(--primary-dark));
  border: none;
  border-radius: var(--border-radius-lg);
  color: white;
  font-weight: 600;
  cursor: pointer;
  transition: var(--transition);
  box-shadow: 0 0 20px rgba(77, 163, 255, 0.3);
}

.search-btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 0 30px rgba(77, 163, 255, 0.5);
}

.search-results {
  position: absolute;
  top: 100%;
  left: 0;
  right: 0;
  margin-top: var(--spacing-xs);
  background: var(--bg-dark-2);
  border: 1px solid var(--glass-border);
  border-radius: var(--border-radius-lg);
  backdrop-filter: blur(10px);
  max-height: 300px;
  overflow-y: auto;
  z-index: 100;
}

.search-result-item {
  padding: var(--spacing-md) var(--spacing-lg);
  border-bottom: 1px solid rgba(77, 163, 255, 0.1);
  cursor: pointer;
  transition: var(--transition);
}

.search-result-item:hover {
  background: rgba(77, 163, 255, 0.1);
}

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

.search-result-name {
  display: block;
  font-weight: 600;
  color: var(--text-primary);
  margin-bottom: 4px;
}

.search-result-capital {
  display: block;
  font-size: var(--text-xs);
  color: var(--text-light);
}

/* ===== SKELETON LOADING ===== */
.skeleton {
  display: inline-block;
  background: linear-gradient(90deg, 
    var(--bg-dark-2) 0%, 
    var(--bg-dark-3) 50%, 
    var(--bg-dark-2) 100%);
  background-size: 200% 100%;
  animation: skeleton-loading 1.5s infinite;
}

@keyframes skeleton-loading {
  0% {
    background-position: 200% 0;
  }
  100% {
    background-position: -200% 0;
  }
}

.card-skeleton {
  height: 200px;
  border-radius: var(--border-radius-lg);
  margin-bottom: var(--spacing-lg);
}

.skeleton-text {
  height: 16px;
  border-radius: 4px;
  margin-bottom: 8px;
}

.skeleton-text.large {
  height: 24px;
  margin-bottom: 16px;
}

/* ===== BUTTON IMPROVEMENTS ===== */
.cta-button,
.level-btn,
.map-button,
.filter-btn {
  position: relative;
  overflow: hidden;
  transition: var(--transition);
}

.cta-button::before,
.level-btn::before,
.map-button::before {
  content: '';
  position: absolute;
  top: 0;
  left: -100%;
  width: 100%;
  height: 100%;
  background: rgba(255, 255, 255, 0.1);
  transition: left 0.3s ease;
}

.cta-button:hover::before,
.level-btn:hover::before,
.map-button:hover::before {
  left: 100%;
}

.cta-button,
.level-btn,
.map-button {
  box-shadow: 0 0 20px rgba(77, 163, 255, 0.3);
}

.cta-button:hover,
.level-btn:hover,
.map-button:hover {
  transform: translateY(-4px);
  box-shadow: 0 0 30px rgba(77, 163, 255, 0.5);
}

.filter-btn {
  border-radius: var(--border-radius);
  padding: var(--spacing-sm) var(--spacing-md);
  background: rgba(77, 163, 255, 0.1);
  border: 1px solid rgba(77, 163, 255, 0.2);
  color: var(--text-secondary);
  font-weight: 600;
  cursor: pointer;
}

.filter-btn:hover {
  background: rgba(77, 163, 255, 0.2);
  border-color: rgba(77, 163, 255, 0.5);
}

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

/* ===== CONTINENT CARD IMPROVEMENTS ===== */
.continent-card {
  position: relative;
  overflow: hidden;
  border-radius: var(--border-radius-lg);
  background: var(--glass-bg);
  border: 1px solid var(--glass-border);
  padding: var(--spacing-lg);
  text-align: center;
  cursor: pointer;
  transition: var(--transition);
  backdrop-filter: blur(10px);
}

.continent-card::before {
  content: '';
  position: absolute;
  top: -50%;
  left: -50%;
  width: 200%;
  height: 200%;
  background: radial-gradient(circle, rgba(77, 163, 255, 0.3) 0%, transparent 70%);
  opacity: 0;
  transition: opacity 0.3s ease;
}

.continent-card:hover {
  background: rgba(77, 163, 255, 0.15);
  border-color: var(--primary-color);
  transform: translateY(-4px);
  box-shadow: 0 0 30px rgba(77, 163, 255, 0.4);
}

.continent-card:hover::before {
  opacity: 1;
}

.continent-icon {
  font-size: 3rem;
  margin-bottom: var(--spacing-md);
  display: block;
}

.continent-card h3 {
  font-size: var(--text-lg);
  font-weight: 600;
  color: var(--text-primary);
  margin: 0 0 8px 0;
}

.continent-card p {
  color: var(--text-light);
  margin: 0;
  font-size: var(--text-xs);
}

/* ===== LEVEL CARD IMPROVEMENTS ===== */
.level-card {
  position: relative;
  overflow: hidden;
  border-radius: var(--border-radius-lg);
  background: var(--glass-bg);
  border: 1px solid var(--glass-border);
  backdrop-filter: blur(10px);
  transition: var(--transition);
  cursor: pointer;
  height: 100%;
}

.level-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: linear-gradient(135deg, transparent 0%, rgba(77, 163, 255, 0.1) 100%);
  opacity: 0;
  transition: opacity 0.3s ease;
}

.level-card:hover {
  transform: translateY(-8px);
  border-color: var(--primary-color);
  box-shadow: 0 10px 40px rgba(77, 163, 255, 0.3);
}

.level-card:hover::before {
  opacity: 1;
}

/* ===== RESPONSIVE IMPROVEMENTS ===== */
@media (max-width: 768px) {
  .search-bar {
    flex-direction: column;
  }
  
  .search-results {
    position: static;
    margin-top: var(--spacing-xs);
  }
  
  .continent-card:hover {
    transform: scale(1.02);
  }
  
  .level-card:hover {
    transform: scale(1.02);
  }
}