/* Custom Styles */
html, body { overflow-x: hidden; }
section[id] { scroll-margin-top: 5rem; }

/* Announcement Bar */
#announcement-bar {
  transform: translateY(0);
}
#announcement-bar.hidden-bar {
  transform: translateY(-100%);
}

/* Announcement Ticker */
.announcement-ticker {
  position: relative;
  overflow: hidden;
}
.announcement-track {
  display: flex;
  animation: ticker 25s linear infinite;
  will-change: transform;
}
.announcement-track:hover {
  animation-play-state: paused;
}
@keyframes ticker {
  0% { transform: translateX(0); }
  100% { transform: translateX(-50%); }
}

/* Header positioned right below announcement bar - no gap */
#site-header {
  top: 44px;
}

/* Scroll reveal */
.reveal {
  opacity: 0;
  transform: translateY(28px);
  transition: opacity 0.7s ease, transform 0.7s ease;
  will-change: opacity, transform;
}
.reveal.is-visible {
  opacity: 1;
  transform: translateY(0);
}

/* Marquee */
.marquee-track {
  width: max-content;
  animation: marquee 30s linear infinite;
  will-change: transform;
}
.marquee-track:hover { animation-play-state: paused; }
@keyframes marquee {
  from { transform: translateX(0); }
  to   { transform: translateX(-50%); }
}

/* Hero word animation */
.hero-word {
  display: inline-block;
  animation: wordFadeUp 0.9s cubic-bezier(0.22, 1, 0.36, 1) both;
}
.hero-word:nth-child(1) { animation-delay: 0.1s; }
.hero-word:nth-child(2) { animation-delay: 0.25s; }
.hero-word:nth-child(3) { animation-delay: 0.4s; }
.hero-word:nth-child(4) { animation-delay: 0.55s; }
.hero-word:nth-child(5) { animation-delay: 0.7s; }
.hero-word:nth-child(6) { animation-delay: 0.85s; }
.hero-word:nth-child(7) { animation-delay: 1.0s; }
@keyframes wordFadeUp {
  from { opacity: 0; transform: translateY(50px) scale(0.6); filter: blur(6px); }
  to   { opacity: 1; transform: translateY(0) scale(1); filter: blur(0); }
}

/* Gradient shimmer */
.gradient-shimmer {
  background-size: 200% auto;
  animation: shimmer 4s linear infinite;
}
@keyframes shimmer {
  0% { background-position: 0% center; }
  50% { background-position: 100% center; }
  100% { background-position: 0% center; }
}

/* Loading screen */
#loading-screen { transition: opacity 0.6s ease, visibility 0.6s ease; }
#loading-screen.hidden-loader { opacity: 0; visibility: hidden; pointer-events: none; }

/* Hero grid */
.hero-grid {
  background-image:
    linear-gradient(rgba(255,255,255,0.045) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255,255,255,0.045) 1px, transparent 1px);
  background-size: 44px 44px;
}

/* Card hover */
.lift { transition: transform 0.3s ease, box-shadow 0.3s ease; }
.lift:hover { transform: translateY(-6px); box-shadow: 0 20px 40px -18px rgba(23, 32, 84, 0.25); }

/* Smooth scroll */
html { scroll-behavior: smooth; }

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

/* 3D Flip Card Styles */
.flip-card {
  perspective: 1000px;
  cursor: pointer;
}
.flip-card-inner {
  position: relative;
  width: 100%;
  height: 100%;
  transition: transform 0.7s cubic-bezier(0.4, 0, 0.2, 1);
  transform-style: preserve-3d;
}
.flip-card.flipped .flip-card-inner {
  transform: rotateY(180deg);
}
.flip-card-front,
.flip-card-back {
  position: absolute;
  width: 100%;
  height: 100%;
  backface-visibility: hidden;
  border-radius: 1rem;
}
.flip-card-back {
  transform: rotateY(180deg);
}
.flip-card-front img,
.flip-card-back img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  border-radius: 1rem;
}

/* 3D Search Bar */
.search-3d-container {
  perspective: 800px;
  width: 100%;
  max-width: 500px;
}
.search-3d-wrapper {
  display: flex;
  align-items: center;
  background: white;
  border-radius: 9999px;
  padding: 0.75rem 1.25rem;
  box-shadow:
    0 1px 2px rgba(0,0,0,0.04),
    0 4px 8px rgba(0,0,0,0.04),
    0 8px 16px rgba(0,0,0,0.06),
    0 16px 32px rgba(0,0,0,0.08),
    0 32px 64px rgba(0,0,0,0.12);
  transform: rotateX(8deg);
  transition: transform 0.3s ease, box-shadow 0.3s ease;
  border: 1px solid rgba(0,0,0,0.05);
}
.search-3d-wrapper:focus-within {
  transform: rotateX(0deg) translateY(-2px);
  box-shadow:
    0 2px 4px rgba(0,0,0,0.04),
    0 8px 16px rgba(0,0,0,0.06),
    0 16px 32px rgba(0,0,0,0.1),
    0 32px 64px rgba(0,0,0,0.15),
    0 48px 96px rgba(0,0,0,0.12);
}
.search-3d-icon {
  height: 1.5rem;
  width: 1.5rem;
  color: #64748b;
  margin-right: 0.75rem;
  flex-shrink: 0;
}
.search-3d-input {
  flex: 1;
  border: none;
  outline: none;
  font-size: 1rem;
  color: #1e293b;
  background: transparent;
}
.search-3d-input::placeholder {
  color: #94a3b8;
}

/* Services horizontal scroll on mobile */
@media (max-width: 639px) {
  #services-grid {
    display: flex;
    overflow-x: auto;
    scroll-snap-type: x mandatory;
    -webkit-overflow-scrolling: touch;
    gap: 1rem;
    padding-bottom: 1rem;
  }
  #services-grid > article {
    flex: 0 0 280px;
    scroll-snap-align: start;
  }
  #services-grid::-webkit-scrollbar {
    height: 6px;
  }
  #services-grid::-webkit-scrollbar-track {
    background: #e2e8f0;
    border-radius: 3px;
  }
  #services-grid::-webkit-scrollbar-thumb {
    background: #94a3b8;
    border-radius: 3px;
  }
}

/* Admin panel styles */
.admin-sidebar { min-height: calc(100vh - 4rem); }
.admin-link { display: block; padding: 0.75rem 1rem; border-radius: 0.5rem; font-weight: 600; color: #cbd5e1; transition: all 0.2s; }
.admin-link:hover, .admin-link.active { background: rgba(239, 68, 68, 0.1); color: #fff; }

/* Chatbot typing indicator */
.typing-indicator { display: flex; gap: 4px; padding: 8px 12px; }
.typing-indicator span { width: 8px; height: 8px; border-radius: 50%; background: #94a3b8; animation: typing 1.4s infinite; }
.typing-indicator span:nth-child(2) { animation-delay: 0.2s; }
.typing-indicator span:nth-child(3) { animation-delay: 0.4s; }
@keyframes typing { 0%, 60%, 100% { opacity: 0.4; } 30% { opacity: 1; } }

/* Form styles */
.form-input { width: 100%; border-radius: 0.75rem; border: 1px solid #cbd5e1; padding: 0.75rem 1rem; font-size: 0.875rem; transition: all 0.2s; }
.form-input:focus { border-color: #ef4444; outline: none; box-shadow: 0 0 0 3px rgba(239, 68, 68, 0.1); }
