/* ===========================
   Statistik & Ersparnisse
   Responsive Dark-Gold Style
=========================== */
.stats-page {
  display: flex;
  justify-content: center;
  align-items: flex-start;
  min-height: 100vh;
  background-color: #1a1b2f;
  padding: 40px 20px;
  color: #f3f4f6;
}

.stats-card {
  width: 100%;
  max-width: 1200px;
  background-color: #2c2a4d;
  border-radius: 1rem;
  box-shadow: 0 12px 25px rgba(0, 0, 0, 0.4);
  padding: 2rem;
  position: relative;
  overflow: hidden;
}

/* Glow Effekt */
.stats-card::before {
  content: "";
  position: absolute;
  top: -40%;
  left: -40%;
  width: 200%;
  height: 200%;
  background: radial-gradient(circle at center, rgba(251,191,36,0.1), transparent 60%);
  animation: glowRotate 10s linear infinite;
  z-index: 0;
}
@keyframes glowRotate {
  0% { transform: rotate(0deg); }
  50% { transform: rotate(45deg); }
  100% { transform: rotate(0deg); }
}

.stats-card * {
  position: relative;
  z-index: 1;
}

/* Titel */
.stats-title {
  color: #fbbf24;
  font-weight: 700;
  font-size: 2rem;
  margin-bottom: 2rem;
  text-align: center;
}

/* Filter */
.stats-filter {
  text-align: center;
  margin-bottom: 2rem;
}
.stats-filter select {
  background-color: #1f2937;
  color: #f3f4f6;
  border: 1px solid #374151;
  border-radius: 50px;
  padding: 8px 16px;
  transition: all 0.3s ease;
}
.stats-filter select:focus {
  border-color: #fbbf24;
  box-shadow: 0 0 8px rgba(251,191,36,0.4);
  outline: none;
}

/* Grid Layout */
.stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 1.5rem;
}

/* Boxen */
.stats-box {
  background-color: #1f1d3a;
  border-radius: 1rem;
  padding: 1.5rem;
  box-shadow: 0 6px 15px rgba(0, 0, 0, 0.4);
  transition: all 0.3s ease;
}

.stats-box:hover {
  transform: translateY(-4px);
  box-shadow: 0 8px 20px rgba(251,191,36,0.2);
}

/* Text */
.stats-box h4 {
  font-weight: 700;
  margin-bottom: 1rem;
  display: flex;
  align-items: center;
  gap: 0.4rem;
}
.stats-box p {
  margin: 0.4rem 0;
  font-size: 0.95rem;
}

