/* ============================================================
   MyPartner.lk — Custom Styles
   Serendib Heritage Design System
   ============================================================ */

/* ── Scroll progress bar ────────────────────────────────── */
#scroll-progress {
  position: fixed;
  top: 0; left: 0;
  height: 3px;
  width: 0%;
  z-index: 200;
  background: linear-gradient(90deg, #962f16 0%, #b8ab70 60%, #fcbb51 100%);
  border-radius: 0 9999px 9999px 0;
  transition: width 0.08s linear;
  pointer-events: none;
}

/* ── Desktop nav link — active & base state ─────────────── */
.nav-link {
  position: relative;
  padding-bottom: 4px;
}
.nav-link::after {
  content: '';
  position: absolute;
  left: 50%; bottom: -2px;
  width: 0; height: 2px;
  background: #962f16;
  border-radius: 9999px;
  transform: translateX(-50%);
  transition: width 0.35s cubic-bezier(0.5, 0, 0, 1);
}
.nav-link:hover::after,
.nav-link.nav-active::after {
  width: 100%;
}
.nav-link.nav-active {
  color: #962f16 !important;
}

/* ── Nav link click ripple ──────────────────────────────── */
.nav-ripple {
  position: absolute;
  border-radius: 50%;
  transform: scale(0);
  background: rgba(150, 47, 22, 0.18);
  pointer-events: none;
  animation: nav-ripple-anim 0.55s cubic-bezier(0.4, 0, 0.2, 1) forwards;
}
@keyframes nav-ripple-anim {
  to { transform: scale(3.5); opacity: 0; }
}

/* ── Section arrival flash ──────────────────────────────── */
@keyframes section-arrive {
  0%   { outline: 3px solid rgba(150, 47, 22, 0); outline-offset: 0px; }
  25%  { outline: 3px solid rgba(150, 47, 22, 0.15); outline-offset: 8px; }
  100% { outline: 3px solid rgba(150, 47, 22, 0); outline-offset: 20px; }
}
.section-arrived {
  animation: section-arrive 0.9s cubic-bezier(0.4, 0, 0.2, 1) forwards;
}

/* ── Section heading arrival ────────────────────────────── */
@keyframes heading-pop {
  0%   { text-shadow: 0 0 0px rgba(150, 47, 22, 0); }
  30%  { text-shadow: 0 0 24px rgba(150, 47, 22, 0.25); }
  100% { text-shadow: 0 0 0px rgba(150, 47, 22, 0); }
}
.heading-pop {
  animation: heading-pop 0.8s ease-out forwards;
}

/* ── Stat figure counter animation ─────────────────────── */
.stat-figure {
  display: inline-block;
  transition: transform 0.4s cubic-bezier(0.34, 1.56, 0.64, 1),
              opacity 0.4s ease;
  opacity: 0;
  transform: translateY(16px) scale(0.85);
}
.stat-figure.counted {
  opacity: 1;
  transform: translateY(0) scale(1);
}



/* ── Glassmorphism card ─────────────────────────────────── */
.glass-card {
  background: rgba(255, 255, 255, 0.72);
  backdrop-filter: blur(24px);
  -webkit-backdrop-filter: blur(24px);
  border: 1px solid rgba(216, 201, 195, 0.4);
}

/* ── Elevation shadows ──────────────────────────────────── */
.premium-shadow {
  box-shadow: 0 10px 30px rgba(38, 30, 26, 0.04);
}

/* ── Hover lift effect ──────────────────────────────────── */
.hover-scale {
  transition: transform 0.3s ease, box-shadow 0.3s ease;
}
.hover-scale:hover {
  transform: scale(1.02) translateY(-4px);
  box-shadow: 0 20px 40px rgba(38, 30, 26, 0.08);
}

/* ── Keyframe animations ────────────────────────────────── */
@keyframes fade-in-up {
  from { opacity: 0; transform: translateY(20px); }
  to   { opacity: 1; transform: translateY(0); }
}

@keyframes float {
  0%, 100% { transform: translateY(0); }
  50%       { transform: translateY(-10px); }
}

/* ── Hero entry animations ──────────────────────────────── */
.animate-fade-in-up {
  animation: fade-in-up 0.8s cubic-bezier(0.16, 1, 0.3, 1) forwards;
  opacity: 0;
}
.delay-100 { animation-delay: 0.1s; }
.delay-200 { animation-delay: 0.2s; }
.delay-300 { animation-delay: 0.3s; }

