/* ============================================
   R BALOYI INC — Custom Animations & Keyframes
   Only styles Tailwind can't handle inline
   ============================================ */

/* --- Preloader --- */
#preloader {
  position: fixed;
  inset: 0;
  z-index: 9999;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  background: #1A2540;
  transition: opacity 0.6s ease, visibility 0.6s ease;
}
#preloader.hidden {
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
}
#preloader .loader-logo {
  width: 90px;
  animation: pulse-gold 1.6s ease-in-out infinite;
}
#preloader .loader-bar {
  width: 180px;
  height: 3px;
  background: rgba(201,168,76,0.15);
  border-radius: 999px;
  margin-top: 24px;
  overflow: hidden;
}
#preloader .loader-bar span {
  display: block;
  height: 100%;
  width: 0%;
  background: linear-gradient(90deg, #C9A84C, #D4B86A);
  border-radius: 999px;
  transition: width 0.3s ease;
}

@keyframes pulse-gold {
  0%, 100% { opacity: 1; transform: scale(1); }
  50% { opacity: .6; transform: scale(0.96); }
}

/* --- Floating Circles (Hero BG) --- */
.float-circle {
  position: absolute;
  border-radius: 50%;
  filter: blur(80px);
  opacity: 0.18;
  pointer-events: none;
  will-change: transform;
}
.float-circle-1 {
  width: 420px; height: 420px;
  background: #C9A84C;
  top: -60px; left: -80px;
  animation: floatA 18s ease-in-out infinite;
}
.float-circle-2 {
  width: 340px; height: 340px;
  background: #D4B86A;
  bottom: 10%; right: -60px;
  animation: floatB 22s ease-in-out infinite;
}
.float-circle-3 {
  width: 260px; height: 260px;
  background: #C9A84C;
  top: 40%; left: 30%;
  animation: floatC 16s ease-in-out infinite;
}

@keyframes floatA {
  0%, 100% { transform: translate(0, 0) scale(1); }
  33% { transform: translate(40px, 30px) scale(1.05); }
  66% { transform: translate(-20px, -15px) scale(0.97); }
}
@keyframes floatB {
  0%, 100% { transform: translate(0, 0) scale(1); }
  33% { transform: translate(-35px, 20px) scale(1.04); }
  66% { transform: translate(25px, -25px) scale(0.96); }
}
@keyframes floatC {
  0%, 100% { transform: translate(0, 0) scale(1); }
  50% { transform: translate(30px, -30px) scale(1.06); }
}

/* --- Gold Particle Dots --- */
.particle-dot {
  position: absolute;
  width: 4px;
  height: 4px;
  border-radius: 50%;
  background: #C9A84C;
  opacity: 0;
  pointer-events: none;
  animation: particleFade 6s ease-in-out infinite;
}
.particle-dot:nth-child(1) { top: 15%; left: 12%; animation-delay: 0s; }
.particle-dot:nth-child(2) { top: 30%; left: 75%; animation-delay: 1.2s; }
.particle-dot:nth-child(3) { top: 60%; left: 20%; animation-delay: 2.4s; }
.particle-dot:nth-child(4) { top: 45%; left: 55%; animation-delay: 0.8s; }
.particle-dot:nth-child(5) { top: 80%; left: 85%; animation-delay: 3.2s; }
.particle-dot:nth-child(6) { top: 70%; left: 40%; animation-delay: 1.8s; }
.particle-dot:nth-child(7) { top: 20%; left: 90%; animation-delay: 4s; }
.particle-dot:nth-child(8) { top: 55%; left: 8%; animation-delay: 2.8s; }

@keyframes particleFade {
  0%, 100% { opacity: 0; transform: translateY(0) scale(0.8); }
  50% { opacity: 0.7; transform: translateY(-20px) scale(1.2); }
}

/* --- Typing Cursor --- */
.typing-cursor {
  display: inline-block;
  width: 2px;
  height: 1em;
  background: #C9A84C;
  margin-left: 2px;
  vertical-align: text-bottom;
  animation: blink 0.75s step-end infinite;
}

@keyframes blink {
  0%, 100% { opacity: 1; }
  50% { opacity: 0; }
}