/* ===========================
   PROGRESSBAR – PREMIUM STYLE
=========================== */
.progress {
  background: linear-gradient(180deg, #2a2b45, #1a1b2f);
  border-radius: 50px;
  height: 16px;
  overflow: hidden;
  position: relative;
  box-shadow:
    inset 0 2px 6px rgba(0, 0, 0, 0.8),
    inset 0 1px 0 rgba(255, 255, 255, 0.1);
}

/* Gefüllter Teil */
.progress-bar {
  height: 100%;
  border-radius: 50px;
  font-size: 0.75rem;
  font-weight: 700;
  text-align: center;
  line-height: 16px;
  color: #111827;
  background-size: 200% 100%;
  background-repeat: no-repeat;
  transition: width 0.8s ease-in-out, box-shadow 0.3s ease;
  position: relative;
  overflow: hidden;
}

/* Dezente Bewegung im Verlauf */
.progress-bar.bg-warning {
  background-image: linear-gradient(90deg, #fcd34d 0%, #fbbf24 100%);
  box-shadow: 0 0 10px rgba(251, 191, 36, 0.4);
}
.progress-bar.bg-success {
  background-image: linear-gradient(90deg, #22c55e 0%, #16a34a 100%);
  box-shadow: 0 0 10px rgba(34, 197, 94, 0.4);
}
.progress-bar.bg-info {
  background-image: linear-gradient(90deg, #38bdf8 0%, #0ea5e9 100%);
  box-shadow: 0 0 10px rgba(56, 189, 248, 0.4);
}
.progress-bar.bg-danger {
  background-image: linear-gradient(90deg, #ef4444 0%, #dc2626 100%);
  box-shadow: 0 0 10px rgba(239, 68, 68, 0.4);
}

/* Shine Effekt – edel & subtil */
.progress-bar::after {
  content: "";
  position: absolute;
  top: 0;
  left: -30%;
  width: 40%;
  height: 100%;
  background: linear-gradient(
    120deg,
    rgba(255, 255, 255, 0.45) 0%,
    rgba(255, 255, 255, 0.15) 60%,
    rgba(255, 255, 255, 0) 100%
  );
  transform: skewX(-20deg);
  opacity: 0.5;
  animation: shine-glide 3.5s infinite ease-in-out;
}

@keyframes shine-glide {
  0% { left: -40%; opacity: 0; }
  30% { left: 0%; opacity: 0.6; }
  60% { left: 100%; opacity: 0.4; }
  100% { left: 110%; opacity: 0; }
}

/* Glanzlinie oben – subtiler Lichtreflex */
.progress-bar::before {
  content: "";
  position: absolute;
  top: 1px;
  left: 0;
  width: 100%;
  height: 40%;
  background: rgba(255, 255, 255, 0.25);
  opacity: 0.4;
  border-radius: 50px;
  pointer-events: none;
}

/* Smooth Hover-Effekt (optional) */
.progress-bar:hover {
  filter: brightness(1.08);
  box-shadow: 0 0 15px rgba(251, 191, 36, 0.6);
}


/* Premium Box */
.stats-box.premium {
  border: 1px solid #16a34a;
  box-shadow: 0 6px 20px rgba(22,163,74,0.3);
}

/* Gesperrte Box (Non-Premium) */
.stats-box.locked {
  background-color: #26264b;
  border: 1px dashed #6b7280;
  color: #9ca3af;
}
.premium-btn {
  display: inline-block;
  background: linear-gradient(90deg, #fcd34d, #fbbf24);
  color: #1a1b2f;
  padding: 10px 16px;
  border-radius: 50px;
  font-weight: 700;
  text-decoration: none;
  transition: all 0.3s ease;
}
.premium-btn:hover {
  background: linear-gradient(90deg, #fbbf24, #fcd34d);
  transform: scale(1.05);
}

/* Ziel Eingabe */
.goal-input {
  margin-top: 1.5rem;
}
.goal-input label {
  font-weight: 600;
  color: #f3f4f6;
  display: block;
  margin-bottom: 0.5rem;
}
.goal-row {
  display: flex;
  flex-wrap: wrap; /* <-- WICHTIG: erlaubt Umbruch */
  gap: 0.6rem;
}
.goal-row input {
  flex: 1;
  background-color: #1f2937;
  color: #f3f4f6;
  border: 1px solid #374151;
  border-radius: 50px;
  padding: 10px 16px;
  transition: all 0.3s ease;
  min-width: 0; /* verhindert Überlauf */
}
.goal-row input:focus {
  border-color: #fbbf24;
  box-shadow: 0 0 10px rgba(251,191,36,0.4);
  outline: none;
}
.goal-row button {
  flex: 0 0 auto;
  white-space: nowrap;
  background: linear-gradient(90deg, #22c55e, #16a34a);
  border: none;
  color: #fff;
  border-radius: 50px;
  padding: 10px 16px;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.3s ease;
}
/* Button Animation */
.goal-row button:hover {
  background: linear-gradient(90deg, #16a34a, #22c55e);
  transform: scale(1.05);
}

/* Canvas Charts */
canvas {
  width: 100% !important;
  margin-top: 0.8rem;
}

/* Responsive */
/* Mobile – Button unter Input */
@media (max-width: 992px) {
  .goal-row {
    flex-direction: column;
    align-items: stretch;
  }

  .goal-row button {
    width: 100%;
    text-align: center;
  }
}

@media (max-width: 992px) {
  .stats-grid {
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
  }
}

@media (max-width: 768px) {
  .stats-title {
    font-size: 1.6rem;
  }
  .stats-card {
    padding: 1.5rem;
  }
  .goal-row {
    flex-direction: column;
  }
  .goal-row button {
    width: 100%;
  }
}

@media (max-width: 480px) {
  .stats-title {
    font-size: 1.4rem;
  }
  .stats-box {
    padding: 1.2rem;
  }
  .progress {
    height: 12px;
  }
}
