/* Custom styles beyond Tailwind CDN */

/* ===== CSS Custom Properties ===== */
:root {
  --cream: #FAF8F5;
  --mountain: #6AAFE0;
  --earth: #C2AA8E;
  --charcoal: #2D3436;
  --accent: #2E8B57;
}

/* ===== Subtle Paper Texture ===== */
body {
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 256 256' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='noise'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.85' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23noise)' opacity='0.035'/%3E%3C/svg%3E");
  background-repeat: repeat;
  background-size: 256px 256px;
}

/* ===== Smooth Scroll ===== */
html {
  scroll-behavior: smooth;
  scroll-padding-top: 5rem;
}

/* ===== Passcode Gate ===== */
#gate {
  transition: opacity 0.7s ease, visibility 0.7s ease;
}

#gate.gate-hidden {
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
}

@keyframes shake {
  0%, 100% { transform: translateX(0); }
  10%, 30%, 50%, 70%, 90% { transform: translateX(-4px); }
  20%, 40%, 60%, 80% { transform: translateX(4px); }
}

.shake {
  animation: shake 0.5s ease-in-out;
}

/* ===== Navigation ===== */
#nav.scrolled {
  background-color: rgba(250, 248, 245, 0.92);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.06);
}

/* Hamburger lines */
.hamburger-line {
  display: block;
  width: 100%;
  height: 2px;
  background: var(--charcoal);
  border-radius: 1px;
  transition: transform 0.3s ease, opacity 0.3s ease;
}

#hamburger[aria-expanded="true"] .hamburger-line:nth-child(1) {
  transform: translateY(8px) rotate(45deg);
}

#hamburger[aria-expanded="true"] .hamburger-line:nth-child(2) {
  opacity: 0;
}

#hamburger[aria-expanded="true"] .hamburger-line:nth-child(3) {
  transform: translateY(-8px) rotate(-45deg);
}

/* Mobile menu */
#mobile-menu {
  max-height: 0;
  transition: max-height 0.3s ease;
}

#mobile-menu.open {
  max-height: 380px;
}

/* ===== Scroll Animations ===== */
.animate-on-scroll {
  opacity: 0;
  transform: translateY(24px);
  transition: opacity 0.8s ease, transform 0.8s ease;
}

.animate-on-scroll.visible {
  opacity: 1;
  transform: translateY(0);
}

/* ===== Scroll Indicator ===== */
@keyframes gentleBounce {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(8px); }
}

.scroll-indicator {
  animation: gentleBounce 3s ease-in-out infinite;
}

/* ===== Countdown ===== */
#countdown span[id^="countdown-"] {
  font-variant-numeric: tabular-nums;
}

@keyframes countdownPulse {
  0%, 100% { transform: scale(1);    text-shadow: 0 0 0 rgba(106,175,224,0); }
  50%      { transform: scale(1.04); text-shadow: 0 0 12px rgba(106,175,224,0.55); }
}

@keyframes countdownPulseStrong {
  0%, 100% { transform: scale(1);    text-shadow: 0 0 4px rgba(106,175,224,0.3); }
  50%      { transform: scale(1.06); text-shadow: 0 0 20px rgba(106,175,224,0.8); }
}

#countdown.countdown-soon span[id^="countdown-"] {
  animation: countdownPulse 2.4s ease-in-out infinite;
}

#countdown.countdown-imminent span[id^="countdown-"] {
  animation: countdownPulseStrong 1.1s ease-in-out infinite;
}

/* ===== Today badge ===== */
@keyframes todayShimmer {
  0%, 100% { box-shadow: 0 0 0 0 rgba(106,175,224,0); }
  50%       { box-shadow: 0 0 18px 4px rgba(106,175,224,0.35); }
}

.today-badge-shimmer {
  animation: todayShimmer 2.5s ease-in-out infinite;
}

/* ===== Run status (Nie uciekła!) ===== */
.run-status-escaped { display: none; }

.run-status.wedding-now .run-status-default { display: none; }

