:root {
  --primary: #00ffcc;
  --bg-color: #0b0f19;
  --glass-bg: rgba(20, 28, 47, 0.6);
  --glass-border: rgba(255, 255, 255, 0.1);
  --text-light: #f8fafc;
  --text-muted: #94a3b8;
  --glow-color: rgba(0, 255, 204, 0.3);
}

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

body {
  background-color: var(--bg-color);
  color: var(--text-light);
  font-family: 'Outfit', sans-serif;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 40px 20px;
  background-image: 
    radial-gradient(circle at 15% 50%, rgba(20, 28, 47, 0.8), transparent 25%),
    radial-gradient(circle at 85% 30%, rgba(0, 255, 204, 0.05), transparent 25%);
}

h1 {
  font-size: 3rem;
  font-weight: 700;
  margin-bottom: 30px;
  background: linear-gradient(90deg, #fff, var(--primary));
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  text-shadow: 0 0 30px var(--glow-color);
}

.search-container {
  display: flex;
  gap: 15px;
  margin-bottom: 20px;
  flex-wrap: wrap;
  justify-content: center;
  width: 100%;
  max-width: 1000px;
}

input, select {
  padding: 15px 25px;
  font-size: 1.1rem;
  border-radius: 30px;
  border: 1px solid var(--glass-border);
  background: rgba(255, 255, 255, 0.05);
  color: #fff;
  outline: none;
  font-family: 'Outfit', sans-serif;
  transition: all 0.3s ease;
  backdrop-filter: blur(10px);
}

input {
  flex: 1;
  min-width: 200px;
}

select {
  flex: 1;
  min-width: 180px;
  appearance: none;
  background-image: url("data:image/svg+xml;charset=US-ASCII,%3Csvg%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%20width%3D%22292.4%22%20height%3D%22292.4%22%3E%3Cpath%20fill%3D%22%2300ffcc%22%20d%3D%22M287%2069.4a17.6%2017.6%200%200%200-13-5.4H18.4c-5%200-9.3%201.8-12.9%205.4A17.6%2017.6%200%200%200%200%2082.2c0%205%201.8%209.3%205.4%2012.9l128%20127.9c3.6%203.6%207.8%205.4%2012.8%205.4s9.2-1.8%2012.8-5.4L287%2095c3.5-3.5%205.4-7.8%205.4-12.8%200-5-1.9-9.2-5.5-12.8z%22%2F%3E%3C%2Fsvg%3E");
  background-repeat: no-repeat;
  background-position: right 20px top 50%;
  background-size: 12px auto;
  cursor: pointer;
}

select option {
  background-color: var(--bg-color);
  color: #fff;
}

input:focus, select:focus {
  border-color: var(--primary);
  box-shadow: 0 0 15px var(--glow-color);
}

button {
  padding: 15px 30px;
  font-size: 1.1rem;
  font-weight: 600;
  border-radius: 30px;
  border: none;
  background: var(--primary);
  color: #0b0f19;
  cursor: pointer;
  font-family: 'Outfit', sans-serif;
  transition: all 0.3s ease;
  box-shadow: 0 5px 20px rgba(0, 255, 204, 0.4);
}

button:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 25px rgba(0, 255, 204, 0.6);
  background: #00e6b8;
}

#loader {
  margin-top: 30px;
  font-size: 1.2rem;
  color: var(--primary);
  animation: pulse 1.5s infinite;
}

@keyframes pulse {
  0% { opacity: 0.6; }
  50% { opacity: 1; text-shadow: 0 0 10px var(--glow-color); }
  100% { opacity: 0.6; }
}

#result {
  width: 100%;
  max-width: 1200px;
  margin-top: 40px;
}

.teams-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 30px;
}

.team-card {
  perspective: 1000px;
  transition: transform 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

.card-glass-panel {
  background: var(--glass-bg);
  border: 1px solid var(--glass-border);
  border-radius: 20px;
  padding: 30px;
  height: 100%;
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  display: flex;
  flex-direction: column;
  transition: all 0.4s ease;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3);
  overflow: hidden;
  position: relative;
}

.team-card:hover {
  transform: translateY(-10px);
}

.team-card:hover .card-glass-panel {
  border-color: rgba(0, 255, 204, 0.4);
  box-shadow: 0 15px 40px rgba(0, 255, 204, 0.15);
}

.logo-wrapper {
  display: flex;
  justify-content: center;
  align-items: center;
  height: 160px;
  margin-bottom: 20px;
  position: relative;
  z-index: 2;
}

.logo-wrapper img {
  max-width: 140px;
  max-height: 140px;
  object-fit: contain;
  filter: drop-shadow(0 15px 25px rgba(0,0,0,0.4));
  transition: transform 0.5s ease;
}

