/* ==========================================================================
   ColoringPages-forKids.com — Custom Stylesheet
   Tailwind (CDN) handles utility classes; this file holds everything
   Tailwind can't express out of the box: glassmorphism, blobs, keyframe
   animation, the confetti canvas, dark-mode variables, and custom cursor.
   ========================================================================== */

:root {
  --bg-page: #FAFBFF;
  --bg-section: #FFFFFF;
  --text-primary: #1E1B3A;
  --text-secondary: #5B5876;
  --nav-bg: rgba(255, 255, 255, 0.65);
  --card-bg: rgba(255, 255, 255, 0.55);
  --card-border: rgba(255, 255, 255, 0.85);
  --shadow-soft: 0 20px 60px -15px rgba(99, 102, 241, 0.25);
}
*{
  background: transparent;
}

[data-theme="dark"] {
  --bg-page: #131226;
  --bg-section: #1B1A34;
  --text-primary: #F4F3FF;
  --text-secondary: #B7B4D6;
  --nav-bg: rgba(19, 18, 38, 0.65);
  --card-bg: rgba(38, 36, 68, 0.55);
  --card-border: rgba(139, 92, 246, 0.25);
  --shadow-soft: 0 20px 60px -15px rgba(0, 0, 0, 0.5);
}

* {
  scroll-behavior: smooth;
}

@media (prefers-reduced-motion: reduce) {
  * {
    animation-duration: 0.001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.001ms !important;
    scroll-behavior: auto !important;
  }
}

body {
  background-color: var(--bg-page);
  color: var(--text-primary);
  font-family: 'Poppins', sans-serif;
  transition: background-color 0.4s ease, color 0.4s ease;
  overflow-x: hidden;
}

h1, h2, h3, h4, .font-display {
  font-family: 'Baloo 2', cursive;
}

/* ---------------------------------------------------------------------- */
/* Gradient text + keyword highlights                                     */
/* ---------------------------------------------------------------------- */
.text-gradient {
  background-image: linear-gradient(90deg, #6366F1, #8B5CF6, #F472B6);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

/* ---------------------------------------------------------------------- */
/* Glassmorphism                                                          */
/* ---------------------------------------------------------------------- */
.glass {
  background: var(--card-bg);
  backdrop-filter: blur(16px) saturate(160%);
  -webkit-backdrop-filter: blur(16px) saturate(160%);
  border: 1px solid var(--card-border);
  box-shadow: var(--shadow-soft);
}

#navbar {
  background: transparent;
  transition: background-color 0.4s ease, box-shadow 0.4s ease, backdrop-filter 0.4s ease;
}

#navbar.scrolled {
  background: var(--nav-bg);
  backdrop-filter: blur(18px) saturate(160%);
  -webkit-backdrop-filter: blur(18px) saturate(160%);
  box-shadow: 0 8px 30px -12px rgba(99, 102, 241, 0.25);
}

/* ---------------------------------------------------------------------- */
/* Floating gradient blobs                                                */
/* ---------------------------------------------------------------------- */
.blob {
  position: absolute;
  border-radius: 50%;
  filter: blur(60px);
  opacity: 0.45;
  z-index: 0;
  pointer-events: none;
  animation: float-blob 12s ease-in-out infinite;
}

[data-theme="dark"] .blob {
  opacity: 0.28;
}
 

@keyframes float-y {
  0%, 100% { transform: translateY(0) rotate(0deg); }
  50%      { transform: translateY(-16px) rotate(4deg); }
}

@keyframes spin {
  from { transform: rotate(0deg); }
  to   { transform: rotate(360deg); }
}

@keyframes twinkle {
  0%, 100% { opacity: 0.3; transform: scale(0.85); }
  50%      { opacity: 1;   transform: scale(1.15); }
}
.twinkle { animation: twinkle 2.4s ease-in-out infinite; }

/* ---------------------------------------------------------------------- */
/* Scroll-triggered reveal animations (toggled via Intersection Observer) */
/* ---------------------------------------------------------------------- */
.reveal {
  opacity: 0;
  transition: opacity 0.7s cubic-bezier(0.22, 1, 0.36, 1), transform 0.7s cubic-bezier(0.22, 1, 0.36, 1);
}
.reveal.fade-up    { transform: translateY(36px); }
.reveal.slide-left  { transform: translateX(-48px); }
.reveal.slide-right { transform: translateX(48px); }
.reveal.zoom-in     { transform: scale(0.88); }

.reveal.is-visible {
  opacity: 1;
  transform: translate(0, 0) scale(1);
}

/* ---------------------------------------------------------------------- */
/* Cards + hover interactions                                             */
/* ---------------------------------------------------------------------- */
.category-card, .benefit-card, .feature-card, .testimonial-card {
  transition: transform 0.35s cubic-bezier(0.22, 1, 0.36, 1), box-shadow 0.35s ease, border-color 0.35s ease;
}

.category-card:hover, .benefit-card:hover {
  transform: translateY(-10px) scale(1.02);
}

.category-card:hover .cat-glow {
  opacity: 1;
}

.cat-glow {
  opacity: 0;
  transition: opacity 0.4s ease;
}

/* ---------------------------------------------------------------------- */
/* Buttons: ripple + hover glow                                           */
/* ---------------------------------------------------------------------- */
.btn-ripple {
  position: relative;
  overflow: hidden;
}

