/* public/style.css */

/* 0) Globales box-sizing */
*, *::before, *::after {
  box-sizing: border-box;
}

/* 1) Body (dunkles Theme) */
body {
  margin: 0;
  font-family: 'Arial', sans-serif;
  background-color: #1c2531;
  color: #fff;
  min-height: 100vh;
}

/* 2) Grid Layout */
.dashboard-grid {
  display: grid;
  grid-template-columns: 1fr 1fr 1fr;
  grid-template-rows: 1fr 1fr;
  grid-template-areas:
    "lastSale agentStats recentSales"
    "monthTotal agentStats recentSales";
  
  min-width: 1200px;
  height: 100vh;
  
  gap: 20px;
  padding: 20px;
  box-sizing: border-box;
}

.admin-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  grid-auto-rows: auto; /* Ermöglicht dynamische Höhen */
  gap: 20px;
  padding: 20px;
  box-sizing: border-box;
}

/* 3) Grid Areas Zuweisung */
.last-sale { grid-area: lastSale; }
.agent-stats { grid-area: agentStats; }
.recent-sales { grid-area: recentSales; }
.month-total { grid-area: monthTotal; }

/* 4) Allgemeine Karten-Styling */
.card {
  background: #2c3450; 
  border-radius: 8px;
  padding: 20px;
  box-shadow: 0 4px 10px rgba(0,0,0,0.4);
  display: flex;
  flex-direction: column;
  color: #fff;
  /* Entferne allgemeine overflow-Eigenschaft */
}

/* Spezifische Anpassungen für Dashboard-Karten */
.dashboard-grid .card {
  overflow: hidden; /* Entfernt Scrollbars nur im Dashboard */
}

/* Spezifische Anpassungen für Admin-Karten */
.admin-grid .card {
  overflow: visible; /* Erlaubt das Anzeigen des gesamten Inhalts ohne Scrollbars */
  height: auto; /* Entferne feste Höhen, um die Karte automatisch an den Inhalt anzupassen */
}

/* Überschriften in Cards */
.card h2 {
  margin-top: 0;
  text-align: center;
  font-size: 1.4rem;
  margin-bottom: 10px;
  border-bottom: 1px solid #444;
  padding-bottom: 10px;
  color: #fff;
}

.card h3 {
  margin: 10px 0;
  font-size: 1.2rem;
  color: #f0ba44;
}

/* 5) Highlight (Letzter Verkauf) - Pop-Effekt */
.highlight {
  background-color: transparent; /* Setzt den Hintergrund transparent */
  border: none; /* Entfernt den Rahmen */
  border-radius: 8px;
  padding: 20px;
  margin-top: 20px;
  text-align: center;
  font-size: 1.2rem;
  animation: pop 2s infinite;
}

/* Verstecke das Zeit-Element innerhalb der Highlight-Klasse */
.highlight p strong {
  display: none;
}

@keyframes pop {
  0%   { transform: scale(1); }
  20%  { transform: scale(1.1); }
  40%  { transform: scale(0.9); }
  60%  { transform: scale(1.2); }
  80%  { transform: scale(0.95); }
  100% { transform: scale(1); }
}

/* Größeres Foto beim letzten Verkauf */
.last-sale-photo {
  width: 150px; /* Vergrößert von 100px auf 150px */
  height: 150px; /* Vergrößert von 100px auf 150px */
  border-radius: 50%;
  margin-top: 15px;
  object-fit: cover;
}

/* Falls kein Verkauf */
.no-sales {
  background: #4f2733;
  border-radius: 8px;
  padding: 15px;
  color: #ffb3b3;
  font-size: 1.2rem;
  text-align: center;
}

/* 6) Fotos für Agenten + Sales (klein) */
.agent-photo,
.sale-photo {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  object-fit: cover;
  margin-right: 8px;
  vertical-align: middle;
}

/* 7) Letzte 10 Verkäufe */
.recent-sales ul {
  list-style: none;
  margin: 0;
  padding: 0;
}

.recent-sales li {
  background: #3a4162; 
  margin-bottom: 8px;
  padding: 10px;
  border-radius: 4px;
  display: flex;
  align-items: center; /* Foto + Text zentriert */
  font-size: 1rem;
  color: #fff;
  justify-content: flex-start;
}

.recent-sales li span {
  font-weight: bold;
  color: #f0ba44;
  margin-right: 8px;
}

/* 8) Verkaufszahlen pro Agent */
.agent-stats table {
  border-collapse: collapse;
  width: 100%;
  color: #fff;
}

.agent-stats th,
.agent-stats td {
  border: 1px solid #444;
  padding: 10px;
  text-align: left;
  font-size: 1rem;
}