/* --- Custom Scrollbar --- */
::-webkit-scrollbar { width: 8px; }
::-webkit-scrollbar-track { background: #1A2540; }
::-webkit-scrollbar-thumb {
  background: linear-gradient(180deg, #C9A84C, #D4B86A);
  border-radius: 999px;
}
::-webkit-scrollbar-thumb:hover { background: #D4B86A; }

html { scroll-behavior: smooth; scrollbar-color: #C9A84C #1A2540; }

/* --- Back To Top --- */
#backToTop {
  position: fixed;
  bottom: 28px;
  right: 28px;
  z-index: 900;
  width: 44px;
  height: 44px;
  border-radius: 50%;
  background: linear-gradient(135deg, #C9A84C, #D4B86A);
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 4px 20px rgba(201,168,76,0.35);
  cursor: pointer;
  opacity: 0;
  visibility: hidden;
  transform: translateY(16px);
  transition: all 0.4s ease;
}
#backToTop.visible {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
}
#backToTop:hover {
  transform: translateY(-3px);
  box-shadow: 0 6px 28px rgba(201,168,76,0.5);
}

/* --- Navbar scroll state --- */
.navbar-scrolled {
  background: rgba(255, 255, 255, 0.98) !important;
  backdrop-filter: blur(16px) !important;
  -webkit-backdrop-filter: blur(16px) !important;
  box-shadow: 0 2px 24px rgba(0,0,0,0.08) !important;
}
/* Nav links dark when scrolled (white bg) */
.navbar-scrolled .nav-link {
  color: rgba(26, 37, 64, 0.8) !important;
}
.navbar-scrolled .nav-link:hover {
  color: #C9A84C !important;
}
/* Logo text dark when scrolled */
.navbar-scrolled .logo-text-white {
  color: #1A2540 !important;
}
/* Mobile menu button dark when scrolled */
.navbar-scrolled #menuBtn {
  color: #1A2540 !important;
}
.navbar-scrolled #menuBtn svg {
  stroke: #1A2540 !important;
  color: #1A2540 !important;
}
/* Ensure Call Now button stays gold on scroll */
.navbar-scrolled .call-now-btn {
  background: linear-gradient(to right, #C9A84C, #D4B86A) !important;
  color: #fff !important;
}

/* --- Testimonial Carousel --- */
.testimonial-track {
  display: flex;
  transition: transform 0.5s cubic-bezier(0.4, 0, 0.2, 1);
}
.testimonial-slide {
  min-width: 100%;
  padding: 0 8px;
  box-sizing: border-box;
}

/* --- Geometric Pattern Overlay (crosses for Why Us) --- */
.pattern-overlay {
  background-image: url("data:image/svg+xml,%3Csvg width='60' height='60' viewBox='0 0 60 60' xmlns='http://www.w3.org/2000/svg'%3E%3Cg fill='none' fill-rule='evenodd'%3E%3Cg fill='%23C9A84C' fill-opacity='0.04'%3E%3Cpath d='M36 34v-4h-2v4h-4v2h4v4h2v-4h4v-2h-4zm0-30V0h-2v4h-4v2h4v4h2V6h4V4h-4zM6 34v-4H4v4H0v2h4v4h2v-4h4v-2H6zM6 4V0H4v4H0v2h4v4h2V6h4V4H6z'/%3E%3C/g%3E%3C/g%3E%3C/svg%3E");
}

/* --- Box Grid Pattern (for Practice/What We Do) --- */
.pattern-boxes {
  background-image: 
    url("data:image/svg+xml,%3Csvg width='40' height='40' viewBox='0 0 40 40' xmlns='http://www.w3.org/2000/svg'%3E%3Cg fill='none' stroke='%23C9A84C' stroke-opacity='0.06' stroke-width='1'%3E%3Crect x='2' y='2' width='16' height='16' rx='2'/%3E%3Crect x='22' y='22' width='16' height='16' rx='2'/%3E%3C/g%3E%3C/svg%3E");
}

/* --- Practice card glow --- */
.practice-card {
  position: relative;
  overflow: hidden;
  transition: transform 0.35s ease, box-shadow 0.35s ease, border-color 0.35s ease;
}
.practice-card:hover {
  transform: translateY(-8px);
  box-shadow: 0 12px 40px rgba(201,168,76,0.15);
  border-color: rgba(201,168,76,0.4) !important;
}

/* --- Glass card hover --- */
.glass-card {
  transition: transform 0.35s ease, box-shadow 0.35s ease;
}
.glass-card:hover {
  transform: translateY(-6px);
  box-shadow: 0 12px 40px rgba(201,168,76,0.12);
}

/* --- Stat counter shine --- */
.stat-number {
  background: linear-gradient(135deg, #C9A84C, #D4B86A);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

/* --- Selection color --- */
::selection {
  background: rgba(201,168,76,0.3);
  color: #fff;
}

/* --- Mobile menu overlay --- */
#mobileMenu {
  transition: opacity 0.3s ease, visibility 0.3s ease;
  background: #1A2540 !important; /* Solid dark navy background */
}
#mobileMenu.open {
  opacity: 1 !important;
  visibility: visible !important;
}
/* When mobile menu is open, reset navbar to transparent so it doesn't show white bar */
body.mobile-menu-open #navbar {
  background: transparent !important;
  box-shadow: none !important;
}
body.mobile-menu-open #navbar.navbar-scrolled {
  background: transparent !important;
  box-shadow: none !important;
}
/* Keep menu button and logo visible (white) when mobile menu is open */
body.mobile-menu-open #navbar #menuBtn,
body.mobile-menu-open #navbar #menuBtn svg {
  color: #fff !important;
  stroke: #fff !important;
}
body.mobile-menu-open #navbar .logo-text-white {
  color: #fff !important;
}

