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

body {
  font-family: "Poppins", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto,
    sans-serif;
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  min-height: 100vh;
  color: #333;
}

.container {
  max-width: 1450px;
  margin: 0 auto;
  padding: 20px;
}

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

.start-vote-btn {
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  color: white;
  border: none;
  padding: 12px 24px;
  border-radius: 25px;
  font-family: 'Poppins', sans-serif;
  font-weight: 500;
  font-size: 14px;
  cursor: pointer;
  transition: all 0.3s ease;
  box-shadow: 0 4px 15px rgba(102, 126, 234, 0.3);
}

.start-vote-btn:hover:not(:disabled) {
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(102, 126, 234, 0.4);
}

.start-vote-btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

/* Voting Page Styles */
.voting-container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 2rem;
}

.voting-header {
  text-align: center;
  margin-bottom: 3rem;
}

.voting-header h1 {
  font-family: 'Space Grotesk', sans-serif;
  font-size: 2.5rem;
  font-weight: 600;
  color: white;
  text-shadow: 0 2px 4px rgba(0, 0, 0, 0.3);
  margin-bottom: 1rem;
}

.voting-instructions {
  color: rgba(255, 255, 255, 0.8);
  font-size: 1.1rem;
  margin-bottom: 2rem;
}

.voting-stats {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1.5rem;
  margin-bottom: 2rem;
}

.leading-country-display {
  background: linear-gradient(135deg, rgba(102, 126, 234, 0.3) 0%, rgba(118, 75, 162, 0.3) 100%);
  backdrop-filter: blur(15px);
  border: 2px solid rgba(102, 126, 234, 0.4);
  border-radius: 25px;
  padding: 2rem;
  text-align: center;
  box-shadow: 0 8px 30px rgba(102, 126, 234, 0.3);
}

.leading-country-content {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1rem;
}

.leading-flag {
  font-size: 4rem;
  line-height: 1;
}

.leading-name {
  color: white;
  font-size: 1.5rem;
  font-weight: 600;
  font-family: 'Space Grotesk', sans-serif;
  text-shadow: 0 2px 4px rgba(0, 0, 0, 0.3);
}

.total-votes {
  background: rgba(255, 255, 255, 0.1);
  backdrop-filter: blur(10px);
  padding: 0.75rem 1.5rem;
  border-radius: 20px;
  color: rgba(255, 255, 255, 0.9);
  font-weight: 500;
  border: 1px solid rgba(255, 255, 255, 0.2);
  font-size: 1rem;
}

.voting-countries {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(350px, 1fr));
  gap: 1rem;
  margin-bottom: 3rem;
}

.voting-country {
  background: rgba(255, 255, 255, 0.1);
  backdrop-filter: blur(10px);
  border: 1px solid rgba(255, 255, 255, 0.2);
  border-radius: 15px;
  padding: 1.5rem;
  display: flex;
  justify-content: space-between;
  align-items: center;
  transition: all 0.3s ease;
}

.voting-country:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 25px rgba(0, 0, 0, 0.3);
}

.country-info {
  display: flex;
  align-items: center;
  gap: 1rem;
}

.country-flag {
  font-size: 3rem;
}

.country-name {
  color: white;
  font-weight: 500;
  font-size: 1.1rem;
}

.vote-section {
  display: flex;
  align-items: center;
  gap: 1rem;
}

.vote-count {
  background: rgba(102, 126, 234, 0.3);
  color: white;
  padding: 0.5rem 1rem;
  border-radius: 20px;
  font-weight: 600;
  min-width: 3rem;
  text-align: center;
}

.vote-btn {
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  color: white;
  border: none;
  padding: 0.75rem 1.5rem;
  border-radius: 25px;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.3s ease;
}

.vote-btn:hover:not(:disabled) {
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(102, 126, 234, 0.4);
}

.vote-btn:disabled {
  opacity: 0.6;
  cursor: not-allowed;
}