.agent-stats th {
  background: #3c4460;
}

.agent-stats .agent-photo {
  width: 40px;
  height: 40px;
  object-fit: cover;
  border-radius: 50%;
  margin-right: 10px;
}

/* Balken-Hintergrund */
.bar {
  background: #444;
  border-radius: 6px;
  height: 20px;
  width: 100%;
  overflow: hidden;
  position: relative;
}

.bar-fill {
  background: #f0ba44;
  color: #fff; /* Weißer Text für bessere Lesbarkeit */
  display: inline-block;
  height: 100%;
  line-height: 20px;
  text-align: center;
  white-space: nowrap;
  box-sizing: border-box;
  border-radius: 6px;
}

/* 9) Verkäufe heute */
.month-total-box {
  margin: 20px auto 0 auto;
  font-size: 2rem;
  background: #3b435f;
  display: inline-block;
  padding: 15px 30px;
  border-radius: 8px;
  text-align: center;
  box-shadow: inset 0 0 5px rgba(0,0,0,0.3);
  color: #fefefe;
}

/* Tagesziel-Box + Balken (angepasst) */
.month-goal-box {
  margin-top: 20px; /* Reduziert von 40px auf 20px */
  text-align: center;
}

.month-goal-box h2 {
  font-size: 1.6rem; /* Erhöht die Schriftgröße der Überschrift */
}

.month-goal-box p {
  font-size: 1rem; /* Verkleinerte Schriftgröße */
  color: #fff; /* Weißer Text für bessere Lesbarkeit */
}

.goal-bar {
  background: #444;
  border-radius: 6px;
  height: 30px; /* größerer Balken */
  width: 80%;
  margin: 10px auto;
  overflow: hidden;
  position: relative;
}

.goal-bar-fill {
  height: 100%;
  background: #f0ba44; /* gold/gelb */
  width: 0;
  transition: width 1s ease, background-color 0.5s ease;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #fff; /* Weißer Text für bessere Lesbarkeit */
  font-weight: bold;
}

/* 10) Kreisförmiger Fortschrittsbalken */
.progress-container {
  display: flex;
  justify-content: center;
  align-items: center;
  margin: 20px 0; /* Reduzierter Abstand für kleinere Karte */
}

.circular-progress {
  position: relative;
  width: 150px; /* Verkleinerte Größe */
  height: 150px; /* Verkleinerte Größe */
}

.circular-progress svg {
  transform: rotate(-90deg);
  width: 100%;
  height: 100%;
}

.circular-progress circle {
  fill: none;
  stroke-width: 15;
  stroke-linecap: round;
}

.circular-progress .bg {
  stroke: #eee;
}

.circular-progress .progress {
  stroke: #f0ba44; /* Standardfarbe */
  transition: stroke-dashoffset 0.5s ease, stroke 0.5s ease;
}

.circular-progress .percentage {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  font-size: 1rem; /* Verkleinerte Schriftgröße */
  font-weight: bold;
  color: #fff; /* Weißer Text für bessere Lesbarkeit */
  text-align: center;
}

/* Zusätzliche Infos */
.additional-info p {
  font-size: 1rem; /* Verkleinerte Schriftgröße */
  color: #fff; /* Weißer Text für bessere Lesbarkeit */
  text-align: center;
}

/* 11) Buttons */
.btn {
  padding: 10px 20px;
  border: none;
  border-radius: 4px;
  cursor: pointer;
  text-decoration: none;
  display: inline-block;
  transition: opacity 0.3s ease;
}

.btn.primary {
  background-color: #f0ba44;
  color: #000;
}

.btn.secondary {
  background-color: #4caf50;
  color: #fff;
}

.btn:hover {
  opacity: 0.9;
}

/* 12) Listen innerhalb der Admin-Grid */
.agent-list,
.recent-sales-admin ul {
  list-style: none;
  padding: 0;
  margin: 0;
}

.agent-item,
.sale-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: #3a4162;
  padding: 10px;
  border-radius: 4px;
  margin-bottom: 8px;
}

.agent-item .agent-name,
.sale-item .sale-name {
  font-weight: bold;
}

.agent-photo,
.sale-photo {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  object-fit: cover;
  margin-left: 10px;
}

/* Löschlinks */
.delete-link {
  color: red;
  text-decoration: none;
  margin-left: 10px;
  font-size: 1.2rem;
}

.delete-link:hover {
  color: #e74c3c;
}

/* Dynamisches Verkaufsformular */
.sale-entry-group {
  display: flex;
  align-items: center;
  margin-bottom: 10px;
  gap: 10px;
}

.sale-entry-group label {
  flex: 1;
  font-weight: bold;
}

