/* Candy-themed design system with Berry Pop palette */

/* Import Fonts */
@import url("https://fonts.googleapis.com/css2?family=Fredoka:wght@400;500;600;700&family=Poppins:wght@400;500;600;700&display=swap");

/* CSS Variables - Berry Pop Palette */
:root {
  --bg: #fff8fd;
  --ink: #1a1420;
  --gum: #ff5da2;
  --candy: #ffb86b;
  --mint: #7de3c5;
  --blue: #7aa7ff;
  --paper: #ffffff;
  --line: #f3e5f1;

  --font-heading: "Fredoka", sans-serif;
  --font-body: "Poppins", sans-serif;
}

/* Base Styles */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  font-family: var(--font-body);
  background-color: var(--bg);
  color: var(--ink);
  line-height: 1.6;
}

/* Typography */
h1,
h2,
h3,
h4,
h5,
h6 {
  font-family: var(--font-heading);
  font-weight: 700;
  line-height: 1.2;
}

/* Scroll Reveal Animation */
@keyframes scrollReveal {
  from {
    opacity: 0;
    transform: translateY(14px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.scroll-reveal {
  animation: scrollReveal 0.45s ease-out forwards;
}

/* Slide Down Animation for Details */
@keyframes slideDown {
  from {
    opacity: 0;
    max-height: 0;
  }
  to {
    opacity: 1;
    max-height: 1000px;
  }
}

/* Header Scrolled State */
.header-scrolled {
  padding-top: 0.75rem !important;
  padding-bottom: 0.75rem !important;
  box-shadow: 0 4px 20px rgba(255, 93, 162, 0.15);
}

/* Sticker Frame Utility */
.sticker-frame {
  border-radius: 28px;
  border: 4px solid white;
  box-shadow: inset 0 0 0 2px rgba(0, 0, 0, 0.9), 0 10px 30px rgba(0, 0, 0, 0.1);
}

/* Glossy Effect */
.glossy {
  position: relative;
  overflow: hidden;
}

.glossy::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 40%;
  background: linear-gradient(to bottom, rgba(255, 255, 255, 0.3), transparent);
  pointer-events: none;
}

/* Candy Dot Markers */
.candy-dot {
  width: 12px;
  height: 12px;
  border-radius: 50%;
  flex-shrink: 0;
}

/* Form Input Focus States */
input:focus,
textarea:focus,
select:focus {
  outline: none;
  border-color: var(--gum);
  box-shadow: 0 0 0 3px rgba(255, 93, 162, 0.1);
}

/* Error State */
.border-red-500 {
  border-color: #ef4444 !important;
}

/* Button Hover Effects */
button,
a[class*="rounded-full"] {
  transition: all 0.3s ease;
}

button:hover,
a[class*="rounded-full"]:hover {
  transform: translateY(-2px);
}

/* Card Hover Effects */
[class*="rounded-3xl"]:hover {
  transform: translateY(-4px);
  transition: transform 0.3s ease;
}

/* Details Element Styling */
details summary {
  user-select: none;
}

details[open] summary svg {
  transform: rotate(180deg);
}

/* Mobile Menu Transition */
#mobileMenu {
  transition: all 0.3s ease;
}

/* Cookie Popup Animation */
#cookiePopup {
  transition: transform 0.3s ease-in-out;
}

/* Smooth Scrollbar */
::-webkit-scrollbar {
  width: 10px;
}

::-webkit-scrollbar-track {
  background: var(--bg);
}

::-webkit-scrollbar-thumb {
  background: var(--gum);
  border-radius: 5px;
}

::-webkit-scrollbar-thumb:hover {
  background: var(--candy);
}

/* Image Loading Effect */
img {
  transition: opacity 0.3s ease, transform 0.3s ease;
}

img:not([src]) {
  opacity: 0;
}

/* Accessibility */
.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border-width: 0;
}

/* Focus Visible */
:focus-visible {
  outline: 2px solid var(--gum);
  outline-offset: 2px;
}

/* Reduced Motion */
@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }
}

/* Responsive Typography */
@media (max-width: 640px) {
  h1 {
    font-size: 2rem;
    line-height: 1.2;
  }

  h2 {
    font-size: 1.75rem;
    line-height: 1.3;
  }

  h3 {
    font-size: 1.5rem;
    line-height: 1.4;
  }
}

/* Print Styles */
@media print {
  header,
  footer,
  #cookiePopup,
  button {
    display: none;
  }

  body {
    font-size: 12pt;
    line-height: 1.5;
  }
}

/* High Contrast Mode */
@media (prefers-contrast: high) {
  body {
    color: #000;
    background: #fff;
  }

  a {
    text-decoration: underline;
  }
}

/* Text Balance */
.text-balance {
  text-wrap: balance;
}

.text-pretty {
  text-wrap: pretty;
}

/* Aspect Ratios */
.aspect-square {
  aspect-ratio: 1 / 1;
}

.aspect-video {
  aspect-ratio: 16 / 9;
}

/* Button Loading State */
button.loading {
  position: relative;
  color: transparent;
}

button.loading::after {
  content: "";
  position: absolute;
  width: 16px;
  height: 16px;
  top: 50%;
  left: 50%;
  margin-left: -8px;
  margin-top: -8px;
  border: 2px solid #ffffff;
  border-radius: 50%;
  border-top-color: transparent;
  animation: spinner 0.6s linear infinite;
}

@keyframes spinner {
  to {
    transform: rotate(360deg);
  }
}

/* Tooltip Styles */
[data-tooltip] {
  position: relative;
}

[data-tooltip]::before {
  content: attr(data-tooltip);
  position: absolute;
  bottom: 100%;
  left: 50%;
  transform: translateX(-50%);
  padding: 4px 8px;
  background: var(--ink);
  color: white;
  font-size: 0.875rem;
  white-space: nowrap;
  border-radius: 8px;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.3s;
}

[data-tooltip]:hover::before {
  opacity: 1;
}

/* Wavy Divider */
.wave-divider {
  width: 100%;
  height: 12px;
}

/* Bubble Decoration */
.bubble {
  border-radius: 50%;
  filter: blur(40px);
  opacity: 0.2;
  pointer-events: none;
}

/* Capsule Button */
.capsule-btn {
  padding: 0.5rem 1.5rem;
  border-radius: 9999px;
  font-weight: 700;
  transition: all 0.3s ease;
}

.capsule-btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 20px rgba(0, 0, 0, 0.15);
}

/* Grid Auto-Fit Centering */
.grid-center {
  display: grid;
  gap: 1.5rem;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  justify-items: center;
}
