/* =========================================================
   GLOBAL – pozadina stranice
========================================================= */
html,
body {
  margin: 0;
  padding: 0;
  background: #001714;
  font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI",
    sans-serif;
}

/* =========================================================
   WRAP + HEADER + FOOTER
========================================================= */
.matrex-advent-wrap {
  position: relative;
  min-height: 100vh;
  max-width: 1400px;
  margin: 0 auto 60px;
  padding: 40px 24px 40px;
  background: radial-gradient(circle at 20% 0%, #0b6242 0, #012820 55%, #001712 100%);
  color: #f9fafb;
  box-shadow: 0 30px 60px rgba(0, 0, 0, 0.6);
  overflow: hidden;
}

.matrex-advent-header {
  text-align: center;
  margin-bottom: 26px;
}

.matrex-advent-logo {
  max-width: 260px;
  height: auto;
}

.matrex-advent-subtitle {
  margin-top: 8px;
  font-size: 16px;
  color: #e5f9f0;
  font-weight:700;
}

.matrex-advent-footer {
  margin-top: 20px;
  text-align: center;
  font-size: 12px;
  color: #ffffff;
}

.matrex-advent-footer a {
  color: #bbf7d0;
  text-decoration: none;
}

.matrex-advent-footer a:hover {
  text-decoration: underline;
}

/* =========================================================
   GRID – kartice
========================================================= */

/* 8 stupaca na desktopu */
.matrex-advent-grid {
  display: grid;
  grid-template-columns: repeat(8, minmax(80px, 1fr));
  gap: 18px;
  max-width: 1200px;
  margin: 40px auto 30px;
}

/* osnovni stil kartice */
.matrex-advent-grid .matrex-day {
  position: relative;
  aspect-ratio: 1 / 1;
  border-radius: 24px;
  border: 2px solid transparent;
  padding: 0;
  cursor: pointer;
  overflow: hidden;

  background-color: #05251c;
  background-size: cover;
  background-position: center;
  background-repeat: no-repeat;

  box-shadow: 0 12px 30px rgba(0, 0, 0, 0.45);
  transition:
    transform 0.18s ease,
    box-shadow 0.18s ease,
    border-color 0.18s ease,
    filter 0.18s ease;
}

/* tamni overlay da se brojevi lijepo vide */
.matrex-advent-grid .matrex-day::before {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(
    145deg,
    rgba(0, 0, 0, 0.55),
    rgba(0, 0, 0, 0.35)
  );
  z-index: 1;
}

/* BROJ DANA */
.matrex-day-number {
    position: absolute;
    left: 12px;
    bottom: 20px;
    z-index: 2;
    font-weight: 800;
    font-size: 45px;
    color: #fcfffd;
}

/* KVAČICA – prošli dani */
.matrex-day-check {
    position: absolute;
    right: 12px;
    bottom: 35px;
    z-index: 2;
    font-size: 80px;
    color: #ff0e0e;
}

/* BADGE "DANAS" */
.matrex-day-badge {
  position: absolute;
  top: 10px;
  left: 12px;
  z-index: 2;
  background: #eb0000;
  color: #fff;
  font-size: 13px;
  font-weight: 700;
  padding: 4px 10px;
  border-radius: 999px;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  box-shadow: 0 4px 10px rgba(0, 0, 0, 0.45);
}

/* STANJA KARTICA
   ------------------------------------ */

/* prošli dan – zeleni okvir */
.matrex-advent-grid .matrex-day--past {
  border-color: rgba(74, 222, 128, 0.9);
}

.matrex-advent-grid .matrex-day--past::before {
    background: linear-gradient(244deg, rgb(22 76 43 / 60%), rgb(0 0 0 / 81%));
}

/* današnji dan – žuti okvir s glowom */
.matrex-advent-grid .matrex-day--today {
  border-width: 3px;
  border-color: #facc15;
  box-shadow:
    0 0 0 2px rgba(250, 204, 21, 0.35),
    0 16px 40px rgba(0, 0, 0, 0.75);
}

.matrex-advent-grid .matrex-day--today::before {
  background: linear-gradient(
    145deg,
    rgba(0, 0, 0, 0.35),
    rgba(0, 0, 0, 0.15)
  );
}

/* budući dan – tamnije, bez hovera */
.matrex-advent-grid .matrex-day--future {
  cursor: not-allowed;
}

.matrex-advent-grid .matrex-day--future::before {
 background: linear-gradient(145deg, rgb(18 91 38 / 30%), rgb(62 90 78 / 0%));
}

/* hover samo za aktivne (današnji) */
.matrex-advent-grid .matrex-day:not(.matrex-day--future):not([disabled]):hover {
  transform: translateY(-4px);
  box-shadow: 0 18px 40px rgba(0, 0, 0, 0.7);
}

/* RESPONSIVE GRID */
@media (max-width: 1200px) {
  .matrex-advent-grid {
    grid-template-columns: repeat(6, minmax(80px, 1fr));
  }
}

@media (max-width: 900px) {
  .matrex-advent-grid {
    grid-template-columns: repeat(4, minmax(80px, 1fr));
  }
}

@media (max-width: 600px) {
  .matrex-advent-grid {
    grid-template-columns: repeat(3, minmax(80px, 1fr));
  }
}

/* =========================================================
   MODAL – overlay
========================================================= */
.matrex-modal {
  position: fixed;
  inset: 0;
  display: none; /* JS postavlja flex kad se otvori */
  align-items: center;
  justify-content: center;
  background: rgba(0, 0, 0, 0.65);
  z-index: 9999;
}

/* kutija forme */
.matrex-modal-inner {
  position: relative;
  width: min(920px, 100% - 32px);
  max-height: calc(100vh - 80px);
  overflow-y: auto;
  padding: 32px 36px 30px;
  border-radius: 28px;
  background: linear-gradient(15deg, #612a2ab3, #022c22);
  box-shadow: 0 24px 60px rgba(0, 0, 0, 0.8);
  color: #ffffff;
}

/* X gumb */
.matrex-modal-close {
  position: absolute;
  top: 16px;
  right: 20px;
  width: 32px;
  height: 32px;
  border-radius: 999px;
  border: none;
  background: rgb(18 91 38);
  color: #f9fafb;
  font-size: 20px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.15s ease, transform 0.15s ease;
  padding-top:10px;
}

.matrex-modal-close:hover {
  background: #b91c1c;
  transform: translateY(-1px);
}

/* naslov, pitanje, link */
#matrex-modal-title {
  margin: 0 0 8px;
  font-size: 26px;
  font-weight: 700;
}

#matrex-modal-question {
  margin: 0 0 4px;
  font-size: 15px;
}

