:root {
  --footer-primary-color: #2ECC71;
  --footer-secondary-color: #27AE60;
  --footer-accent-color: #F1C40F;
  --footer-dark-bg: #2C3E50;
  --footer-light-text: #ECF0F1;
  --footer-shadow-color: rgba(0, 0, 0, 0.2);
  --footer-font-heading: 'Poppins', sans-serif;
  --footer-font-body: 'Open Sans', sans-serif;
  --gold-primary: #e7ca93;
  --gold-secondary: #d4be94;
}

/* ================
   GLOBAL PAGE LAYOUT FIX
   Ensures footer always stays at bottom, even on short pages
   ================ */
html {
  height: 100%;
}

body {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

.footer-wrapper {
  position: static !important;
  width: 100%;
  margin-top: auto;
  flex-shrink: 0;
}

/* ================
   Site Footer (from index.css)
   ================ */
.site-footer {
  width: 100%;
  margin-top: 4rem;
  padding: 2.5rem 1.5rem 2rem;
  background: linear-gradient(to bottom, rgba(0, 0, 0, 0.3), rgba(0, 0, 0, 0.5));
  backdrop-filter: blur(12px);
  text-align: center;
  border-top: 2px solid rgba(231, 202, 147, 0.2);
  box-shadow: 0 -4px 24px rgba(0, 0, 0, 0.2),
              inset 0 1px 0 rgba(255, 255, 255, 0.05);
  position: relative;
  font-family: 'Exo 2', system-ui, -apple-system, sans-serif;
}

.site-footer::before {
  content: '';
  position: absolute;
  top: -2px;
  left: 0;
  right: 0;
  height: 2px;
  background: linear-gradient(90deg, transparent, rgba(231, 202, 147, 0.6), transparent);
  box-shadow: 0 0 12px rgba(231, 202, 147, 0.4);
}

.site-footer nav {
  margin-bottom: 1.5rem;
  display: none; /* Hidden on mobile by default */
}

.site-footer ul {
  list-style: none;
  padding: 0;
  display: flex;
  justify-content: center;
  gap: clamp(1.2rem, 3vw, 2.5rem);
  flex-wrap: wrap;
  margin: 0;
}

/* Show navigation from tablet size (768px) and up */
@media (min-width: 768px) {
  .site-footer nav {
    display: block;
  }
}

.site-footer li {
  margin: 0;
}

.site-footer a {
  color: var(--gold-secondary);
  text-decoration: none;
  font-size: clamp(0.95rem, 2.5vw, 1.05rem);
  font-weight: 500;
  transition: all 0.3s ease;
  position: relative;
  padding: 0.25rem 0;
  text-shadow: 1px 1px 2px rgba(0, 0, 0, 0.4);
}

.site-footer a::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 0;
  width: 0;
  height: 2px;
  background: linear-gradient(90deg, var(--gold-primary), var(--gold-secondary));
  transition: width 0.3s ease;
  box-shadow: 0 0 8px rgba(231, 202, 147, 0.6);
}

.site-footer a:hover {
  color: var(--gold-primary);
  text-shadow: 0 0 8px rgba(231, 202, 147, 0.5);
}

.site-footer a:hover::after {
  width: 100%;
}

.site-footer p {
  margin: 0;
  margin-top: 1rem;
  font-size: clamp(0.85rem, 2vw, 0.95rem);
  color: #b0b0b0;
  text-shadow: 1px 1px 2px rgba(0, 0, 0, 0.4);
}

/* Viktorina Clickable Link */
.viktorina-clickable {
  color: var(--gold-primary);
  cursor: pointer;
  font-weight: 600;
  transition: all 0.3s ease;
  text-shadow: 0 0 4px rgba(231, 202, 147, 0.3);
  display: inline-block;
}

.viktorina-clickable:hover {
  color: #ffd700;
  text-shadow: 0 0 12px rgba(231, 202, 147, 0.6);
  transform: scale(1.05);
}

/* Footer Clock */
.footer-clock {
  margin-left: 0.5rem;
  color: #9eadb9;
  font-weight: 500;
  font-variant-numeric: tabular-nums;
  letter-spacing: 0.5px;
}