.sale-entry-group select,
.sale-entry-group input {
  flex: 2;
  padding: 8px;
  border: 1px solid #444;
  border-radius: 4px;
  background-color: #1c2531;
  color: #fff;
}

.remove-sale-btn {
  background-color: #e74c3c;
  color: #fff;
  border: none;
  padding: 8px 12px;
  border-radius: 4px;
  cursor: pointer;
}

.remove-sale-btn:hover {
  background-color: #c0392b;
}

.add-sale-btn {
  background-color: #2ecc71;
  color: #fff;
  border: none;
  padding: 10px 15px;
  border-radius: 4px;
  cursor: pointer;
  margin-top: 10px;
}

.add-sale-btn:hover {
  background-color: #27ae60;
}

/* 13) Login-Formular Styling */
.login-container {
  width: 300px;
  margin: 100px auto;
  padding: 20px;
  background-color: #2c3450;
  border-radius: 8px;
  box-shadow: 0 4px 10px rgba(0,0,0,0.4);
  color: #fff;
}

.login-container h2 {
  text-align: center;
  margin-bottom: 20px;
}

.form-group {
  margin-bottom: 15px;
}

.form-group label {
  display: block;
  margin-bottom: 5px;
  font-weight: bold;
}

.form-group input {
  width: 100%;
  padding: 8px;
  border: 1px solid #444;
  border-radius: 4px;
  background-color: #1c2531;
  color: #fff;
}

.error-message {
  background-color: #e74c3c;
  padding: 10px;
  border-radius: 4px;
  text-align: center;
  margin-bottom: 15px;
}

/* Responsive Anpassungen */
@media (min-width: 1200px) {
  .header h1 {
    font-size: 2.5rem;
  }
  .btn {
    font-size: 1rem;
  }
  .form-group input,
  .form-group select {
    font-size: 1rem;
  }
}

@media (max-width: 1200px) {
  .dashboard-grid {
    grid-template-columns: 1fr 1fr;
    grid-template-rows: repeat(auto-fill, minmax(300px, 1fr));
    grid-template-areas:
      "lastSale agentStats"
      "recentSales recentSales"
      "monthTotal monthTotal";
    min-width: unset;
    height: auto;
  }

  .month-total-box {
    font-size: 2rem;
    padding: 10px 20px;
  }

  .goal-bar {
    width: 90%;
  }
}

@media (max-width: 600px) {
  .circular-progress {
    width: 120px; /* Weitere Verkleinerung auf kleinen Bildschirmen */
    height: 120px;
  }
  .circular-progress .percentage {
    font-size: 0.9rem;
  }

  .header {
    flex-direction: column;
    align-items: flex-start;
  }

  .header .logo {
    margin-bottom: 10px;
  }

  .dashboard {
    padding: 10px;
  }

  .dashboard h2 {
    font-size: 1.5rem;
  }

  .month-total-box {
    font-size: 1.5rem;
  }

  .additional-info p {
    font-size: 1rem;
  }

  /* Anpassung der Grid-Layouts für kleine Bildschirme */
  .dashboard-grid {
    grid-template-columns: 1fr;
    grid-template-rows: repeat(auto-fill, minmax(300px, 1fr));
    grid-template-areas:
      "lastSale"
      "agentStats"
      "recentSales"
      "monthTotal";
    min-width: unset;
    height: auto;
  }
}

/* 14) Scoreboard Styling (außerhalb der Media Queries) */
.scoreboard-container {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  height: 100vh; /* Volle Höhe für eine Bühnen-ähnliche Darstellung */
  background-color: #1c2531; /* Dunkler Hintergrund, passend zum Dashboard */
}

.scoreboard-container h1 {
  font-size: 3.9rem; /* Erhöhte Schriftgröße um ~30% */
  margin-bottom: 80px; /* Vergrößerter Abstand nach unten */
  color: #f0ba44;
  text-shadow: 2px 2px 4px rgba(0,0,0,0.5);
}

.stage {
  display: grid;
  grid-template-columns: 1fr 2fr 1fr; /* Drei Spalten: Links, Mitte, Rechts */
  grid-template-areas: "podium2 podium1 podium3";
  align-items: end; /* Vertikale Ausrichtung nach unten */
  width: 100%;
  max-width: 1300px; /* Größere maximale Breite */
  gap: 20px; /* Abstand zwischen den Podien */
}

.podium1 {
  grid-area: podium1;
  display: flex;
  flex-direction: column;
  align-items: center;
  z-index: 3; /* Höherer Z-Index für Sichtbarkeit */
  transform: translateY(-40px); /* Größere Hebung */
}

