@import url('https://fonts.googleapis.com/css2?family=Poppins&display=swap');

body {
  font-family: 'Poppins', sans-serif;
  background: linear-gradient(135deg, #e9fef7, #f0fdfb);
  margin: 0;
  padding: 0;
  color: #222;
  display: flex;
  justify-content: center;
}

.app-card {
  max-width: 420px;
  width: 100%;
  background: white;
  border-radius: 28px;
  box-shadow: 0 4px 18px rgba(0,0,0,0.1);
  padding: 1rem;
  margin: 1rem;
}

header h1 {
  text-align: center;
  margin: 0.5rem 0;
  font-size: 1.8rem;
  font-weight: 700;
  line-height: 1.2;
  color: white;
}

header {
  background-color: #00695c;
  border-radius: 20px;
  padding: 1rem;
}

nav {
  display: flex;
  justify-content: center;
  gap: 1rem;
  font-size: 0.9rem;
  margin-bottom: 0.5rem;
}

nav a {
  color: white;
  text-decoration: none;
  font-weight: 600;
}

.notification {
  background: #ffe082;
  border: 2px solid #ff9800;
  border-radius: 12px;
  padding: 1rem;
  margin: 1rem 0;
  color: #333;
  font-weight: bold;
  text-align: center;
  transition: all 0.3s ease;
}

.hidden {
  display: none;
}

.vuorossa-kortti {
  background: #e0f2f1;
  border: 2px solid #00695c;
  border-radius: 14px;
  padding: 1rem;
  margin: 1.2rem 0;
  text-align: center;
}

.vuorossa-nimi {
  font-weight: bold;
  font-size: 1.2rem;
  margin-bottom: 0.8rem;
}

.vuorossa-pisteet {
  display: flex;
  align-items: center;
  justify-content: space-around;
  gap: 0.5rem;
}

.vuorossa-pisteet input {
  font-size: 1.2rem;
  width: 80px;
  padding: 0.4rem;
  border-radius: 8px;
  border: 1px solid #aaa;
  text-align: center;
}

.vuorossa-pisteet button {
  padding: 0.4rem 1.2rem;
  background-color: #00796b;
  color: white;
  border: none;
  border-radius: 8px;
  font-weight: bold;
  cursor: pointer;
}

.controls {
  display: flex;
  justify-content: center;
  gap: 0.5rem;
  flex-wrap: wrap;
  margin-top: 1rem;
}

.controls input {
  padding: 0.5rem;
  border-radius: 6px;
  border: 1px solid #aaa;
}

.controls button {
  padding: 0.5rem 1.2rem;
  font-size: 1rem;
  border-radius: 8px;
  border: none;
  background: #4caf50;
  color: white;
  cursor: pointer;
}

#teamsContainer {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: 1rem;
  margin-top: 1rem;
}

/* Dark mode styles */
.dark-mode {
  background: #121212;
  color: #f0f0f0;
}

.dark-mode .app-card {
  background: #1e1e1e;
  color: #f0f0f0;
}

.dark-mode header {
  background-color: #333;
}

.dark-mode .vuorossa-kortti {
  background: #2a2a2a;
  border-color: #4caf50;
}

.dark-mode .controls button,
.dark-mode .vuorossa-pisteet button {
  background-color: #4caf50;
}

.dark-mode .controls button:hover,
.dark-mode .vuorossa-pisteet button:hover {
  background-color: #388e3c;
}

/* Theme toggle button */
.theme-toggle {
  margin-top: 0.5rem;
  background-color: #00695c;
  color: #fff;
  border: none;
  padding: 0.4rem 0.7rem;
  border-radius: 8px;
  cursor: pointer;
}

.dark-mode .theme-toggle {
  background-color: #4caf50;
}

.team-card {
  border-radius: 16px;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.05);
  padding: 1.2rem;
  background: white;
}

.team-color-0 {
  border: 2px solid #4caf50;
  background: #e8f5e9;
}
.team-color-1 {
  border: 2px solid #2196f3;
  background: #e3f2fd;
}
.team-color-2 {
  border: 2px solid #ff9800;
  background: #fff3e0;
}
.team-color-3 {
  border: 2px solid #9c27b0;
  background: #f3e5f5;
}

.team-card h3 {
  margin-top: 0;
  color: #00695c;
  font-size: 1.2rem;
  margin-bottom: 0.5rem;
}

.player-list {
  margin-bottom: 0.8rem;
  padding-left: 1rem;
  list-style-type: disc;
}

.player-list li {
  margin: 0.25rem 0;
  font-size: 0.95rem;
}

.team-card input[type="text"] {
  margin-top: 0.4rem;
  padding: 0.4rem 0.6rem;
  border-radius: 6px;
  border: 1px solid #aaa;
  width: calc(100% - 120px);
  max-width: 200px;
}

.add-player-btn {
  margin-left: 0.5rem;
  background: #2196f3;
  color: white;
  border: none;
  border-radius: 6px;
  padding: 0.5rem 1rem;
  font-size: 0.9rem;
  cursor: pointer;
}

@media (max-width: 600px) {
  body {
    flex-direction: column;
    align-items: center;
  }

  .controls {
    flex-direction: column;
  }

  .vuorossa-pisteet {
    flex-direction: column;
  }

  .team-card input[type="text"] {
    width: 100%;
    margin-bottom: 0.5rem;
  }

  .add-player-btn {
    width: 100%;
    margin-left: 0;
  }

  #teamsContainer {
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  }
}

@media (min-width: 601px) and (max-width: 1024px) {
  .app-card { max-width: 700px; }
  .controls { gap: 1rem; }
  #teamsContainer {
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 1rem;
  }
}

@media (min-width: 1025px) {
  .app-card { max-width: 900px; }
  .controls { gap: 1.2rem; }
  #teamsContainer {
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 1.2rem;
  }
}