/* Mobile optimization (up to 767px) */
@media (max-width: 767px) {
  .site-footer {
    padding: 1.5rem 1rem 1.2rem;
    margin-top: 2rem;
  }

  .footer-clock {
    display: block;
    margin-left: 0;
    margin-top: 0.5rem;
  }
}

/* Very small screens */
@media (max-width: 568px) {
  .site-footer {
    padding: 1.2rem 1rem 1rem;
  }

  .site-footer p {
    font-size: 0.85rem;
  }
}

/* ====================
   DIALOG STYLES
   ==================== */
dialog {
  --dialog-padding: 1.5rem;
  width: 95%;
  border: none;
  border-radius: 1.5rem;
  padding: var(--dialog-padding);
  max-width: min(90%, 800px);
  background: linear-gradient(145deg, var(--footer-dark-bg) 0%, #34495e 100%);
  color: var(--footer-light-text);
  box-shadow: 0 1rem 3rem var(--footer-shadow-color);
  font-family: 'Exo 2', system-ui, -apple-system, sans-serif;
  position: fixed;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  z-index: 1000;
  backdrop-filter: blur(10px);
  border: 1px solid rgba(255, 255, 255, 0.1);
}

dialog::backdrop {
  background: rgba(0, 0, 0, 0.6);
  backdrop-filter: blur(5px);
}

dialog h1 {
  font-family: var(--footer-font-heading);
  font-size: clamp(1.5rem, 3vw, 2.2rem);
  margin-bottom: 1.2rem;
  color: var(--footer-primary-color);
  text-shadow: 0 2px 4px var(--footer-shadow-color);
  line-height: 1.3;
}

/* ====================
   ACCORDION STYLES
   ==================== */
.accordion-btn {
  background: linear-gradient(145deg, var(--footer-dark-bg), #34495e);
  color: var(--footer-light-text);
  cursor: pointer;
  padding: 1rem;
  width: 100%;
  border: none;
  text-align: left;
  outline: none;
  transition: all 0.3s ease;
  font-size: 1.1rem;
  margin-top: 1rem;
  border-radius: 1rem;
  font-family: 'Exo 2', system-ui, -apple-system, sans-serif;
  font-weight: 600;
  box-shadow: 0 4px 10px var(--footer-shadow-color);
  position: relative;
}

.accordion-btn::after {
  content: '+';
  font-size: 1.5rem;
  position: absolute;
  right: 20px;
  top: 50%;
  transform: translateY(-50%);
  transition: transform 0.3s ease;
  color: var(--footer-accent-color);
  font-weight: bold;
}

.accordion-btn.active::after {
  content: '-';
  width: .4em;
  font-size: 2em;
  padding-bottom: .4rem;
  transform: translateY(-50%) rotate(180deg);
  color: var(--footer-accent-color);
  transition: transform 0.3s ease;
  font-weight: bold;
}

.accordion-btn:hover {
  background: rgba(255, 255, 255, 0.1);
  transform: scale(1.02);
}

.accordion-content {
  padding: 0 1rem;
  max-height: 0;
  overflow: hidden;
  transition: max-height 0.4s ease, opacity 0.4s ease;
  background: rgba(255, 255, 255, 0.05);
  color: var(--footer-light-text);
  border-radius: 0 0 1rem 1rem;
  opacity: 0;
}

.accordion-content.open {
  opacity: 1;
}

.accordion-content p {
  margin: 1rem 0;
  font-family: 'Exo 2', system-ui, -apple-system, sans-serif;
  font-size: 1rem;
  line-height: 1.6;
}

/* ====================
   DONATION STYLES
   ==================== */
.donation-content {
  display: grid;
}

.donation-text {
  display: flex;
  flex-direction: column;
  margin-top: 1.4rem;
}

.donation-text p {
  font-size: clamp(1rem, 1.2vw, 1.1rem);
  line-height: 1.8;
  opacity: 0.9;
}

.donation-buttons {
  display: flex;
  flex-direction: column;
  gap: .5rem;
}

.donation-buttons hr {
  border: 0;
  height: 1px;
  background: linear-gradient(to right, transparent, rgba(255, 255, 255, 0.2), transparent);
  margin: 1rem 0;
}

.donation-buttons h3 {
  font-size: clamp(1rem, 1.3vw, 1.2rem);
  flex-direction: column;
  align-items: flex-start;
  gap: 0.5rem;
  text-align: left;
  margin: 0;
  padding: 1rem;
  background: rgba(255, 255, 255, 0.05);
  border-radius: 0.8rem;
  transition: transform 0.2s ease;
}

.donation-buttons h3:hover {
  transform: translateY(-1px);
  background: rgba(255, 255, 255, 0.1);
}

.donation-button {
  width: 100%;
  position: relative;
  overflow: hidden;
  display: inline-block;
  font-family: 'Exo 2', system-ui, -apple-system, sans-serif;
  font-weight: 600;
  padding: 0.8rem 1.5rem;
  border-radius: 0.6rem;
  margin-top: 1rem;
  border: 1px solid rgba(255, 255, 255, 0.3);
  text-transform: uppercase;
  letter-spacing: 0.5px;
  cursor: pointer;
  color: white;
  background: rgba(255, 255, 255, 0.08);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  box-shadow: 0 4px 30px var(--footer-shadow-color);
  transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1), box-shadow 0.3s ease;
  z-index: 0;
}

.donation-button::before {
  content: '';
  position: absolute;
  top: 0;
  left: -120%;
  width: 60%;
  height: 100%;
  background: rgba(255, 255, 255, 0.25);
  transform: skewX(-25deg);
  border-radius: inherit;
  pointer-events: none;
  z-index: 1;
  animation-name: shine;
  animation-duration: 3s;
  animation-timing-function: linear;
  animation-iteration-count: infinite;
}

@keyframes shine {
  0% {
    left: -120%
  }
  50% {
    left: 100%
  }
  100% {
    left: 320%
  }
}

#hero-donation::before {
  animation-delay: 0s;
}