@keyframes runStatusBlink {
  0%, 100% { opacity: 1; }
  50%      { opacity: 0.25; }
}

.run-status.wedding-now .run-status-escaped {
  display: inline-block;
  animation: runStatusBlink 1s steps(1, end) infinite;
}

/* ===== Celebration banner ===== */
#celebration-banner { display: none; }

#celebration-banner.active {
  display: flex;
}

@keyframes nieUcieklaFlash {
  0%, 100% { opacity: 1; color: #6AAFE0; text-shadow: 0 0 0 rgba(106,175,224,0); }
  25%      { opacity: 1; color: #D4A06A; text-shadow: 0 0 40px rgba(212,160,106,0.6); }
  50%      { opacity: 1; color: #6AAFE0; text-shadow: 0 0 60px rgba(106,175,224,0.7); }
  75%      { opacity: 0.85; color: #2E8B57; text-shadow: 0 0 30px rgba(46,139,87,0.5); }
}

.celebration-nie-uciekla {
  animation: nieUcieklaFlash 1.6s ease-in-out infinite;
}

/* ===== FAQ Accordion ===== */
.faq-toggle[aria-expanded="true"] .faq-chevron {
  transform: rotate(180deg);
}

.faq-answer {
  max-height: 0;
  overflow: hidden;
  opacity: 0;
  transition: max-height 0.4s ease, opacity 0.3s ease;
}

.faq-answer.open {
  opacity: 1;
}

/* ===== Language Toggle ===== */
.lang-toggle {
  cursor: pointer;
  user-select: none;
}

/* ===== Language Toggle Nudge (non-PL browsers) ===== */
.lang-nudge {
  border-color: var(--mountain) !important;
  animation: langPulse 1.5s ease-in-out 3;
}

@keyframes langPulse {
  0%, 100% { box-shadow: 0 0 0 0 rgba(106, 175, 224, 0); }
  50% { box-shadow: 0 0 0 4px rgba(106, 175, 224, 0.3); }
}

/* ===== RSVP Page ===== */

/* Loading spinner */
.loading-spinner {
  display: inline-block;
  width: 48px;
  height: 48px;
  border: 4px solid var(--earth);
  border-top-color: var(--mountain);
  border-radius: 50%;
  animation: spin 1s linear infinite;
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

/* Heat-bar slider */
.heat-slider {
  -webkit-appearance: none;
  appearance: none;
  height: 8px;
  border-radius: 4px;
  background: linear-gradient(to right, #6AAFE0, #C2AA8E, #E8A838, #E85D3A);
  outline: none;
  cursor: pointer;
}

.heat-slider::-webkit-slider-thumb {
  -webkit-appearance: none;
  appearance: none;
  width: 24px;
  height: 24px;
  border-radius: 50%;
  background: white;
  border: 3px solid var(--mountain);
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.15);
  cursor: pointer;
  transition: border-color 0.2s ease;
}

.heat-slider::-webkit-slider-thumb:hover {
  border-color: var(--charcoal);
}

.heat-slider::-moz-range-thumb {
  width: 24px;
  height: 24px;
  border-radius: 50%;
  background: white;
  border: 3px solid var(--mountain);
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.15);
  cursor: pointer;
}

.heat-slider:focus-visible::-webkit-slider-thumb {
  outline: 2px solid var(--mountain);
  outline-offset: 2px;
}

/* Feminist buttons selected state */
.feminist-btn.border-mountain {
  box-shadow: 0 0 0 1px var(--mountain);
}

/* Radio buttons */
.rsvp-radio {
  cursor: pointer;
  accent-color: var(--mountain);
}

/* Conditional fields (collapse/expand) */
.rsvp-conditional {
  max-height: 600px;
  opacity: 1;
  overflow: hidden;
  transition: max-height 0.35s ease, opacity 0.25s ease;
}

.rsvp-conditional.rsvp-collapsed {
  max-height: 0;
  opacity: 0;
}

/* Success/error icon animation */
.success-icon,
.error-icon {
  animation: scalePulse 0.5s ease-out;
}

@keyframes scalePulse {
  0% { transform: scale(0.6); opacity: 0; }
  60% { transform: scale(1.08); }
  100% { transform: scale(1); opacity: 1; }
}

/* Success summary card stagger */
#success-summary > div {
  animation: slideUp 0.4s ease forwards;
  opacity: 0;
}
#success-summary > div:nth-child(1) { animation-delay: 0.1s; }
#success-summary > div:nth-child(2) { animation-delay: 0.2s; }
#success-summary > div:nth-child(3) { animation-delay: 0.3s; }
#success-summary > div:nth-child(4) { animation-delay: 0.4s; }

@keyframes slideUp {
  from { opacity: 0; transform: translateY(12px); }
  to { opacity: 1; transform: translateY(0); }
}

/* +1 toggle options */
.plusone-option {
  cursor: pointer;
  transition: border-color 0.2s ease, background-color 0.2s ease;
}

.plusone-option input:checked + span {
  color: var(--charcoal);
}

.plusone-option:has(input:checked) {
  border-color: var(--mountain);
  background-color: rgba(91, 155, 213, 0.08);
  box-shadow: 0 0 0 1px var(--mountain);
}

/* ===== Profile Page ===== */

/* Summary rows (key-value pairs) */
.profile-row {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  padding: 0.625rem 0;
  border-bottom: 1px solid rgba(194, 170, 142, 0.2);
}

.profile-row:last-child {
  border-bottom: none;
}

.profile-label {
  color: #636E72;
  font-size: 0.875rem;
}

.profile-value {
  font-size: 0.875rem;
  text-align: right;
  max-width: 60%;
}

.profile-value.not-filled {
  color: #636E72;
  font-style: italic;
}

/* Status badges */
.profile-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
  font-size: 0.75rem;
  padding: 0.125rem 0.625rem;
  border-radius: 9999px;
  font-weight: 500;
}

.profile-badge.yes {
  background: rgba(46, 139, 87, 0.1);
  color: var(--accent);
}

.profile-badge.no {
  background: rgba(99, 110, 114, 0.1);
  color: #636E72;
}

.profile-badge.pending {
  background: rgba(91, 155, 213, 0.1);
  color: var(--mountain);
}

/* ===== Admin Dashboard ===== */

/* Stat cards */
.admin-stat-card {
  background: white;
  border: 1px solid rgba(194, 170, 142, 0.3);
  border-radius: 0.75rem;
  padding: 1rem;
  text-align: center;
}

.admin-stat-value {
  display: block;
  font-family: 'Cormorant Garamond', Georgia, serif;
  font-size: 1.75rem;
  font-weight: 500;
  color: var(--charcoal);
}

.admin-stat-label {
  display: block;
  font-size: 0.75rem;
  color: #636E72;
  margin-top: 0.125rem;
}

/* Table */
.admin-th {
  text-align: left;
  padding: 0.75rem 1rem;
  font-size: 0.75rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: #636E72;
  border-bottom: 2px solid rgba(194, 170, 142, 0.3);
  cursor: pointer;
  user-select: none;
  white-space: nowrap;
}

.admin-th:hover {
  color: var(--charcoal);
}

.admin-th.sort-active {
  color: var(--mountain);
}

.admin-th.sort-active::after {
  content: ' \2191';
}

.admin-th.sort-active.sort-desc::after {
  content: ' \2193';
}

.admin-td {
  padding: 0.625rem 1rem;
  border-bottom: 1px solid rgba(194, 170, 142, 0.15);
  vertical-align: middle;
}

/* Color-coded rows */
.admin-row-yes {
  background: rgba(46, 139, 87, 0.04);
}

.admin-row-no {
  background: rgba(239, 68, 68, 0.04);
}

.admin-row-pending {
  background: transparent;
}

.admin-row-yes:hover,
.admin-row-no:hover,
.admin-row-pending:hover {
  background: rgba(91, 155, 213, 0.06);
}

/* ===== Map Embed ===== */
.map-container {
  position: relative;
  width: 100%;
  aspect-ratio: 16 / 9;
}

.map-container iframe {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
}

/* ===== Timeline (Harmonogram) ===== */
.timeline-line {
  position: relative;
  padding-left: 1.5rem;
}

.timeline-line::before {
  content: '';
  position: absolute;
  left: 5px;
  top: 0;
  bottom: 0;
  width: 2px;
  background: linear-gradient(to bottom, transparent, var(--earth) 2rem, var(--earth) calc(100% - 2rem), transparent);
}

.timeline-entry {
  display: flex;
  gap: 1rem;
  align-items: flex-start;
  padding-bottom: 1.25rem;
  position: relative;
}

.timeline-time {
  font-size: 0.75rem;
  font-weight: 500;
  letter-spacing: 0.05em;
  color: var(--mountain);
  white-space: nowrap;
  width: 4.5rem;
  text-align: right;
  flex-shrink: 0;
  padding-top: 0.125rem;
}

.timeline-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: var(--earth);
  flex-shrink: 0;
  margin-top: 0.375rem;
  position: relative;
  z-index: 1;
}

.timeline-highlight .timeline-dot {
  background: var(--mountain);
  width: 12px;
  height: 12px;
  margin-top: 0.3125rem;
  box-shadow: 0 0 0 4px rgba(106, 175, 224, 0.15);
}

.timeline-highlight .timeline-desc {
  font-weight: 500;
}

/* ===== Vendor Toggle ===== */
.vendor-toggle-knob {
  transition: transform 0.2s ease;
}

#vendor-toggle[aria-checked="true"] {
  background-color: var(--mountain);
}