/* --- Section Wave Dividers --- */
.section-divider {
  position: absolute;
  bottom: 0;
  left: 0;
  width: 100%;
  overflow: hidden;
  line-height: 0;
  z-index: 5;
}
.section-divider svg {
  position: relative;
  display: block;
  width: 100%;
}

/* --- Crystal Clean Mobile Polish --- */
@media (max-width: 640px) {
  body { font-size: 12px; letter-spacing: 0.01em; }
  
  /* Tighter hero on mobile */
  .float-circle-1 { width: 200px; height: 200px; }
  .float-circle-2 { width: 160px; height: 160px; }
  .float-circle-3 { width: 120px; height: 120px; }
  
  /* Preloader smaller */
  #preloader .loader-logo { width: 64px; }
  #preloader .loader-bar { width: 140px; }
  
  /* Back to top smaller */
  #backToTop { width: 38px; height: 38px; bottom: 20px; right: 20px; }
}

@media (max-width: 380px) {
  body { font-size: 11px; }
}

/* --- Practice Card Shimmer --- */
.practice-card::before {
  content: '';
  position: absolute;
  inset: 0;
  border-radius: inherit;
  background: linear-gradient(105deg, transparent 40%, rgba(201,168,76,0.08) 45%, rgba(201,168,76,0.15) 50%, rgba(201,168,76,0.08) 55%, transparent 60%);
  opacity: 0;
  transition: opacity 0.3s ease;
}
.practice-card:hover::before {
  opacity: 1;
  animation: shimmer 1.5s ease infinite;
}
@keyframes shimmer {
  0% { transform: translateX(-100%); }
  100% { transform: translateX(100%); }
}

/* --- Call Modal --- */
.call-modal-card {
  animation: modalSlideIn 0.4s cubic-bezier(0.16, 1, 0.3, 1);
}
@keyframes modalSlideIn {
  from { opacity: 0; transform: translate(-50%, -48%) scale(0.95); }
  to { opacity: 1; transform: translate(-50%, -50%) scale(1); }
}
.modal-flash-stripe {
  position: absolute;
  top: 0;
  left: -100%;
  width: 200%;
  height: 100%;
  background: linear-gradient(90deg, transparent, rgba(201,168,76,0.15), transparent);
  animation: modalFlash 3s ease-in-out infinite;
}
@keyframes modalFlash {
  0%, 100% { transform: translateX(-50%); }
  50% { transform: translateX(50%); }
}