.team-card:hover .logo-wrapper img {
  transform: scale(1.1) rotate(2deg);
}

.card-content {
  flex-grow: 1;
  display: flex;
  flex-direction: column;
  position: relative;
  z-index: 2;
}

.card-content h2 {
  font-size: 1.6rem;
  margin-bottom: 20px;
  text-align: center;
  letter-spacing: 0.5px;
}

.info-row {
  display: flex;
  justify-content: space-between;
  padding: 12px 0;
  border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}

.info-row:last-child {
  border-bottom: none;
}

.info-label {
  color: var(--text-muted);
  font-size: 0.9rem;
  text-transform: uppercase;
  letter-spacing: 1px;
}

.info-value {
  font-weight: 600;
  color: var(--text-light);
  text-align: right;
  max-width: 65%;
  word-wrap: break-word;
}

.error-msg {
  text-align: center;
  font-size: 1.2rem;
  color: #ff4d4d;
  background: rgba(255, 77, 77, 0.1);
  padding: 20px;
  border-radius: 12px;
  border: 1px solid rgba(255, 77, 77, 0.3);
  max-width: 500px;
  margin: 0 auto;
}

#favoritesContainer {
  width: 100%;
  max-width: 1200px;
  margin-top: 20px;
}

.section-title {
  font-size: 2rem;
  font-weight: 600;
  margin-bottom: 25px;
  text-align: center;
  background: linear-gradient(90deg, #ffd700, #ff8c00);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  text-shadow: 0 0 20px rgba(255, 215, 0, 0.2);
}

.divider {
  border: 0;
  height: 1px;
  background: var(--glass-border);
  margin: 40px 0;
  width: 100%;
}

.fav-btn {
  position: absolute;
  top: 15px;
  right: 15px;
  background: none;
  border: none;
  font-size: 2rem;
  color: rgba(255, 255, 255, 0.2);
  cursor: pointer;
  z-index: 10;
  padding: 0;
  box-shadow: none;
  transition: all 0.2s ease;
  width: auto;
  min-width: unset;
}

.fav-btn:hover {
  transform: scale(1.15);
  box-shadow: none;
  background: none;
  color: rgba(255, 255, 255, 0.6);
}

.fav-btn.active {
  color: #ffd700;
  text-shadow: 0 0 15px rgba(255, 215, 0, 0.6);
}

.fav-btn.active:hover {
  color: #ffc107;
}

@media (max-width: 600px) {
  .search-container {
    flex-direction: column;
  }
  
  input, select, button {
    width: 100%;
    margin-right: 0;
  }
  
  .teams-grid {
    grid-template-columns: 1fr;
  }
}

/* Theme Toggle Button */
.theme-toggle {
  position: fixed;
  bottom: 30px;
  right: 30px;
  width: 50px;
  height: 50px;
  border-radius: 50%;
  background: var(--glass-bg);
  border: 1px solid var(--glass-border);
  box-shadow: 0 4px 15px rgba(0,0,0,0.2);
  font-size: 1.5rem;
  display: flex;
  justify-content: center;
  align-items: center;
  cursor: pointer;
  z-index: 1000;
  transition: all 0.3s ease;
  backdrop-filter: blur(10px);
}

.theme-toggle:hover {
  transform: scale(1.1) rotate(15deg);
  box-shadow: 0 6px 20px var(--glow-color);
}

/* Light Theme Variables & Overrides */
body.light-theme {
  --bg-color: #f0f4f8;
  --glass-bg: rgba(255, 255, 255, 0.7);
  --glass-border: rgba(0, 0, 0, 0.1);
  --text-light: #1e293b;
  --text-muted: #64748b;
  --glow-color: rgba(0, 255, 204, 0.3);
  background-image: 
    radial-gradient(circle at 15% 50%, rgba(255, 255, 255, 0.8), transparent 25%),
    radial-gradient(circle at 85% 30%, rgba(0, 255, 204, 0.15), transparent 25%);
}

body.light-theme button#searchBtn {
  color: #0b0f19;
}

body.light-theme input, 
body.light-theme select {
  background: rgba(0, 0, 0, 0.05);
  color: #1e293b;
}

body.light-theme select option {
  background-color: #f0f4f8;
  color: #1e293b;
}

body.light-theme .fav-btn {
  color: rgba(0, 0, 0, 0.2);
}

body.light-theme .fav-btn:hover {
  color: rgba(0, 0, 0, 0.6);
}

body.light-theme .fav-btn.active {
  color: #f59e0b;
}

body.light-theme h1 {
  background: linear-gradient(90deg, #1e293b, #059669);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
}
