/* Custom Styles & Animation Engine for Utkalmani Adarsh Charitable Trust Website */

@layer utilities {
  .text-balance {
    text-wrap: balance;
  }
}

/* Base Smooth Scrolling & Typography */
html {
  scroll-behavior: smooth;
  -webkit-font-smoothing: antialiased;
}

body {
  font-family: 'Plus Jakarta Sans', system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
  color: #1e293b;
  background-color: #faf8f5;
  overflow-x: hidden;
}

/* Selection Color */
::selection {
  background-color: #f97316;
  color: #ffffff;
}

/* Custom Scrollbar */
::-webkit-scrollbar {
  width: 10px;
}
::-webkit-scrollbar-track {
  background: #f1f5f9;
}
::-webkit-scrollbar-thumb {
  background: #cbd5e1;
  border-radius: 5px;
}
::-webkit-scrollbar-thumb:hover {
  background: #f97316;
}

/* Elegant Glassmorphism */
.glass-nav {
  background: rgba(255, 255, 255, 0.88);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  border-bottom: 1px solid rgba(226, 232, 240, 0.8);
}

.glass-card {
  background: rgba(255, 255, 255, 0.85);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  border: 1px solid rgba(255, 255, 255, 0.9);
}

.glass-dark {
  background: rgba(15, 23, 42, 0.85);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border: 1px solid rgba(255, 255, 255, 0.1);
}

/* Keyframe Animations */
@keyframes floatSlow {
  0%, 100% {
    transform: translateY(0px) rotate(0deg);
  }
  50% {
    transform: translateY(-8px) rotate(0.5deg);
  }
}

@keyframes floatReverse {
  0%, 100% {
    transform: translateY(0px) rotate(0deg);
  }
  50% {
    transform: translateY(8px) rotate(-0.5deg);
  }
}

@keyframes pulseSubtle {
  0%, 100% {
    transform: scale(1);
    opacity: 1;
  }
  50% {
    transform: scale(1.04);
    opacity: 0.95;
  }
}

@keyframes gentleGlow {
  0%, 100% {
    box-shadow: 0 0 15px rgba(249, 115, 22, 0.3);
  }
  50% {
    box-shadow: 0 0 25px rgba(249, 115, 22, 0.6);
  }
}

@keyframes marquee {
  0% { transform: translateX(0%); }
  100% { transform: translateX(-50%); }
}

.animate-float {
  animation: floatSlow 5s ease-in-out infinite;
}

.animate-float-delayed {
  animation: floatReverse 6s ease-in-out infinite 1.5s;
}

.animate-pulse-subtle {
  animation: pulseSubtle 3s ease-in-out infinite;
}

.animate-glow {
  animation: gentleGlow 3s ease-in-out infinite;
}

.animate-marquee {
  display: flex;
  width: 200%;
  animation: marquee 28s linear infinite;
}
.animate-marquee:hover {
  animation-play-state: paused;
}

/* Scroll-triggered reveal animations via IntersectionObserver */
.reveal {
  opacity: 0;
  transform: translateY(28px);
  transition: opacity 0.8s cubic-bezier(0.16, 1, 0.3, 1), transform 0.8s cubic-bezier(0.16, 1, 0.3, 1);
  will-change: opacity, transform;
}

.reveal.reveal-left {
  transform: translateX(-35px);
}

.reveal.reveal-right {
  transform: translateX(35px);
}

.reveal.reveal-zoom {
  transform: scale(0.92);
}

.reveal.is-visible {
  opacity: 1;
  transform: translate(0, 0) scale(1);
}

/* Stagger Delays */
.delay-100 { transition-delay: 100ms; }
.delay-200 { transition-delay: 200ms; }
.delay-300 { transition-delay: 300ms; }
.delay-400 { transition-delay: 400ms; }
.delay-500 { transition-delay: 500ms; }
.delay-600 { transition-delay: 600ms; }

/* Image hover effect */
.img-zoom-container {
  overflow: hidden;
}
.img-zoom-container img {
  transition: transform 0.6s cubic-bezier(0.25, 1, 0.5, 1);
}
.img-zoom-container:hover img {
  transform: scale(1.06);
}