#matrex-modal-help {
  display: inline-block;
  margin-bottom: 18px;
  font-size: 13px;
  color: #bbf7d0;
  text-decoration: underline;
}

/* =========================================================
   FORMA – inputi + checkboxi
========================================================= */
#matrex-advent-form {
  margin-top: 20px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

#matrex-advent-form label {
  display: block;
  font-size: 13px;
  font-weight: 600;
  color: #d1fae5;
}

#matrex-advent-form input[type="text"],
#matrex-advent-form input[type="email"] {
  width: 100%;
  margin-top: 4px;
  border: none;
  border-radius: 999px;
  padding: 10px 16px;
  background: #0808086e;
  color: #e5e7eb;
  box-shadow: inset 0 0 0 1px #16a34a;
}

#matrex-advent-form input[type="text"]::placeholder,
#matrex-advent-form input[type="email"]::placeholder {
  color: #6b7280;
}

#matrex-advent-form input[type="text"]:focus,
#matrex-advent-form input[type="email"]:focus {
  outline: none;
  box-shadow: inset 0 0 0 1px #22c55e;
}

.matrex-checkbox-row {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-top: 6px;
  font-size: 13px;
  color: #e5e7eb;
}

/* =========================================================
   GUMBI ODGOVORA (A/B/C)
========================================================= */
#matrex-answer-buttons {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin: 20px 0 18px;
}

.matrex-answer-btn {
  flex: 1 1 30%;
  border: 0;
  border-radius: 999px;
  padding: 10px 14px;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  background: #22c55e;
  color: #022c22;
  box-shadow: 0 8px 18px rgba(0, 0, 0, 0.5);
  transition: background 0.15s ease, transform 0.15s ease, box-shadow 0.15s ease;

  white-space: normal;
  text-align: center;
  line-height: 1.3;
}


.matrex-answer-btn:hover {
  background: #16a34a;
  transform: translateY(-1px);
  box-shadow: 0 12px 24px rgba(0, 0, 0, 0.7);
}

.matrex-answer-btn.is-selected {
  background: #15803d;
  color: #f9fafb;
}

/* =========================================================
   SUBMIT GUMB + SPINNER + PORUKE
========================================================= */
#matrex-submit-btn {
  margin-top: 20px;
  width: 100%;
  border: none;
  border-radius: 999px;
  padding: 12px 18px;
  background: #16a34a;
  color: #f9fafb;
  font-weight: 700;
  font-size: 15px;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  box-shadow: 0 14px 30px rgba(0, 0, 0, 0.7);
  transition: background 0.15s ease, transform 0.15s ease, box-shadow 0.15s ease;
}

#matrex-submit-btn:hover {
  background: #22c55e;
  transform: translateY(-1px);
}

#matrex-submit-btn.is-loading {
  cursor: wait;
  opacity: 0.85;
}

.matrex-submit-text {}

/* spinner – klasa usklađena s JS-om */
.matrex-submit-spinner {
  width: 18px;
  height: 18px;
  border-radius: 999px;
  border: 2px solid rgba(255, 255, 255, 0.3);
  border-top-color: #ffffff;
  animation: matrex-spin 0.7s linear infinite;
  display: none;
}