.vote-btn.voted {
  background: linear-gradient(135deg, #4CAF50 0%, #45a049 100%);
}

.voting-actions {
  display: flex;
  justify-content: center;
  gap: 1rem;
  flex-wrap: wrap;
}

.complete-voting-btn, .share-vote-btn, .back-home-btn {
  background: linear-gradient(135deg, #ff6b6b 0%, #ee5a24 100%);
  color: white;
  border: none;
  padding: 1rem 2rem;
  border-radius: 25px;
  font-family: 'Poppins', sans-serif;
  font-weight: 600;
  font-size: 1rem;
  cursor: pointer;
  transition: all 0.3s ease;
}

.share-vote-btn {
  background: linear-gradient(135deg, #74b9ff 0%, #0984e3 100%);
}

.back-home-btn {
  background: linear-gradient(135deg, #636e72 0%, #2d3436 100%);
}

.complete-voting-btn:hover, .share-vote-btn:hover, .back-home-btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(0, 0, 0, 0.3);
}

/* Results Page Styles */
.results-container {
  max-width: 1000px;
  margin: 0 auto;
  padding: 2rem;
  text-align: center;
}

.celebration {
  margin-bottom: 3rem;
}

.celebration-title {
  font-family: 'Space Grotesk', sans-serif;
  font-size: 3rem;
  font-weight: 700;
  color: white;
  text-shadow: 0 3px 6px rgba(0, 0, 0, 0.3);
  margin-bottom: 2rem;
}

.winner-section {
  background: rgba(255, 215, 0, 0.2);
  border: 2px solid rgba(255, 215, 0, 0.5);
  border-radius: 20px;
  padding: 2rem;
  margin: 2rem 0;
}

.winner-content {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1rem;
  margin-bottom: 1rem;
}

.winner-flag {
  font-size: 4rem;
  line-height: 1;
}

.winner-name {
  color: #FFD700;
  font-size: 2rem;
  font-family: 'Space Grotesk', sans-serif;
  font-weight: 600;
  margin: 0;
  text-shadow: 0 2px 4px rgba(0, 0, 0, 0.3);
}

.winner-stats {
  color: white;
  font-size: 1.2rem;
  font-weight: 500;
}

.confetti {
  font-size: 2rem;
  margin-top: 1rem;
  animation: bounce 2s infinite;
}

.final-results {
  background: rgba(255, 255, 255, 0.1);
  backdrop-filter: blur(10px);
  border: 1px solid rgba(255, 255, 255, 0.2);
  border-radius: 20px;
  padding: 2rem;
  margin-bottom: 2rem;
}

.final-results h3 {
  color: white;
  font-size: 1.5rem;
  margin-bottom: 1.5rem;
}

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

.result-item {
  display: flex;
  align-items: center;
  background: rgba(255, 255, 255, 0.05);
  padding: 1rem;
  border-radius: 10px;
  transition: all 0.3s ease;
}

.result-item.winner {
  background: rgba(255, 215, 0, 0.2);
  border: 1px solid rgba(255, 215, 0, 0.5);
}

.result-rank {
  font-weight: 700;
  color: white;
  margin-right: 1rem;
  min-width: 2rem;
}

.result-flag {
  font-size: 1.5rem;
  margin-right: 1rem;
}

.result-country {
  flex: 1;
  text-align: left;
  color: white;
  font-weight: 500;
}

.result-votes {
  color: rgba(255, 255, 255, 0.8);
  font-weight: 600;
}

.results-actions {
  margin-top: 2rem;
}

.back-btn {
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  color: white;
  border: none;
  padding: 1rem 2rem;
  border-radius: 25px;
  font-family: 'Poppins', sans-serif;
  font-weight: 600;
  font-size: 1rem;
  cursor: pointer;
  transition: all 0.3s ease;
}

.back-btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(102, 126, 234, 0.4);
}

/* Animations */
@keyframes bounce {
  0%, 20%, 50%, 80%, 100% {
    transform: translateY(0);
  }
  40% {
    transform: translateY(-10px);
  }
  60% {
    transform: translateY(-5px);
  }
}

/* Responsive Design for Voting */
@media (max-width: 768px) {
  .voting-stats {
    flex-direction: column;
    gap: 1rem;
  }
  
  .voting-countries {
    grid-template-columns: 1fr;
  }
  
  .voting-country {
    flex-direction: column;
    gap: 1rem;
    text-align: center;
  }
  
  .country-info {
    justify-content: center;
  }
  
  .celebration-title {
    font-size: 2rem;
  }
  
  .voting-actions {
    flex-direction: column;
  }
}

header h1 {
  font-family: "Space Grotesk", -apple-system, BlinkMacSystemFont, "Segoe UI",
    Roboto, sans-serif;
  font-size: 2.5rem;
  font-weight: 600;
  color: white;
  text-shadow: 0 2px 4px rgba(0, 0, 0, 0.3);
  margin-bottom: 10px;
  letter-spacing: -0.02em;
}

header p {
  font-family: "Poppins", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto,
    sans-serif;
  color: rgba(255, 255, 255, 0.9);
  font-weight: 300;
}

.keyboard-section {
  margin-bottom: 30px;
}

.alphabet-keyboard {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 8px;
  padding: 20px;
  background: rgba(255, 255, 255, 0.1);
  backdrop-filter: blur(10px);
  border-radius: 15px;
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.1);
}

.letter-btn {
  width: 45px;
  height: 45px;
  border: none;
  background: linear-gradient(145deg, #ffffff, #e6e6e6);
  color: #333;
  font-family: "Space Grotesk", -apple-system, BlinkMacSystemFont, "Segoe UI",
    Roboto, sans-serif;
  font-size: 1.2rem;
  font-weight: 600;
  border-radius: 8px;
  cursor: pointer;
  transition: all 0.3s ease;
  box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
  letter-spacing: 0.02em;
}

.letter-btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 16px rgba(0, 0, 0, 0.15);
  background: linear-gradient(145deg, #f0f0f0, #d0d0d0);
}

.letter-btn.active {
  background: linear-gradient(145deg, #4caf50, #45a049);
  color: white;
  transform: translateY(-2px);
  box-shadow: 0 6px 16px rgba(76, 175, 80, 0.4);
}

.content-area {
  display: flex;
  gap: 20px;
  background: white;
  border-radius: 15px;
  box-shadow: 0 10px 40px rgba(0, 0, 0, 0.1);
  overflow: hidden;
}

.map-container {
  flex: 1;
  padding: 20px;
  background: #f8f9fa;
}

#world-map {
  width: 100%;
  height: 600px;
  border-radius: 10px;
  background: #e3f2fd;
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
  overflow: hidden;
}

#world-map svg {
  max-width: 100%;
  max-height: 100%;
  width: auto;
  height: auto;
}

/* Style for individual country paths */
#world-map path {
  fill: #90a4ae;
  stroke: #ffffff;
  stroke-width: 0.5;
  transition: all 0.3s ease;
  cursor: pointer;
}

