/* Basis-Layout für den Adventskalender
 * Fokus: responsives Grid + Modal, einfache, stabile Styles.
 */

*,
*::before,
*::after {
  box-sizing: border-box;
}

body {
  margin: 0;
  font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  background: #000;
  color: #f8f5ec;
}

.calendar-page {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  background: #000;
  padding: 1rem 0;
}

.image-frame {
  position: relative;
  max-width: 900px;
  width: 100%;
}

.calendar-image {
  width: 100%;
  height: auto;
  display: block;
}

.calendar-wrapper {
  position: absolute;
  left: 50%;
  transform: translateX(-50%);
  /* Platzierung: Türen starten mit kleinem Abstand unter „Adventskalender“
     und enden ungefähr im unteren 30 % des Bildes */
  top: 54%;
  width: 80%;
  padding: 0.75rem;
  background: rgba(0,0,0,0.55);
  border-radius: 18px;
  box-shadow: 0 10px 25px rgba(0,0,0,0.8);
}

.calendar-grid {
  display: grid;
  gap: 0.25rem;
  /* Immer 6 Kästchen pro Reihe, 4 Reihen entstehen automatisch */
  grid-template-columns: repeat(6, minmax(0, 1fr));
}

/* Intro-Button unter dem Grid */
.intro-button-wrapper {
  margin-top: 1rem;
  text-align: center;
}

.intro-button {
  padding: 0.75rem 2rem;
  border-radius: 10px;
  border: 2px solid #ffd480;
  background: rgba(255, 212, 128, 0.15);
  color: #ffd480;
  font-weight: 600;
  font-size: 1rem;
  cursor: pointer;
  transition: all 0.2s ease;
  box-shadow: 0 4px 12px rgba(0,0,0,0.4);
}

.intro-button:hover {
  background: rgba(255, 212, 128, 0.25);
  transform: translateY(-2px);
  box-shadow: 0 6px 16px rgba(0,0,0,0.5);
}

.intro-button:active {
  transform: translateY(0);
}

.door {
  position: relative;
  padding-top: 100%; /* Quadrat */
  border-radius: 10px;
  border: 1px solid rgba(255,215,128,0.7);
  background: rgba(0,40,40,0.85);
  box-shadow: 0 5px 12px rgba(0,0,0,0.7);
  cursor: pointer;
  overflow: hidden;
  transition: transform 0.2s ease, box-shadow 0.2s ease, background 0.2s ease;
}

.door-number {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.6rem;
  font-weight: 700;
  color: #ffd480; /* golden */
  text-shadow: 0 0 6px rgba(0,0,0,0.9);
}

/* Türen mit verstrichenem Datum (Vergangenheit) */
.door-past {
  background: rgba(10, 80, 80, 0.95);
  border-color: rgba(255, 235, 150, 1);
  box-shadow: 0 8px 18px rgba(0,0,0,0.9);
}

.door-past .door-number {
  color: #ffe9a3;
}

/* heutiges Datum: invertierte Farben */
.door-today {
  background: #ffd480;
  border-color: #ffd480;
  box-shadow: 0 8px 18px rgba(0,0,0,0.9);
}

.door-today .door-number {
  color: #0a3030;
}

.door:hover {
  transform: translateY(-2px);
  background: rgba(10,80,80,0.95);
  box-shadow: 0 8px 18px rgba(0,0,0,0.85);
}

/* Modal */
.modal-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.85);
  display: none;
  align-items: center;
  justify-content: center;
  z-index: 50;
}

.modal-backdrop.active {
  display: flex;
}

.modal-window {
  width: 100%;
  max-width: 800px;
  max-height: 90vh;
  overflow-y: auto;
  background: #0c0f14;
  border-radius: 18px;
  padding: 1.5rem;
  box-shadow: 0 20px 40px rgba(0,0,0,0.9);
  border: 1px solid rgba(255,255,255,0.2);
}

.modal-close {
  position: absolute;
  top: 1rem;
  right: 1.2rem;
  background: none;
  border: none;
  color: #fff;
  font-size: 2rem;
  cursor: pointer;
}