#matrex-submit-btn.is-loading .matrex-submit-spinner {
  display: inline-block;
}

/* poruke */
#matrex-form-message {
  margin-top: 12px;
  font-size: 15px;
  font-weight: 800;
}

#matrex-form-message.matrex-success {
  color: #bbf7d0;
}

#matrex-form-message.matrex-error {
  color: #fecaca;
}

/* animacija spinnera */
@keyframes matrex-spin {
  to {
    transform: rotate(360deg);
  }
}

/* =========================================================
   MOBILE TWEAKS
========================================================= */
@media (max-width: 600px) {
  .matrex-modal-inner {
    padding: 24px 20px 22px;
    border-radius: 22px;
  }

  #matrex-answer-buttons {
    flex-direction: column;
  }

  .matrex-answer-btn {
    flex: 1 1 auto;
  }

  .matrex-advent-wrap {
    padding: 30px 15px 40px;
  }
}

@media (max-width: 768px) {
  .matrex-advent-wrap {
    background: radial-gradient(circle at 50% 5%,
      #158a5d 0,
      #034f3a 55%,
      #001712 100%
    );
  }
}

/* =========================================================
   SNOW FLAKES
========================================================= */
.matrex-snow {
  position: absolute;
  top: -20px;              /* kreće malo iznad wrapa */
  width: 4px;
  height: 4px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.9);
  pointer-events: none;
  animation-name: matrex-snow-fall;
  animation-timing-function: linear;
  animation-iteration-count: infinite;
}

/* animacija pada snijega */
@keyframes matrex-snow-fall {
  0% {
    transform: translate3d(0, -40px, 0);
  }
  100% {
    transform: translate3d(0, 110vh, 0);
  }
}

.matrex-advent-thanks {
  margin-top: 10px;
  padding: 18px 20px 20px;
  border-radius: 18px;
  background: rgba(0,0,0,0.45);
  border: 1px solid rgba(34,197,94,0.5);
  text-align: center;
}

.matrex-thanks-title {
  margin: 0 0 8px;
  font-size: 20px;
  font-weight: 700;
  color: #bbf7d0;
}

.matrex-thanks-text {
  margin: 0 0 18px;
  font-size: 14px;
  color: #e5e7eb;
}

.matrex-thanks-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  justify-content: center;
}

.matrex-thanks-btn {
  display: inline-block;
  padding: 8px 16px;
  border-radius: 999px;
  text-decoration: none;
  font-size: 14px;
  font-weight: 600;
  box-shadow: 0 10px 22px rgba(0,0,0,0.6);
}

.matrex-thanks-btn-main {
  background: #16a34a;
  color: #f9fafb;
}

.matrex-thanks-btn-main:hover {
  background: #22c55e;
}

.matrex-thanks-btn-secondary {
  background: transparent;
  color: #bbf7d0;
  border: 1px solid rgba(187,247,208,0.8);
}

.matrex-thanks-btn-secondary:hover {
  background: rgba(22,163,74,0.2);
}


/* =========================================================
   INFO BLOK ISPOD KALENDARA
========================================================= */
.matrex-advent-info {
  max-width: 900px;
  margin: 10px auto 26px;
  padding: 20px 24px 22px;
  border-radius: 20px;
  background: rgba(0, 0, 0, 0.38);
  border: 1px solid rgba(187, 247, 208, 0.35);
  box-shadow: 0 18px 40px rgba(0, 0, 0, 0.6);
  color: #e5e7eb;
  font-size: 14px;
  line-height: 1.6;
}

.matrex-advent-info-title {
  margin: 0 0 10px;
  font-size: 20px;
  font-weight: 700;
  color: #bbf7d0;
}

.matrex-advent-info h3 {
  margin: 16px 0 6px;
  font-size: 15px;
  font-weight: 700;
  color: #dcfce7;
}

.matrex-advent-info p {
  margin: 4px 0;
}

.matrex-advent-info-rules a {
  color: #4ade80;
  font-weight: 600;
  text-decoration: underline;
}

.matrex-advent-info-rules a:hover {
  text-decoration: none;
}

.matrex-advent-info-bottom {
  margin-top: 12px;
  font-weight: 600;
  color: #f9fafb;
}

/* Mobile tweak */
@media (max-width: 600px) {
  .matrex-advent-info {
    padding: 16px 16px 18px;
    font-size: 13px;
  }

  .matrex-advent-info-title {
    font-size: 18px;
  }
}

/* Manji broj i kvačica na mobitelu */
@media (max-width: 600px) {
  .matrex-day-number {
    font-size: 30px;   /* bilo 45px */
    bottom: 14px;      /* malo bliže rubu */
    left: 10px;
  }

  .matrex-day-check {
    font-size: 48px;   /* bilo 80px */
    bottom: 22px;      /* malo više da ne ide izvan kartice */
    right: 10px;
  }
}

