/**
 * Modals CSS - Modal Styles
 * 
 * This file contains styles for:
 * - Base modal styles
 * - Modal content
 * - Close button
 * - Terms & Conditions modal
 * - Debug modal styles
 * 
 * Extracted from index.php during section compartmentalization refactoring
 */

/* ============================================
   Base Modal Styles
   ============================================ */
.modal {
  display: none;
  position: fixed;
  z-index: 10000;
  left: 0;
  top: 0;
  width: 100%;
  height: 100%;
  background-color: rgba(0,0,0,0.8);
  backdrop-filter: blur(5px);
}

.modal-content {
  background: rgba(19,26,34,0.92);
  margin: clamp(3%, 5vh, 5%) auto;
  padding: clamp(20px, 3vw, 30px);
  border: none;
  border-radius: clamp(12px, 1.5vw, 16px);
  width: min(90%, 600px);
  max-width: 100%; /* Changed from 600px to prevent overflow */
  max-height: 85vh;
  overflow-y: auto;
  overflow-x: hidden;
  box-shadow: 0 2px 16px #000;
  backdrop-filter: blur(2px);
  box-sizing: border-box;
}

@media (max-width: 768px) {
  .modal-content {
    width: 95%;
    margin: 10px auto;
    padding: 20px 15px;
    max-height: 90vh;
  }
}

@media (max-width: 480px) {
  .modal-content {
    width: 98%;
    margin: 5px auto;
    padding: 18px 12px;
    border-radius: 10px;
  }
}

/* Custom scrollbar styling for modal */
.modal-content::-webkit-scrollbar {
  width: 10px;
}

.modal-content::-webkit-scrollbar-track {
  background: rgba(19, 26, 34, 0.5);
  border-radius: 10px;
}

.modal-content::-webkit-scrollbar-thumb {
  background: var(--accent);
  border-radius: 10px;
  border: 2px solid rgba(19, 26, 34, 0.5);
}

.modal-content::-webkit-scrollbar-thumb:hover {
  background: #43dfeb;
}

/* Firefox scrollbar */
.modal-content {
  scrollbar-width: thin;
  scrollbar-color: var(--accent) rgba(19, 26, 34, 0.5);
}

.close {
  color: var(--accent);
  float: right;
  font-size: clamp(24px, 4vw, 28px);
  font-weight: bold;
  cursor: pointer;
  min-width: 44px; /* Better touch target */
  min-height: 44px;
  display: flex;
  align-items: center;
  justify-content: center;
  line-height: 1;
}

.close:hover,
.close:focus {
  color: var(--accent-hover);
  text-decoration: none;
}

.modal h2 {
  color: var(--accent);
  margin-bottom: clamp(15px, 2.5vw, 20px);
  text-align: center;
  font-size: clamp(1.4em, 3.5vw, 1.8em);
  padding: 0 clamp(10px, 2vw, 20px);
}

/* ============================================
   Terms & Conditions Modal
   ============================================ */
.terms-text p {
  color: var(--text);
  margin-bottom: clamp(12px, 2vw, 15px);
  line-height: 1.6;
  font-size: clamp(0.9em, 2vw, 1em);
}

.terms-text strong {
  color: var(--credit);
}

/* ============================================
   Debug Modal Styles (for development)
   ============================================ */
#terms-modal.modal {
  display: none;
  position: fixed !important;
  z-index: 99999 !important;
  left: 0;
  top: 0;
  width: 100vw;
  height: 100vh;
  background: rgba(0,0,0,0.85);
  backdrop-filter: blur(5px);
  justify-content: center;
  align-items: center;
}

#terms-modal .modal-content {
  background: #222;
  margin: clamp(3%, 5vh, 5%) auto;
  padding: clamp(18px, 3vw, 24px);
  border-radius: clamp(10px, 1.5vw, 12px);
  max-width: 100%; /* Changed from 600px to prevent overflow */
  width: min(90%, 600px);
  box-shadow: 0 10px 30px rgba(0,0,0,0.5);
  color: #ececec;
  position: relative;
  box-sizing: border-box;
  overflow-x: hidden;
}

@media (max-width: 768px) {
  #terms-modal .modal-content {
    width: 95%;
    margin: 10px auto;
    padding: 20px 15px;
  }
}

@media (max-width: 480px) {
  #terms-modal .modal-content {
    width: 98%;
    margin: 5px auto;
    padding: 18px 12px;
  }
}

/* ============================================
   Section Heading Overrides (for consistency)
   ============================================ */
.offers h2, 
.team h2, 
.treasury h2 {
  font-size: clamp(1.6em, 4vw, 2em) !important;
  color: var(--accent) !important;
  margin-bottom: clamp(24px, 4vw, 32px) !important;
  text-align: center !important;
}

/* ============================================
   Fireworks Celebration Overlay
   ============================================ */
.fireworks-overlay {
  position: fixed;
  inset: 0;
  z-index: 120000;
  display: none;
  align-items: center;
  justify-content: center;
  background: radial-gradient(circle at top, rgba(0, 0, 0, 0.4), #000);
}

.fireworks-canvas {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  display: block;
  cursor: crosshair;
}

.fireworks-message {
  position: relative;
  z-index: 1;
  max-width: min(480px, 90vw); /* Responsive width to prevent overflow */
  width: 100%;
  margin: 0 clamp(8px, 2vw, 16px);
  padding: clamp(16px, 3vw, 24px);
  border-radius: 16px;
  background: rgba(15, 23, 32, 0.92);
  box-sizing: border-box;
  box-shadow: 0 14px 40px rgba(0, 0, 0, 0.8);
  text-align: center;
}

.fireworks-message h2 {
  margin: 0 0 8px;
  font-size: clamp(1.4rem, 3vw, 1.8rem);
  color: var(--accent);
}

.fireworks-message p {
  margin: 0 0 18px;
  font-size: 0.95rem;
  color: var(--text);
}

.fireworks-home-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 10px 22px;
  border-radius: 999px;
  border: none;
  font: inherit;
  cursor: pointer;
  background: var(--accent);
  color: #050b12;
  box-shadow: 0 0 0 1px rgba(0, 0, 0, 0.4), 0 10px 25px rgba(63, 224, 249, 0.4);
  transition: transform 0.15s ease, box-shadow 0.15s ease, background 0.15s ease;
}

.fireworks-home-btn:hover,
.fireworks-home-btn:focus-visible {
  background: var(--accent-hover);
  transform: translateY(-1px);
  box-shadow: 0 0 0 1px rgba(0, 0, 0, 0.5), 0 14px 32px rgba(63, 224, 249, 0.55);
}

.fireworks-home-btn:active {
  transform: translateY(0);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.8);
}