#vendor-toggle[aria-checked="true"] .vendor-toggle-knob {
  transform: translateX(1.25rem);
}

/* ===== Vendor Item Visibility ===== */
.vendor-only {
  max-height: 0;
  opacity: 0;
  overflow: hidden;
  transition: max-height 0.4s ease, opacity 0.3s ease;
  padding-bottom: 0;
}

body.vendor-mode .vendor-only {
  max-height: 200px;
  opacity: 1;
  padding-bottom: 1.25rem;
}

.vendor-note {
  display: none;
  font-size: 0.75rem;
  color: #636E72;
  font-style: italic;
  margin-top: 0.25rem;
}

body.vendor-mode .vendor-note {
  display: block;
}

.vendor-section {
  max-height: 0;
  opacity: 0;
  overflow: hidden;
  transition: max-height 0.5s ease, opacity 0.4s ease;
}

body.vendor-mode .vendor-section {
  max-height: 2000px;
  opacity: 1;
}

/* Day header emphasis for Saturday */
.day-header-highlight {
  border-left: 3px solid var(--mountain);
  padding-left: 1rem;
}

/* ===== Reduced Motion ===== */
@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }

  .animate-on-scroll {
    opacity: 1;
    transform: none;
    transition: none;
  }

  .scroll-indicator {
    animation: none;
  }

  .shake {
    animation: none;
  }

  #gate,
  #mobile-menu,
  .faq-answer,
  .faq-chevron,
  .hamburger-line,
  .rsvp-conditional {
    transition: none;
  }

  .loading-spinner {
    animation: none;
    border-top-color: var(--earth);
  }

  .success-icon,
  .error-icon {
    animation: none;
    opacity: 1;
  }

  #success-summary > div {
    animation: none;
    opacity: 1;
  }

  .lang-nudge {
    animation: none;
  }

  .vendor-only,
  .vendor-section,
  .vendor-toggle-knob {
    transition: none;
  }

  #countdown.countdown-soon span[id^="countdown-"],
  #countdown.countdown-imminent span[id^="countdown-"] {
    animation: none;
    text-shadow: 0 0 8px rgba(106,175,224,0.4);
  }

  .run-status.wedding-now .run-status-escaped {
    animation: none;
    opacity: 1;
  }

  .today-badge-shimmer {
    animation: none;
  }

  .celebration-nie-uciekla {
    animation: none;
    color: var(--mountain);
  }
}