.btn-ripple .ripple {
  position: absolute;
  border-radius: 9999px;
  background: rgba(255, 255, 255, 0.55);
  transform: scale(0);
  animation: ripple-anim 0.6s ease-out;
  pointer-events: none;
}

@keyframes ripple-anim {
  to {
    transform: scale(3.5);
    opacity: 0;
  }
}

.btn-glow {
  box-shadow: 0 8px 24px -8px rgba(99, 102, 241, 0.55);
}
.btn-glow:hover {
  box-shadow: 0 12px 32px -6px rgba(139, 92, 246, 0.65);
}

/* ---------------------------------------------------------------------- */
/* Scroll progress bar                                                    */
/* ---------------------------------------------------------------------- */
#scroll-progress {
  position: fixed;
  top: 0;
  left: 0;
  height: 4px;
  width: 0%;
  background: linear-gradient(90deg, #6366F1, #8B5CF6, #F472B6, #FBBF24);
  z-index: 100;
  transition: width 0.1s ease-out;
}

/* ---------------------------------------------------------------------- */
/* Back to top button                                                     */
/* ---------------------------------------------------------------------- */
#back-to-top {
  position: fixed;
  bottom: 24px;
  right: 24px;
  z-index: 90;
  opacity: 0;
  visibility: hidden;
  transform: translateY(16px) scale(0.9);
  transition: all 0.35s cubic-bezier(0.22, 1, 0.36, 1);
}
#back-to-top.visible {
  opacity: 1;
  visibility: visible;
  transform: translateY(0) scale(1);
}

/* ---------------------------------------------------------------------- */
/* Custom cursor sparkle (desktop only)                                   */
/* ---------------------------------------------------------------------- */
.cursor-dot {
  position: fixed;
  top: 0;
  left: 0;
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: radial-gradient(circle, #F472B6, #8B5CF6);
  pointer-events: none;
  z-index: 9999;
  transform: translate(-50%, -50%);
  transition: opacity 0.3s ease;
  mix-blend-mode: multiply;
}
[data-theme="dark"] .cursor-dot {
  mix-blend-mode: screen;
}

@media (hover: none) {
  .cursor-dot { display: none; }
}

/* ---------------------------------------------------------------------- */
/* Dark-mode toggle icon swap                                             */
/* ---------------------------------------------------------------------- */
.theme-toggle-btn .icon-sun { display: none; }
.theme-toggle-btn .icon-moon { display: inline-block; }
[data-theme="dark"] .theme-toggle-btn .icon-sun { display: inline-block; }
[data-theme="dark"] .theme-toggle-btn .icon-moon { display: none; }

/* ---------------------------------------------------------------------- */
/* Accordion (FAQ)                                                        */
/* ---------------------------------------------------------------------- */
.faq-answer {
  max-height: 0;
  overflow: hidden;
  transition: max-height 0.4s cubic-bezier(0.22, 1, 0.36, 1), padding 0.4s ease;
}
.faq-item[data-open="true"] .faq-answer {
  max-height: 240px;
}
.faq-item[data-open="true"] .faq-chevron {
  transform: rotate(180deg);
}
.faq-chevron {
  transition: transform 0.35s ease;
}

/* ---------------------------------------------------------------------- */
/* Confetti canvas                                                        */
/* ---------------------------------------------------------------------- */
#confetti-canvas {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 9998;
}

/* ---------------------------------------------------------------------- */
/* Loading screen                                                         */
/* ---------------------------------------------------------------------- */
#loader {
  position: fixed;
  inset: 0;
  z-index: 9999;
  background: var(--bg-page);
  display: flex;
  align-items: center;
  justify-content: center;
  transition: opacity 0.6s ease, visibility 0.6s ease;
}
#loader.hidden {
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
}
.crayon-loader {
  display: flex;
  gap: 8px;
}
.crayon-loader span {
  width: 12px;
  height: 34px;
  border-radius: 6px;
  animation: crayon-bounce 1s ease-in-out infinite;
}
.crayon-loader span:nth-child(1) { background: #6366F1; animation-delay: 0s; }
.crayon-loader span:nth-child(2) { background: #F472B6; animation-delay: 0.12s; }
.crayon-loader span:nth-child(3) { background: #FBBF24; animation-delay: 0.24s; }
.crayon-loader span:nth-child(4) { background: #34D399; animation-delay: 0.36s; }
.crayon-loader span:nth-child(5) { background: #60A5FA; animation-delay: 0.48s; }

@keyframes crayon-bounce {
  0%, 100% { transform: scaleY(0.6); }
  50%      { transform: scaleY(1.3); }
}

/* ---------------------------------------------------------------------- */
/* Section background helpers                                             */
/* ---------------------------------------------------------------------- */
.bg-section { background-color: var(--bg-section); transition: background-color 0.4s ease; }
.text-secondary { color: var(--text-secondary); }

/* Utility: dashed connector line for "How it works" timeline */
.timeline-line {
  background-image: repeating-linear-gradient(to bottom, #C7C4F0 0, #C7C4F0 6px, transparent 6px, transparent 14px);
  width: 3px;
}
@media (min-width: 768px) {
  .timeline-line-h {
    background-image: repeating-linear-gradient(to right, #C7C4F0 0, #C7C4F0 6px, transparent 6px, transparent 14px);
    height: 3px;
    width: 100%;
  }
}