/* ── Floating card / badge animations (respects prefers-reduced-motion) */
@media (prefers-reduced-motion: no-preference) {
  .float-card         { animation: float 6s ease-in-out infinite; }
  .float-card-reverse { animation: float 8s ease-in-out infinite reverse; }
  .float-badge        { animation: float 7s ease-in-out infinite; }

  /* Scroll-reveal base state */
  .reveal {
    opacity: 0;
    transform: translateY(35px) scale(0.97);
    transition: opacity 0.8s cubic-bezier(0.16, 1, 0.3, 1),
                transform 0.8s cubic-bezier(0.16, 1, 0.3, 1);
  }
  .reveal.active {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

@media (prefers-reduced-motion: reduce) {
  .animate-fade-in-up                        { animation: none; opacity: 1; }
  .float-card, .float-card-reverse, .float-badge { animation: none; }
  .reveal                                    { opacity: 1; transform: none; }
}

/* ── WebGL shader canvas ────────────────────────────────── */
#shader-canvas {
  position: absolute;
  top: 0; left: 0;
  width: 100%; height: 100%;
  z-index: 0;
  pointer-events: none;
}

/* ── Carousel ───────────────────────────────────────────── */
.carousel-container {
  scroll-snap-type: x mandatory;
  scrollbar-width: none;
  -ms-overflow-style: none;
}
.carousel-container::-webkit-scrollbar { display: none; }
.carousel-item { scroll-snap-align: center; }

/* ── FAQ accordion ──────────────────────────────────────── */
.faq-item {
  transition: border-color 0.3s ease, box-shadow 0.3s ease, transform 0.3s ease;
}
.faq-item:hover {
  transform: translateY(-2px);
  box-shadow: 0 12px 30px rgba(38, 30, 26, 0.07);
}
.faq-item.active-item {
  border-color: rgba(150, 47, 22, 0.4) !important;
  box-shadow: 0 16px 36px rgba(150, 47, 22, 0.08);
}

.faq-answer {
  max-height: 0;
  overflow: hidden;
  opacity: 0;
  transform: translateY(-6px);
  transition: max-height 0.45s cubic-bezier(0.16, 1, 0.3, 1),
              opacity 0.35s ease,
              transform 0.35s ease;
}
.faq-answer.open {
  max-height: 300px;
  opacity: 1;
  transform: translateY(0);
}

.faq-icon {
  transition: transform 0.45s cubic-bezier(0.34, 1.56, 0.64, 1), color 0.3s ease;
}
.faq-icon.rotated {
  transform: rotate(180deg);
  color: #962f16 !important;
}

/* ── Form inputs ────────────────────────────────────────── */
input,
textarea {
  border: 1px solid rgba(216, 201, 195, 0.5);
  outline: none;
  transition: border-color 0.2s;
}
input:focus,
textarea:focus {
  border-color: #962f16;
  box-shadow: 0 0 0 2px rgba(150, 47, 22, 0.12);
}

/* ── Material Symbols Protection (Prevent font override) ── */
.material-symbols-outlined,
html[lang="si"] .material-symbols-outlined,
html[lang="si"] span.material-symbols-outlined {
  font-family: 'Material Symbols Outlined' !important;
  word-break: normal !important;
  overflow-wrap: normal !important;
}

/* ── Sinhala Language & Typography Overrides ────────────── */
html[lang="si"] {
  font-family: 'Noto Sans Sinhala', 'Inter', sans-serif;
}
html[lang="si"] h1,
html[lang="si"] h2,
html[lang="si"] h3,
html[lang="si"] h4,
html[lang="si"] h5,
html[lang="si"] h6 {
  font-family: 'Noto Sans Sinhala', 'Manrope', sans-serif !important;
  line-height: 1.35;
  letter-spacing: 0em;
  word-break: break-word;
  overflow-wrap: break-word;
}
html[lang="si"] p,
html[lang="si"] span:not(.material-symbols-outlined),
html[lang="si"] a,
html[lang="si"] button,
html[lang="si"] input,
html[lang="si"] textarea {
  font-family: 'Noto Sans Sinhala', 'Inter', sans-serif;
  line-height: 1.6;
  word-break: break-word;
  overflow-wrap: break-word;
}

/* Sinhala: Heading Font Size Adjustments */
html[lang="si"] h1 {
  font-size: 34px !important;
  line-height: 1.35 !important;
}
@media (max-width: 768px) {
  html[lang="si"] h1 {
    font-size: 26px !important;
    line-height: 1.35 !important;
  }
}

html[lang="si"] h2 {
  font-size: 26px !important;
  line-height: 1.35 !important;
}

html[lang="si"] h3 {
  font-size: 18px !important;
  line-height: 1.35 !important;
}

/* Sinhala: Desktop top nav link font size & single-line wrapping */
html[lang="si"] .nav-link,
html[lang="si"] #desktop-nav-links a {
  font-size: 13px !important;
  white-space: nowrap !important;
  line-height: 1.2 !important;
}
html[lang="si"] #desktop-nav-links {
  gap: 1.25rem !important;
}