#star-donation::before {
  animation-delay: 1s;
  animation-duration: 2.8s;
}

#legend-donation::before {
  animation-delay: 2s;
  animation-duration: 3.2s;
}

.donation-button:hover {
  transform: scale(1.02);
  box-shadow: 0 4px 15px rgba(255, 255, 255, 0.3);
}

.donation-button:focus {
  outline: none;
  box-shadow: 0 0 0 4px rgba(255, 255, 255, 0.4);
}

.donation-button:active {
  transform: scale(0.98);
  box-shadow: 0 2px 10px rgba(255, 255, 255, 0.2);
}

#hero-donation {
  background: rgba(0, 123, 255, 0.15);
}

#star-donation {
  background: rgba(255, 193, 7, 0.15);
}

#legend-donation {
  background: rgba(155, 89, 182, 0.15);
}

.footer-note {
  margin-top: 1.5rem;
  text-align: center;
}

.footer-note p {
  font-size: clamp(1rem, 1.2vw, 1.1rem);
  color: var(--footer-light-text);
  opacity: 0.9;
}

#close-dialog {
  background: #e74c3c;
  color: white;
  padding: 0.8rem 2rem;
  border: none;
  border-radius: 0.5rem;
  font-weight: bold;
  margin-top: 2rem;
  cursor: pointer;
  transition: all 0.2s ease;
  width: 100%;
  max-width: 200px;
  display: block;
  margin-left: auto;
  margin-right: auto;
}

#close-dialog:hover {
  background: #c0392b;
  transform: scale(0.98);
}

#close-dialog:active {
  transform: scale(0.95);
  box-shadow: 0 2px 10px var(--footer-shadow-color);
}

/* ================
   Touch Device Optimizations
   ================ */
@media (hover: none) and (pointer: coarse) {
  .site-footer a:hover {
    color: var(--gold-secondary);
    text-shadow: 1px 1px 2px rgba(0, 0, 0, 0.4);
  }

  .site-footer a:hover::after {
    width: 0;
  }

  .viktorina-clickable:hover {
    transform: none;
  }
}

/* ================
   Reduced Motion Preferences
   ================ */
@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}