/* Quote Marks Styling */
.quote-decor::before {
  content: "“";
  font-family: 'Playfair Display', serif;
  font-size: 5rem;
  line-height: 1;
  position: absolute;
  top: -1.5rem;
  left: 1rem;
  color: #fed7aa;
  opacity: 0.6;
  pointer-events: none;
}

/* Background Patterns */
.pattern-dots {
  background-image: radial-gradient(rgba(249, 115, 22, 0.12) 1.5px, transparent 1.5px);
  background-size: 24px 24px;
}

.pattern-grid {
  background-size: 40px 40px;
  background-image: 
    linear-gradient(to right, rgba(0, 0, 0, 0.03) 1px, transparent 1px),
    linear-gradient(to bottom, rgba(0, 0, 0, 0.03) 1px, transparent 1px);
}

/* Modal Dialog Backdrop Styling */
dialog::backdrop {
  background: rgba(15, 23, 42, 0.65);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
}

/* Top Toast notification animation */
.toast-slide {
  transform: translateY(-100%);
  transition: transform 0.35s cubic-bezier(0.16, 1, 0.3, 1), opacity 0.35s ease;
}
.toast-slide.toast-show {
  transform: translateY(0);
}

/* ================= ACCESSIBILITY SUITE MODES ================= */

/* High Contrast Mode (WCAG AAA standard: high-visibility yellow/white on true black) */
html.high-contrast,
html.high-contrast body {
  background-color: #000000 !important;
  color: #ffff00 !important;
}

html.high-contrast header,
html.high-contrast footer,
html.high-contrast section,
html.high-contrast aside:not(#a11y-drawer),
html.high-contrast div:not(#a11y-drawer *),
html.high-contrast article {
  background-color: #000000 !important;
  color: #ffffff !important;
  border-color: #ffff00 !important;
  box-shadow: none !important;
}

html.high-contrast h1,
html.high-contrast h2,
html.high-contrast h3,
html.high-contrast h4,
html.high-contrast .text-transparent {
  color: #ffff00 !important;
  -webkit-text-fill-color: #ffff00 !important;
  background: none !important;
}

html.high-contrast p,
html.high-contrast span:not(.toggle-indicator) {
  color: #ffffff !important;
}

html.high-contrast a,
html.high-contrast button:not(#a11y-drawer *) {
  color: #00ffff !important;
  border-color: #00ffff !important;
}

html.high-contrast img {
  filter: contrast(130%) brightness(100%);
}

/* Dyslexia-Friendly / Extra Readable Font Mode */
html.readable-font body,
html.readable-font h1,
html.readable-font h2,
html.readable-font h3,
html.readable-font h4,
html.readable-font p,
html.readable-font a,
html.readable-font span {
  font-family: Arial, Helvetica, 'Trebuchet MS', Verdana, sans-serif !important;
  letter-spacing: 0.04em !important;
  word-spacing: 0.08em !important;
  line-height: 1.85 !important;
}

/* Highlight Links Mode */
html.highlight-links a,
html.highlight-links button:not(#a11y-drawer *):not(#floating-a11y-fab) {
  outline: 3px dashed #ea580c !important;
  outline-offset: 3px !important;
  text-decoration: underline !important;
  text-decoration-thickness: 2px !important;
  text-decoration-color: #ea580c !important;
}

/* Reduce Motion Mode */
html.reduce-motion *,
html.reduce-motion *::before,
html.reduce-motion *::after {
  animation-duration: 0.001s !important;
  animation-iteration-count: 1 !important;
  transition-duration: 0.001s !important;
  scroll-behavior: auto !important;
}

html.reduce-motion .reveal {
  opacity: 1 !important;
  transform: none !important;
}

/* Enhanced Keyboard Focus Ring for Accessibility */
a:focus-visible,
button:focus-visible,
input:focus-visible {
  outline: 3px solid #f97316 !important;
  outline-offset: 2px !important;
}

/* Speaking active pulse */
.speech-speaking {
  box-shadow: 0 0 0 3px rgba(234, 88, 12, 0.4), 0 0 20px rgba(249, 115, 22, 0.5) !important;
}