.podium2 {
  grid-area: podium2;
  display: flex;
  flex-direction: column;
  align-items: center;
  z-index: 2;
  transform: translateY(-25px); /* Mittlere Hebung */
}

.podium3 {
  grid-area: podium3;
  display: flex;
  flex-direction: column;
  align-items: center;
  z-index: 1;
  transform: translateY(-10px); /* Minimale Hebung */
}

/* Gemeinsame Agenten-Stile */
.agent-photo {
  border-radius: 50%;
  object-fit: cover;
  transition: transform 0.3s;
}

.agent-photo:hover {
  transform: scale(1.05); /* Leichtes Vergrößern bei Hover */
}

.podium1 .agent-photo {
  width: 260px; /* Vergrößerte Größe um ~30% */
  height: 260px;
  border: 7px solid #f0ba44; /* Dickere Umrandung */
  box-shadow: 0 6px 20px rgba(0,0,0,0.6);
}

.podium2 .agent-photo {
  width: 200px; /* Vergrößerte Größe um ~30% */
  height: 200px;
  border: 5px solid #f0ba44;
  box-shadow: 0 4px 15px rgba(0,0,0,0.6);
}

.podium3 .agent-photo {
  width: 160px; /* Vergrößerte Größe um ~30% */
  height: 160px;
  border: 4px solid #f0ba44;
  box-shadow: 0 3px 12px rgba(0,0,0,0.6);
}

.podium1 h2,
.podium2 h2,
.podium3 h2 {
  margin-top: 15px;
  color: #fff;
}

.podium1 h2 {
  font-size: 2.34rem; /* Erhöhte Schriftgröße um ~30% */
}

.podium2 h2 {
  font-size: 1.82rem;
}

.podium3 h2 {
  font-size: 1.56rem;
}

.podium1 p,
.podium2 p,
.podium3 p {
  margin-top: 8px;
  color: #f0ba44;
}

.podium1 p {
  font-size: 1.56rem; /* Erhöhte Schriftgröße um ~30% */
}

.podium2 p {
  font-size: 1.3rem;
}

.podium3 p {
  font-size: 1.04rem;
}

/* Beine/Füße entfernen oder anpassen */
.agent-body .legs {
  display: none; /* Beine/Füße entfernen */
}

/* Animationen */

@keyframes dance {
  0% { transform: translateY(0) rotate(0deg); }
  25% { transform: translateY(-15px) rotate(5deg); }
  50% { transform: translateY(0) rotate(0deg); }
  75% { transform: translateY(-15px) rotate(-5deg); }
  100% { transform: translateY(0) rotate(0deg); }
}

@keyframes spin {
  0% { transform: rotate(0deg); }
  100% { transform: rotate(360deg); }
}

@keyframes confetti {
  0% { opacity: 0; transform: translateY(0) rotate(0deg); }
  50% { opacity: 1; transform: translateY(20px) rotate(180deg); }
  100% { opacity: 0; transform: translateY(40px) rotate(360deg); }
}

/* Animation-Klassen */
.animate-dance {
  animation: dance 2s infinite;
}

.animate-spin {
  animation: spin 2s linear infinite;
}

.animate-confetti {
  animation: confetti 3s ease-in-out infinite;
}

/* Responsive Anpassungen */
@media (min-width: 1200px) {
  .scoreboard-container h1 {
    font-size: 4.5rem; /* Weitere Erhöhung bei großen Bildschirmen */
  }
}

@media (max-width: 1200px) {
  .scoreboard-container h1 {
    font-size: 3.5rem; /* Anpassung für mittlere Bildschirme */
  }
  
  .stage {
    max-width: 1000px; /* Anpassung der maximalen Breite */
  }
}

@media (max-width: 600px) {
  .scoreboard-container h1 {
    font-size: 3rem; /* Anpassung für kleine Bildschirme */
  }
  
  .stage {
    grid-template-columns: 1fr; /* Einspaltiges Layout auf kleinen Bildschirmen */
    grid-template-areas:
      "podium1"
      "podium2"
      "podium3";
    transform: none;
    justify-items: center;
  }
  
  .podium1,
  .podium2,
  .podium3 {
    transform: translateY(0);
  }
  
  .podium1 .agent-photo,
  .podium2 .agent-photo,
  .podium3 .agent-photo {
    width: 180px; /* Verkleinerung der Bilder auf kleinen Bildschirmen */
    height: 180px;
  }
  
  .podium1 h2,
  .podium2 h2,
  .podium3 h2 {
    font-size: 1.8rem;
  }
  
  .podium1 p,
  .podium2 p,
  .podium3 p {
    font-size: 1.2rem;
  }
}
