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

body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  background: linear-gradient(135deg, #f8fafc 0%, #e2e8f0 100%);
  min-height: 100vh;
  color: #334155;
}

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

/* Header Styles */
.header {
  background: linear-gradient(135deg, #10b981 0%, #06b6d4 50%, #8b5cf6 100%);
  color: white;
  text-align: center;
  padding: 3rem 0;
}

.header-title {
  font-size: 3rem;
  font-weight: 700;
  margin-bottom: 1rem;
}

.header-subtitle {
  font-size: 1.125rem;
  opacity: 0.9;
  margin-bottom: 0.5rem;
}

.header-description {
  font-size: 0.875rem;
  opacity: 0.75;
}

/* Main Content */
.main {
  padding: 2rem 0;
}

/* Card Styles */
.card {
  background: white;
  border-radius: 12px;
  box-shadow: 0 10px 25px rgba(0, 0, 0, 0.1);
  margin-bottom: 2rem;
  overflow: hidden;
}

.card-header {
  text-align: center;
  padding: 2rem 1.5rem 1rem;
}

.card-title {
  font-size: 1.5rem;
  font-weight: 600;
  color: #7c3aed;
  margin-top: 1rem;
}

.card-content {
  padding: 0 1.5rem 1.5rem;
}

/* Hero Avatar */
.hero-avatar {
  width: 80px;
  height: 80px;
  margin: 0 auto;
  border-radius: 50%;
  overflow: hidden;
  border: 4px solid #e9d5ff;
}

.hero-avatar img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

/* Popular Heroes */
.popular-heroes {
  margin-bottom: 2rem;
}

.section-title {
  font-size: 0.875rem;
  font-weight: 500;
  color: #6b7280;
  margin-bottom: 0.75rem;
}

.hero-badges {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.badge {
  display: inline-block;
  padding: 0.5rem 1rem;
  background: #f1f5f9;
  color: #475569;
  border-radius: 20px;
  font-size: 0.875rem;
  cursor: pointer;
  transition: all 0.2s ease;
  border: 1px solid transparent;
}

.badge:hover {
  background: #e9d5ff;
  color: #7c3aed;
  border-color: #c4b5fd;
}

/* Form Styles */
.search-form {
  space-y: 1rem;
}

.form-group {
  margin-bottom: 1rem;
}

.form-group label {
  display: block;
  font-size: 0.875rem;
  font-weight: 500;
  color: #374151;
  margin-bottom: 0.5rem;
}

.input-wrapper {
  position: relative;
}

.input-icon {
  position: absolute;
  left: 12px;
  top: 50%;
  transform: translateY(-50%);
  color: #9ca3af;
  font-size: 0.875rem;
}

input[type="text"] {
  width: 100%;
  padding: 0.75rem 0.75rem 0.75rem 2.5rem;
  border: 2px solid #e5e7eb;
  border-radius: 8px;
  font-size: 1rem;
  transition: border-color 0.2s ease;
}

input[type="text"]:focus {
  outline: none;
  border-color: #7c3aed;
  box-shadow: 0 0 0 3px rgba(124, 58, 237, 0.1);
}

select {
  width: 100%;
  padding: 0.75rem;
  border: 2px solid #e5e7eb;
  border-radius: 8px;
  font-size: 1rem;
  background: white;
  cursor: pointer;
  transition: border-color 0.2s ease;
}

select:focus {
  outline: none;
  border-color: #7c3aed;
  box-shadow: 0 0 0 3px rgba(124, 58, 237, 0.1);
}

/* Button Styles */
.button-group {
  display: flex;
  gap: 0.75rem;
  margin-top: 1.5rem;
}

.btn {
  flex: 1;
  padding: 0.75rem 1rem;
  border: none;
  border-radius: 8px;
  font-size: 0.875rem;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.2s ease;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
}

.btn-outline {
  background: transparent;
  color: #ea580c;
  border: 2px solid #fed7aa;
}

.btn-outline:hover {
  background: #fff7ed;
}

.btn-primary {
  background: linear-gradient(135deg, #ec4899 0%, #ef4444 100%);
  color: white;
}

.btn-primary:hover {
  background: linear-gradient(135deg, #db2777 0%, #dc2626 100%);
}

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

/* Error Message */
.error-message {
  background: #fef2f2;
  color: #dc2626;
  padding: 0.75rem;
  border-radius: 8px;
  font-size: 0.875rem;
  text-align: center;
  margin-top: 1rem;
  border: 1px solid #fecaca;
}

/* Results Card */
.results-header {
  background: linear-gradient(135deg, #8b5cf6 0%, #3b82f6 50%, #10b981 100%);
  color: white;
  padding: 1.5rem;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.results-header .card-title {
  color: white;
  margin: 0;
}

.hero-type-badge {
  background: rgba(255, 255, 255, 0.2);
  color: white;
  padding: 0.25rem 0.75rem;
  border-radius: 12px;
  font-size: 0.75rem;
  font-weight: 500;
}

/* Hero Info */
.hero-info {
  display: flex;
  align-items: center;
  gap: 1rem;
  padding: 1.5rem;
  background: linear-gradient(135deg, #dbeafe 0%, #f3e8ff 100%);
  border-bottom: 1px solid #e5e7eb;
}

.hero-info-avatar {
  width: 64px;
  height: 64px;
  border-radius: 50%;
  overflow: hidden;
  border: 3px solid white;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

.hero-info-avatar img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.hero-name {
  font-size: 1.25rem;
  font-weight: 700;
  color: #1f2937;
  margin-bottom: 0.5rem;
}

.hero-stats {
  display: flex;
  gap: 1rem;
}

.stat {
  display: flex;
  align-items: center;
  gap: 0.25rem;
  font-size: 0.875rem;
  color: #6b7280;
}

.stat i {
  color: #f59e0b;
}

/* Rankings Table */
.table-header {
  display: grid;
  grid-template-columns: 1fr 1fr;
  background: #d1fae5;
  color: #065f46;
  font-weight: 600;
}

.table-cell {
  padding: 0.75rem 1.5rem;
  text-align: center;
}

.ranking-section {
  border-bottom: 1px solid #e5e7eb;
}

.section-header {
  padding: 0.5rem 1.5rem;
  font-size: 0.875rem;
  font-weight: 500;
  display: flex;
  align-items: center;
  gap: 0.5rem;
  border-bottom: 1px solid currentColor;
}

.province-section {
  background: #ecfdf5;
}

.province-section .section-header {
  color: #059669;
  border-bottom-color: #a7f3d0;
}

.city-section {
  background: #eff6ff;
}

.city-section .section-header {
  color: #2563eb;
  border-bottom-color: #bfdbfe;
}

.county-section {
  background: #faf5ff;
}

.county-section .section-header {
  color: #7c3aed;
  border-bottom-color: #ddd6fe;
}

.ranking-item {
  display: grid;
  grid-template-columns: 1fr 1fr;
  border-bottom: 1px solid rgba(0, 0, 0, 0.05);
  transition: background-color 0.2s ease;
}

.ranking-item:hover {
  background: rgba(255, 255, 255, 0.5);
}

.ranking-item .location {
  padding: 0.75rem 1.5rem;
  font-size: 0.875rem;
}

.ranking-item .power {
  padding: 0.75rem 1.5rem;
  font-size: 0.875rem;
  text-align: center;
  font-weight: 500;
  color: #7c3aed;
}

/* Results Footer */
.results-footer {
  padding: 1rem 1.5rem;
  background: #f9fafb;
  text-align: center;
  font-size: 0.75rem;
  color: #6b7280;
}

.update-time {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  margin-bottom: 0.5rem;
}

/* Loading Overlay */
.loading-overlay {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.5);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1000;
}

.loading-spinner {
  background: white;
  padding: 2rem;
  border-radius: 12px;
  text-align: center;
  box-shadow: 0 20px 40px rgba(0, 0, 0, 0.2);
}

.loading-spinner i {
  font-size: 2rem;
  color: #7c3aed;
  margin-bottom: 1rem;
}

.loading-spinner p {
  color: #6b7280;
  font-weight: 500;
}

/* Responsive Design */
@media (max-width: 768px) {
  .header-title {
    font-size: 2rem;
  }

  .container {
    padding: 0 0.75rem;
  }

  .button-group {
    flex-direction: column;
  }

  .hero-info {
    flex-direction: column;
    text-align: center;
  }

  .hero-stats {
    justify-content: center;
  }

  .results-header {
    flex-direction: column;
    gap: 0.5rem;
    text-align: center;
  }
}

@media (max-width: 480px) {
  .hero-badges {
    justify-content: center;
  }

  .badge {
    font-size: 0.75rem;
    padding: 0.375rem 0.75rem;
  }
}
