/* ---------------------------------------------------
   Rekha Foundation — custom styles
   Design system: "Serene Recovery Path"
   Sophisticated Glassmorphism nested in a Material Design 3
   functional framework. Tailwind handles utility classes;
   this file holds what Tailwind can't: glass elevation,
   keyframes, and the signature line-draw animation.
--------------------------------------------------- */

html { scroll-behavior: smooth; }

::selection { background: #D4AF37; color: #f4faff; }

/* ---- Glassmorphism card (spec: Elevation > Surface Layer) ----
   Semi-transparent white, 20px backdrop blur, 1px glass-border,
   tinted ambient shadow using a hint of Primary Emerald. */
.glass-card {
    background: rgba(255, 255, 255, 0.7);
    -webkit-backdrop-filter: blur(20px);
    backdrop-filter: blur(20px);
    border: 1px solid rgba(255, 255, 255, 0.4);
    box-shadow: 0 10px 30px rgba(31, 138, 112, 0.08);
}

/* Scroll reveal */
.reveal { opacity: 0; transform: translateY(24px); transition: opacity 0.7s ease-out, transform 0.7s ease-out; }
.reveal.active { opacity: 1; transform: translateY(0); }

@media (prefers-reduced-motion: reduce) {
    .reveal { opacity: 1; transform: none; transition: none; }
    html { scroll-behavior: auto; }
}

/* Signature hero line — draws itself in on load */
.rekha-line {
    stroke-dasharray: 600;
    stroke-dashoffset: 600;
    animation: draw-line 2.2s ease-out forwards 0.3s;
}
@keyframes draw-line {
    to { stroke-dashoffset: 0; }
}
@media (prefers-reduced-motion: reduce) {
    .rekha-line { stroke-dashoffset: 0; animation: none; }
}

/* Journey connector on programs.php — gold to emerald,
   mirroring the crisis -> stability arc of the signature line. */
.journey-track {
    position: absolute;
    left: 27px;
    top: 0;
    bottom: 0;
    width: 2px;
    background: linear-gradient(to bottom, #D4AF37 0%, #006953 100%);
}
@media (max-width: 767px) {
    .journey-track { left: 19px; }
}

.stage-dot {
    box-shadow: 0 0 0 6px #f4faff;
}

/* Card hover lift — quiet, not scattered */
.lift { transition: transform 0.3s ease, box-shadow 0.3s ease; }
.lift:hover { transform: translateY(-4px); box-shadow: 0 14px 34px rgba(31, 138, 112, 0.14); }

/* Pill-shaped chips/tags (spec: Chips & Tags) */
.chip {
    background: #d7e4ec; /* secondary-container */
    color: #5a666d;      /* on-secondary-container */
    border-radius: 9999px;
}

/* Focus visibility (accessibility floor) */
a:focus-visible, button:focus-visible, input:focus-visible, textarea:focus-visible {
    outline: 2px solid #D4AF37;
    outline-offset: 2px;
}

/* Text shadow for hero text over photos with a lighter overlay */
.text-shadow-hero {
    text-shadow: 0 2px 10px rgba(0, 0, 0, 0.35);
}

/* Page loader — spinning ring around the logo, fades out once loaded */
#page-loader {
    transition: opacity 0.5s ease, visibility 0.5s ease;
}
#page-loader.loader-hidden {
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
}
.loader-ring {
    animation: loader-spin 0.9s linear infinite;
}
@keyframes loader-spin {
    to { transform: rotate(360deg); }
}
@media (prefers-reduced-motion: reduce) {
    .loader-ring { animation: none; }
}

/* Small inline spinner for buttons (e.g. contact form submit) */
.btn-spinner {
    display: inline-block;
    width: 15px;
    height: 15px;
    border: 2px solid rgba(255, 255, 255, 0.4);
    border-top-color: #ffffff;
    border-radius: 9999px;
    animation: loader-spin 0.7s linear infinite;
    vertical-align: -2px;
    margin-right: 8px;
}
@media (prefers-reduced-motion: reduce) {
    .btn-spinner { animation: none; }
}

/* Centered success toast (contact form) */
#success-toast.toast-visible {
    opacity: 1;
    pointer-events: auto;
}
#success-toast.toast-visible .toast-card {
    transform: scale(1);
}

/* Floating WhatsApp button — injected by main.js on every page */
.wa-float {
    position: fixed;
    right: 20px;
    bottom: 20px;
    width: 58px;
    height: 58px;
    border-radius: 9999px;
    background: #006953;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 8px 24px rgba(20, 35, 28, 0.28);
    z-index: 60;
    transition: transform 0.2s ease;
}
.wa-float:hover, .wa-float:focus-visible { transform: scale(1.08); }
.wa-float-ring {
    position: absolute;
    inset: 0;
    border-radius: 9999px;
    background: #006953;
    opacity: 0.45;
    animation: wa-pulse 2.4s ease-out infinite;
    pointer-events: none;
}
@keyframes wa-pulse {
    0% { transform: scale(1); opacity: 0.45; }
    100% { transform: scale(1.7); opacity: 0; }
}
@media (prefers-reduced-motion: reduce) {
    .wa-float-ring { animation: none; display: none; }
}
@media (max-width: 640px) {
    .wa-float { right: 14px; bottom: 14px; width: 52px; height: 52px; }
}