/* Remove hover styles from CSS - will be handled by JavaScript */
#world-map path.highlighted {
  fill: #4caf50 !important;
  stroke: #2e7d32 !important;
  stroke-width: 1.5 !important;
  filter: drop-shadow(0 0 5px rgba(76, 175, 80, 0.6));
}

/* Style for country groups */
#world-map g {
  cursor: pointer;
}

#world-map g.highlighted path {
  fill: #4caf50 !important;
  stroke: #2e7d32 !important;
  stroke-width: 1.5 !important;
  filter: drop-shadow(0 0 5px rgba(76, 175, 80, 0.6));
}

/* Hover state class that will be added via JavaScript */
#world-map path.hovered {
  fill: #64b5f6 !important;
  stroke: #1976d2 !important;
  stroke-width: 1 !important;
}

#world-map g.hovered path {
  fill: #64b5f6 !important;
  stroke: #1976d2 !important;
  stroke-width: 1 !important;
}

/* Legacy class for compatibility */
.country {
  fill: #90a4ae;
  stroke: #ffffff;
  stroke-width: 0.5;
  transition: all 0.3s ease;
  cursor: pointer;
}

/* Remove hover - handled by JavaScript */

.country.highlighted {
  fill: #4caf50;
  stroke: #2e7d32;
  stroke-width: 1.5;
  filter: drop-shadow(0 0 5px rgba(76, 175, 80, 0.6));
}

.sidebar {
  width: 300px;
  background: #ffffff;
  border-left: 1px solid #e0e0e0;
}

.sidebar-content {
  padding: 20px;
  height: 100%;
}

#country-list {
  max-height: 600px;
  overflow-y: auto;
}

.country-item {
  display: flex;
  align-items: center;
  padding: 12px;
  margin-bottom: 8px;
  background: #f5f5f5;
  border-radius: 8px;
  transition: all 0.2s ease;
  cursor: pointer;
}

.country-item:hover {
  background: #e8f5e8;
  transform: translateX(5px);
}

.country-flag {
  font-size: 1.5rem;
  margin-right: 12px;
}

.country-name {
  font-family: "Poppins", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto,
    sans-serif;
  font-weight: 500;
  color: #333;
}

.placeholder {
  font-family: "Poppins", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto,
    sans-serif;
  color: #666;
  font-style: italic;
  padding: 40px 20px;
}

.loading {
  font-family: "Poppins", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto,
    sans-serif;
  padding: 20px;
  color: #666;
}

/* Responsive design */
@media (max-width: 768px) {
  .container {
    padding: 10px;
  }

  header h1 {
    font-size: 2rem;
  }

  .content-area {
    flex-direction: column;
  }

  .sidebar {
    width: 100%;
  }

  .letter-btn {
    width: 40px;
    height: 40px;
    font-size: 1rem;
  }

  #world-map {
    height: 300px;
  }
}

/* Custom scrollbar */
#country-list::-webkit-scrollbar {
  width: 6px;
}

#country-list::-webkit-scrollbar-track {
  background: #f1f1f1;
  border-radius: 3px;
}

#country-list::-webkit-scrollbar-thumb {
  background: #c0c0c0;
  border-radius: 3px;
}

#country-list::-webkit-scrollbar-thumb:hover {
  background: #a0a0a0;
}

/* Tooltip styles */
.tooltip {
  font-family: "Poppins", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto,
    sans-serif;
  position: absolute;
  background: rgba(0, 0, 0, 0.9);
  color: white;
  padding: 8px 12px;
  border-radius: 6px;
  font-size: 14px;
  font-weight: 500;
  z-index: 1000;
  pointer-events: none;
  opacity: 0;
  transform: translateY(10px);
  transition: all 0.2s ease;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
  backdrop-filter: blur(4px);
  white-space: nowrap;
}

.tooltip.visible {
  opacity: 1;
}

.tooltip::after {
  content: "";
  position: absolute;
  top: 100%;
  left: 50%;
  transform: translateX(-50%);
  border: 5px solid transparent;
  border-top-color: rgba(0, 0, 0, 0.9);
}
