/* -----------------------------------------------------------
   DARKROOT COMICS – LEAD MAGNET PREVIEW STYLES
   Dark gothic aesthetic for Zeravos preview funnel
----------------------------------------------------------- */

/* ========================
   CUSTOM PROPERTIES
======================== */
:root {
  --gold-primary: #e2b144;
  --gold-light: #ffe97b;
  --gold-dark: #cda105;
  --bg-dark: #030712;
  --bg-card: rgba(0, 0, 0, 0.8);
  --border-subtle: #1f2937;
  --text-muted: #9ca3af;
}

/* ========================
   BASE OVERRIDES
======================== */

/* Remove halftone on preview pages for cleaner look */
.preview-page body::before {
  display: none;
}

/* Custom select dropdown arrow */
select {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' fill='none' viewBox='0 0 24 24' stroke='%23e2b144'%3E%3Cpath stroke-linecap='round' stroke-linejoin='round' stroke-width='2' d='M19 9l-7 7-7-7'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 0.75rem center;
  background-size: 1.25rem;
  padding-right: 2.5rem;
}

/* Custom checkbox styling */
input[type="checkbox"] {
  appearance: none;
  -webkit-appearance: none;
  width: 1.25rem;
  height: 1.25rem;
  background-color: #111827;
  border: 2px solid #374151;
  border-radius: 0.25rem;
  cursor: pointer;
  transition: all 0.2s ease;
  position: relative;
}

input[type="checkbox"]:checked {
  background-color: var(--gold-primary);
  border-color: var(--gold-primary);
}

input[type="checkbox"]:checked::after {
  content: '';
  position: absolute;
  left: 5px;
  top: 2px;
  width: 5px;
  height: 10px;
  border: solid black;
  border-width: 0 2px 2px 0;
  transform: rotate(45deg);
}

input[type="checkbox"]:focus {
  outline: none;
  box-shadow: 0 0 0 2px rgba(226, 177, 68, 0.3);
}

/* ========================
   FORM ELEMENTS
======================== */

/* Input focus states */
input:focus,
select:focus {
  outline: none;
  border-color: var(--gold-primary);
  box-shadow: 0 0 0 3px rgba(226, 177, 68, 0.15);
}

/* Placeholder styling */
::placeholder {
  color: #6b7280;
  opacity: 1;
}

/* ========================
   ADVISORY MODAL
======================== */
#advisoryModal {
  animation: fadeIn 0.3s ease-out;
}

#advisoryModal > div {
  animation: slideUp 0.4s ease-out;
}

@keyframes fadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

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

/* ========================
   PDF READER
======================== */

/* Prevent text selection in reader */
#readerContainer {
  user-select: none;
  -webkit-user-select: none;
  -moz-user-select: none;
  -ms-user-select: none;
}

/* Canvas container scrolling */
#canvasContainer {
  scrollbar-width: thin;
  scrollbar-color: var(--gold-primary) #111827;
}

#canvasContainer::-webkit-scrollbar {
  width: 8px;
  height: 8px;
}

#canvasContainer::-webkit-scrollbar-track {
  background: #111827;
}

#canvasContainer::-webkit-scrollbar-thumb {
  background-color: var(--gold-primary);
  border-radius: 4px;
}

#canvasContainer::-webkit-scrollbar-thumb:hover {
  background-color: var(--gold-light);
}

/* PDF page shadow */
#pdfCanvas {
  box-shadow: 
    0 25px 50px -12px rgba(0, 0, 0, 0.5),
    0 0 0 1px rgba(255, 255, 255, 0.05);
  border-radius: 2px;
}

/* ========================
   CONTROL BUTTONS
======================== */

/* Button hover effects */
#prevPage:not(:disabled):hover,
#nextPage:not(:disabled):hover {
  background-color: #374151;
  border-color: var(--gold-primary);
}

#zoomIn:hover,
#zoomOut:hover {
  color: var(--gold-primary);
}

/* Disabled state */
button:disabled {
  cursor: not-allowed;
}

/* ========================
   LOADING ANIMATION
======================== */

.loading-spinner {
  animation: spin 1s linear infinite;
}

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

/* ========================
   RESPONSIVE ADJUSTMENTS
======================== */

@media (max-width: 640px) {
  /* Smaller form padding on mobile */
  .bg-black\/80 {
    padding: 1.5rem;
  }

  /* Stack controls vertically on mobile */
  #prevPage span,
  #nextPage span {
    display: none;
  }

  /* Adjust canvas container for mobile */
  #canvasContainer {
    padding: 1rem;
  }
}

/* ========================
   GLOW EFFECTS
======================== */

/* Gold glow on hover for interactive elements */
.interactive-glow:hover {
  box-shadow: 0 0 20px rgba(226, 177, 68, 0.3);
}

/* Subtle pulse animation for CTA */
@keyframes pulse-gold {
  0%, 100% {
    box-shadow: 
      0 4px 12px rgba(242, 182, 7, 0.4),
      inset 0 0 4px rgba(0, 0, 0, 0.3);
  }
  50% {
    box-shadow: 
      0 4px 20px rgba(242, 182, 7, 0.6),
      inset 0 0 4px rgba(0, 0, 0, 0.3);
  }
}

.pulse-cta {
  animation: pulse-gold 2s ease-in-out infinite;
}

/* ========================
   DARK THEME UTILITIES
======================== */

/* Vignette overlay for dramatic effect */
.vignette::after {
  content: '';
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: radial-gradient(
    ellipse at center,
    transparent 0%,
    transparent 60%,
    rgba(0, 0, 0, 0.4) 100%
  );
  pointer-events: none;
  z-index: 0;
}

/* Gothic border accent */
.gothic-border {
  border: 1px solid var(--border-subtle);
  position: relative;
}

.gothic-border::before,
.gothic-border::after {
  content: '';
  position: absolute;
  width: 20px;
  height: 20px;
  border: 2px solid var(--gold-primary);
}

.gothic-border::before {
  top: -4px;
  left: -4px;
  border-right: none;
  border-bottom: none;
}

.gothic-border::after {
  bottom: -4px;
  right: -4px;
  border-left: none;
  border-top: none;
}

/* ========================
   ACCESSIBILITY
======================== */

/* Focus visible for keyboard navigation */
button:focus-visible,
a:focus-visible,
input:focus-visible,
select:focus-visible {
  outline: 2px solid var(--gold-primary);
  outline-offset: 2px;
}

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

/* ========================
   PRINT STYLES
======================== */

@media print {
  #advisoryModal,
  header,
  footer,
  .controls-bar {
    display: none !important;
  }

  #pdfCanvas {
    box-shadow: none;
    max-width: 100%;
  }
}