.modal-window h2 {
  margin-top: 0;
}

.modal-video-wrapper,
.modal-image-wrapper {
  margin-top: 1rem;
  position: relative;
  padding-top: 56.25%;
  border-radius: 12px;
  background: #000;
  overflow: hidden;
  display: none;
}

.modal-video-wrapper video,
.modal-image-wrapper img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: contain;
}

.modal-buttons {
  margin-top: 1.5rem;
  display: flex;
  justify-content: center;
}

.modal-btn {
  padding: 0.7rem 1.5rem;
  border-radius: 10px;
  border: none;
  background: #ffd480;
  color: #000;
  font-weight: 600;
  cursor: pointer;
}

/* Upgrade-Modal für Premium-Hinweis */
.upgrade-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.8);
  display: none;
  align-items: center;
  justify-content: center;
  z-index: 60;
}

.upgrade-backdrop.active {
  display: flex;
}

.upgrade-modal {
  max-width: 480px;
  width: 90%;
  background: #111827;
  border-radius: 16px;
  padding: 1.5rem 1.75rem 1.75rem;
  color: #f8f5ec;
  box-shadow: 0 20px 40px rgba(0,0,0,0.9);
  position: relative;
}

.upgrade-modal h2 {
  margin-top: 0;
  margin-bottom: 0.75rem;
}

.upgrade-modal p {
  margin-top: 0;
  margin-bottom: 1.25rem;
}

/* Login-Formular */
.upgrade-form {
  margin-top: 1rem;
}

.upgrade-form-group {
  margin-bottom: 1rem;
}

.upgrade-form-group label {
  display: block;
  margin-bottom: 0.4rem;
  font-size: 0.9rem;
  color: #e0e0e0;
}

.upgrade-form-group input {
  width: 100%;
  padding: 0.65rem 0.85rem;
  border-radius: 8px;
  border: 1px solid rgba(255,255,255,0.2);
  background: rgba(255,255,255,0.05);
  color: #fff;
  font-size: 1rem;
  box-sizing: border-box;
}

.upgrade-form-group input:focus {
  outline: none;
  border-color: #ffd480;
  background: rgba(255,255,255,0.08);
}

.upgrade-error {
  margin-top: 0.75rem;
  padding: 0.6rem;
  background: rgba(220,38,38,0.2);
  border: 1px solid rgba(220,38,38,0.5);
  border-radius: 6px;
  color: #fca5a5;
  font-size: 0.9rem;
}

.upgrade-btn {
  display: inline-block;
  padding: 0.7rem 1.5rem;
  border-radius: 8px;
  text-decoration: none;
  font-weight: 600;
  font-size: 0.95rem;
  border: none;
  cursor: pointer;
  width: 100%;
  text-align: center;
  box-sizing: border-box;
}

.upgrade-btn-primary {
  background: #ffd480;
  color: #000;
}

.upgrade-btn-primary:hover {
  background: #ffc860;
}

/* Divider zwischen Login und Kauf-Link */
.upgrade-divider {
  margin: 1.25rem 0;
  text-align: center;
  position: relative;
}

.upgrade-divider::before {
  content: '';
  position: absolute;
  top: 50%;
  left: 0;
  right: 0;
  height: 1px;
  background: rgba(255,255,255,0.2);
}

.upgrade-divider span {
  position: relative;
  background: #111827;
  padding: 0 0.75rem;
  color: rgba(255,255,255,0.5);
  font-size: 0.85rem;
}

/* Kauf-Link */
.upgrade-buy-link {
  text-align: center;
}

.upgrade-link {
  color: #ffd480;
  text-decoration: underline;
  font-size: 0.95rem;
}

.upgrade-link:hover {
  color: #ffc860;
}

.upgrade-close {
  position: absolute;
  top: 0.8rem;
  right: 1rem;
  background: none;
  border: none;
  color: #fff;
  font-size: 1.5rem;
  cursor: pointer;
}


