/* ==========================================================================
   AIUP HACK 2026 — pływający przycisk CTA + modal
   Jedna instalacja (CSS + JS), działa na każdej stronie. Markup wstrzykuje JS.
   ========================================================================== */

:root {
  /* Gradient hackathonu — wersja czerwona (czerwień → pomarańcz) */
  --hack-cyan: #e11d2b;   /* start gradientu (czerwień) */
  --hack-lime: #ff6b35;   /* koniec gradientu (pomarańcz) */
  --hack-navy: #FFFDEE;   /* tekst na gradiencie — jasny, dla kontrastu na czerwieni */
  --hack-surface: var(--surface, #076653);
}

/* ---------- Pływający przycisk (zawsze widoczny) ---------- */
.hack-cta {
  position: fixed;
  bottom: 24px;
  right: 24px;
  z-index: 1000;
  display: inline-flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 2px;
  padding: 0.9rem 1.4rem;
  border: 0;
  border-radius: 999px;
  cursor: pointer;
  font-family: inherit;
  text-align: left;
  color: var(--hack-navy);
  background: linear-gradient(135deg, var(--hack-cyan) 0%, var(--hack-lime) 100%);
  box-shadow: 0 10px 30px -8px var(--hack-cyan);
  animation: hackPulse 2.5s ease-in-out infinite;
  transition: transform 0.25s ease, box-shadow 0.25s ease;
}

.hack-cta__line1 {
  font-size: 0.95rem;
  font-weight: 800;
  letter-spacing: -0.01em;
}

.hack-cta__line2 {
  font-size: 0.72rem;
  font-weight: 600;
  opacity: 0.85;
}

.hack-cta:hover {
  transform: scale(1.06);
  box-shadow: 0 16px 42px -8px var(--hack-cyan);
}

.hack-cta:focus-visible {
  outline: 2px solid var(--hack-navy);
  outline-offset: 3px;
}

@keyframes hackPulse {
  0%, 100% { transform: scale(1); }
  50%      { transform: scale(1.04); }
}

/* Tryb delikatny — po kilku zamknięciach modala (z localStorage) */
.hack-cta.is-gentle {
  animation: none;
}

/* ---------- Modal ---------- */
.hack-modal {
  position: fixed;
  inset: 0;
  z-index: 1001;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1.2rem;
  background: rgba(0, 0, 0, 0.7);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.2s ease, visibility 0.2s ease;
}

.hack-modal.is-open {
  opacity: 1;
  visibility: visible;
}

/* Karta + border 1px z gradientem cyan→lime (technika podwójnego tła) */
.hack-modal__card {
  position: relative;
  width: 100%;
  max-width: 600px;
  max-height: 90vh;
  overflow-y: auto;
  padding: 2.2rem;
  border-radius: 20px;
  color: var(--text-primary, #FFFDEE);
  border: 1px solid transparent;
  background:
    linear-gradient(var(--hack-surface), var(--hack-surface)) padding-box,
    linear-gradient(135deg, var(--hack-cyan), var(--hack-lime)) border-box;
  transform: scale(0.95);
  opacity: 0;
  transition: transform 0.2s ease, opacity 0.2s ease;
}

.hack-modal.is-open .hack-modal__card {
  transform: scale(1);
  opacity: 1;
}

.hack-modal__close {
  position: absolute;
  top: 14px;
  right: 14px;
  width: 38px;
  height: 38px;
  border-radius: 50%;
  border: 1px solid rgba(255, 255, 255, 0.2);
  background: rgba(0, 0, 0, 0.25);
  color: var(--text-primary, #fff);
  font-size: 1.4rem;
  line-height: 1;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.2s ease, transform 0.2s ease;
}

.hack-modal__close:hover {
  background: rgba(0, 0, 0, 0.5);
  transform: rotate(90deg);
}

/* ---------- Zawartość modala ---------- */
.hack-modal__tag {
  display: inline-block;
  font-family: var(--font-mono, monospace);
  font-size: 0.72rem;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--hack-lime);
  margin-bottom: 0.5rem;
}

.hack-modal h2 {
  margin: 0 0 0.2rem;
  font-size: 1.85rem;
  line-height: 1.1;
  color: var(--text-primary, #FFFDEE);
}

.hack-modal__section {
  margin-top: 1.3rem;
}

.hack-modal__section h3 {
  font-size: 0.8rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--hack-cyan);
  margin: 0 0 0.5rem;
}

.hack-modal__section p {
  margin: 0 0 0.4rem;
  line-height: 1.6;
  color: var(--text-secondary, #a8c4bc);
}

.hack-modal__section ul {
  margin: 0;
  padding-left: 1.1rem;
  color: var(--text-secondary, #a8c4bc);
  line-height: 1.6;
}

.hack-modal__section li {
  margin-bottom: 0.3rem;
}

.hack-modal strong {
  color: var(--text-primary, #FFFDEE);
  font-weight: 700;
}

.hack-modal__section--bonus {
  margin-top: 1.5rem;
  padding: 1rem 1.1rem;
  border-radius: 14px;
  background: rgba(225, 29, 43, 0.08);
  border: 1px solid rgba(225, 29, 43, 0.25);
}

.hack-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.7rem;
  margin-top: 1.8rem;
}

.hack-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0.8rem 1.4rem;
  border-radius: 999px;
  font-weight: 700;
  font-size: 0.92rem;
  text-decoration: none;
  transition: transform 0.2s ease, box-shadow 0.2s ease, background 0.2s ease;
}

.hack-btn--primary {
  color: var(--hack-navy);
  background: linear-gradient(135deg, var(--hack-cyan), var(--hack-lime));
  box-shadow: 0 10px 24px -10px var(--hack-cyan);
}

.hack-btn--primary:hover {
  transform: translateY(-2px);
  box-shadow: 0 14px 32px -10px var(--hack-cyan);
}

.hack-btn--ghost {
  color: var(--text-primary, #FFFDEE);
  border: 1px solid rgba(255, 255, 255, 0.25);
}

.hack-btn--ghost:hover {
  background: rgba(255, 255, 255, 0.08);
}

.hack-actions__note {
  margin: 0.9rem 0 0;
  font-size: 0.78rem;
  color: var(--text-muted, #7fa39a);
}

.hack-btn:focus-visible,
.hack-modal__close:focus-visible {
  outline: 2px solid var(--hack-lime);
  outline-offset: 2px;
}

/* ---------- Mobile ---------- */
@media (max-width: 600px) {
  .hack-cta {
    bottom: 16px;
    right: 16px;
    padding: 0.7rem 1.1rem;
  }
  .hack-cta__line1 { font-size: 0.85rem; }
  .hack-cta__line2 { font-size: 0.66rem; }
  .hack-modal__card { padding: 1.6rem; }
  .hack-modal h2 { font-size: 1.55rem; }
}

/* ---------- Mniej ruchu ---------- */
@media (prefers-reduced-motion: reduce) {
  .hack-cta { animation: none; }
  .hack-cta:hover { transform: none; }
  .hack-modal,
  .hack-modal__card { transition: opacity 0.2s ease, visibility 0.2s ease; }
  .hack-modal__card { transform: none; }
  .hack-modal.is-open .hack-modal__card { transform: none; }
}