/* Sinhala: Button font size & single-line wrapping adjustment */
html[lang="si"] button,
html[lang="si"] a.rounded-full,
html[lang="si"] .glass-card a {
  font-size: 13.5px !important;
  white-space: nowrap;
}

/* Sinhala: Form placeholder font size adjustment */
html[lang="si"] input::placeholder,
html[lang="si"] textarea::placeholder {
  font-family: 'Noto Sans Sinhala', 'Inter', sans-serif;
  font-size: 13px !important;
  opacity: 0.65;
  font-weight: 400;
}

/* Sinhala: Form label font size adjustment */
html[lang="si"] label {
  font-family: 'Noto Sans Sinhala', 'Inter', sans-serif;
  font-size: 14.5px !important;
  font-weight: 600;
  letter-spacing: 0.02em;
}

/* Sinhala: FAQ answers container height adjustment */
html[lang="si"] .faq-answer.open {
  max-height: 400px;
}

/* ── Language Switcher Component ────────────────────────── */
.lang-switcher-container {
  display: inline-flex;
  align-items: center;
  background: rgba(150, 47, 22, 0.07);
  border: 1px solid rgba(150, 47, 22, 0.2);
  border-radius: 9999px;
  padding: 2px;
  transition: all 0.3s ease;
}
.lang-btn {
  border: none;
  background: transparent;
  color: #57423c;
  font-size: 13px;
  font-weight: 600;
  padding: 4px 12px;
  border-radius: 9999px;
  cursor: pointer;
  transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
  display: inline-flex;
  align-items: center;
  gap: 4px;
}
.lang-btn.active-lang {
  background: #962f16;
  color: #ffffff !important;
  box-shadow: 0 2px 8px rgba(150, 47, 22, 0.25);
}
.lang-btn:hover:not(.active-lang) {
  background: rgba(150, 47, 22, 0.12);
  color: #962f16;
}

/* ── Legal & Policy Pages Styling ───────────────────────── */
.legal-content {
  color: #221a16;
}
.legal-section {
  margin-bottom: 2.75rem;
  padding-bottom: 2rem;
  border-bottom: 1px solid rgba(216, 201, 195, 0.4);
}
.legal-section:last-of-type {
  border-bottom: none;
  margin-bottom: 1.5rem;
}
.legal-section h2 {
  font-family: 'Manrope', sans-serif;
  font-weight: 700;
  font-size: 1.45rem;
  line-height: 1.35;
  color: #962f16;
  margin-top: 1rem;
  margin-bottom: 1rem;
}
.legal-section h3 {
  font-family: 'Manrope', sans-serif;
  font-weight: 600;
  font-size: 1.15rem;
  line-height: 1.35;
  color: #372f2a;
  margin-top: 1.25rem;
  margin-bottom: 0.65rem;
}
.legal-section p {
  font-family: 'Inter', sans-serif;
  font-size: 1rem;
  line-height: 1.75;
  color: #57423c;
  margin-bottom: 0.85rem;
}
.legal-section ul {
  list-style-type: none;
  padding-left: 0;
  margin-top: 0.75rem;
  margin-bottom: 1rem;
  display: flex;
  flex-direction: column;
  gap: 0.6rem;
}
.legal-section ul li {
  position: relative;
  padding-left: 1.6rem;
  font-family: 'Inter', sans-serif;
  font-size: 0.96rem;
  line-height: 1.65;
  color: #57423c;
}
.legal-section ul li::before {
  content: "•";
  position: absolute;
  left: 0.4rem;
  top: -0.05rem;
  color: #962f16;
  font-size: 1.3rem;
  line-height: 1;
}
.legal-card {
  background: rgba(255, 255, 255, 0.75);
  backdrop-filter: blur(20px);
  border: 1px solid rgba(216, 201, 195, 0.5);
  border-radius: 1rem;
  padding: 1.5rem;
  margin-top: 1rem;
  margin-bottom: 1rem;
}
.safety-alert-box {
  background: #fff1eb;
  border-left: 4px solid #962f16;
  border-radius: 0.75rem;
  padding: 1.25rem 1.5rem;
  margin: 1.25rem 0;
}
.safety-alert-box h4 {
  font-family: 'Manrope', sans-serif;
  font-weight: 700;
  color: #962f16;
  font-size: 1.1rem;
  margin-bottom: 0.4rem;
}


