/* ====================================
   CEYLON CHRONICLES TOURS - MAIN STYLESHEET
   Travel Website - Optimized & Performance-Ready
   ==================================== */

/* ========================================
   COLOR PALETTE VARIABLES
   Forest Green: #006F00 (Primary brand color)
   Lime Green: #6BD938 (Accent color)
   Dark Green: #001D00 (Text, headers)
   Gold: #FFD700 (Premium highlights)
   Light Green: #7FE672 (Secondary accents)
   Sky Blue: #D4F6FF (Backgrounds, light sections)
   ======================================== */

:root {
  --forest-green: #006f00;
  --lime-green: #6bd938;
  --dark-green: #001d00;
  --gold: #ffd700;
  --light-green: #7fe672;
  --sky-blue: #d4f6ff;
  --text-dark: #1c1c1c;
  --bg-light: #fafafa;
}

/* ========================================
   CORE RESET & BASE STYLES
   ======================================== */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
  scrollbar-width: thin;
  scrollbar-color: #006f00 #d4f6ff;
}

*::before,
*::after {
  box-sizing: inherit;
}

html {
  scroll-behavior: smooth;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

body {
  font-family: "Signika Negative", sans-serif !important;
  color: #1c1c1c;
  overflow-x: hidden;
  line-height: 1.6;
  background-color: #fafafa;
}

/* Prevent FOUC (Flash of Unstyled Content) */
body:not(.loaded) {
  opacity: 0;
}

body.loaded {
  opacity: 1;
  transition: opacity 0.3s ease-in;
}

/* ========================================
   PERFORMANCE-OPTIMIZED ANIMATIONS
   ======================================== */

@keyframes fadeIn {
  from {
    opacity: 0;
  }
  to {
    opacity: 1;
  }
}

@keyframes fadeInUp {
  from {
    opacity: 0;
    transform: translate3d(0, 40px, 0);
  }
  to {
    opacity: 1;
    transform: translate3d(0, 0, 0);
  }
}

@keyframes scaleIn {
  from {
    opacity: 0;
    transform: scale3d(0.95, 0.95, 1);
  }
  to {
    opacity: 1;
    transform: scale3d(1, 1, 1);
  }
}

@keyframes slideInLeft {
  from {
    opacity: 0;
    transform: translate3d(-60px, 0, 0);
  }
  to {
    opacity: 1;
    transform: translate3d(0, 0, 0);
  }
}

@keyframes slideInRight {
  from {
    opacity: 0;
    transform: translate3d(60px, 0, 0);
  }
  to {
    opacity: 1;
    transform: translate3d(0, 0, 0);
  }
}

@keyframes slideInStagger {
  to {
    opacity: 1;
    transform: translate3d(0, 0, 0);
  }
}

@keyframes float {
  0%,
  100% {
    transform: translate3d(0, 0, 0);
  }
  50% {
    transform: translate3d(0, -20px, 0);
  }
}

@keyframes gradient {
  0%,
  100% {
    background-position: 0% 50%;
  }
  50% {
    background-position: 100% 50%;
  }
}

@keyframes shimmer {
  0% {
    background-position: -200% center;
  }
  100% {
    background-position: 200% center;
  }
}

@keyframes pulse {
  0%,
  100% {
    opacity: 1;
  }
  50% {
    opacity: 0.7;
  }
}

@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}

@keyframes scroll-wheel {
  0% {
    opacity: 0;
    transform: translateY(-10px);
  }
  50% {
    opacity: 1;
  }
  100% {
    opacity: 0;
    transform: translateY(10px);
  }
}

/* Respect user motion preferences */
@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}

/* ========================================
   ANIMATION UTILITY CLASSES
   ======================================== */
.animate-fade-in-up {
  animation: fadeInUp 0.8s cubic-bezier(0.4, 0, 0.2, 1) forwards;
  will-change: transform, opacity;
}

.animate-scale-in {
  animation: scaleIn 0.6s cubic-bezier(0.4, 0, 0.2, 1) forwards;
  will-change: transform, opacity;
}

.animate-slide-in-left {
  animation: slideInLeft 0.8s cubic-bezier(0.4, 0, 0.2, 1) forwards;
  will-change: transform, opacity;
}

.animate-slide-in-right {
  animation: slideInRight 0.8s cubic-bezier(0.4, 0, 0.2, 1) forwards;
  will-change: transform, opacity;
}

.floating {
  animation: float 6s ease-in-out infinite;
}

.animate-gradient {
  background-size: 200% 200%;
  animation: gradient 3s ease infinite;
}

.animate-shimmer {
  background: linear-gradient(90deg, #006f00 0%, #d4f6ff 50%, #006f00 100%);
  background-size: 200% auto;
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  animation: shimmer 3s linear infinite;
}

/* Animation Delays */
.delay-100 {
  animation-delay: 0.1s;
}
.delay-200 {
  animation-delay: 0.2s;
}
.delay-300 {
  animation-delay: 0.3s;
}
.delay-400 {
  animation-delay: 0.4s;
}
.delay-500 {
  animation-delay: 0.5s;
}
.delay-600 {
  animation-delay: 0.6s;
}
.delay-700 {
  animation-delay: 0.7s;
}

/* ========================================
   HERO & OVERLAY EFFECTS
   ======================================== */
.hero-overlay {
  background: linear-gradient(
    135deg,
    rgba(0, 0, 0, 0.338) 0%,
    rgba(0, 29, 0, 0.272) 100%
  );
  position: relative;
}

.hero-overlay::before {
  content: "";
  position: absolute;
  inset: 0;
  background: radial-gradient(
    circle at top right,
    rgba(0, 111, 0, 0.1),
    transparent 70%
  );
  pointer-events: none;
}

#hero-video {
  opacity: 0;
  animation: fadeIn 1.5s ease-in forwards;
  animation-delay: 0.3s;
}

/* ========================================
   CUSTOM SCROLLBAR
   ======================================== */
::-webkit-scrollbar {
  width: 10px;
  height: 10px;
}

::-webkit-scrollbar-track {
  background: #d4f6ff;
}

::-webkit-scrollbar-thumb {
  background: linear-gradient(135deg, #006f00, #001d00);
  border-radius: 5px;
  transition: background 0.3s ease;
}

::-webkit-scrollbar-thumb:hover {
  background: linear-gradient(135deg, #6bd938, #7fe672);
}

/* ========================================
   TEXT EFFECTS
   ======================================== */
.gradient-text {
  background: linear-gradient(135deg, #006f00 0%, #001d00 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  display: inline-block;
}

.gradient-text-animated {
  background: linear-gradient(90deg, #006f00, #6bd938, #006f00, #6bd938);
  background-size: 300% 100%;
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  animation: gradient 4s ease infinite;
}

.text-shimmer {
  background: linear-gradient(90deg, #1c1c1c 0%, #006f00 50%, #1c1c1c 100%);
  background-size: 200% 100%;
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  animation: shimmer 3s linear infinite;
}

/* ========================================
   CARD EFFECTS
   ======================================== */
.card-hover {
  transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
  will-change: transform;
}

.card-hover:hover {
  transform: translateY(-12px) scale(1.02);
  box-shadow: 0 25px 50px -12px rgba(0, 111, 0, 0.25);
}

.card-hover:active {
  transform: translateY(-8px) scale(1.01);
}

.card-3d {
  perspective: 1000px;
  transform-style: preserve-3d;
  transition: transform 0.6s cubic-bezier(0.4, 0, 0.2, 1);
}

.card-3d:hover {
  transform: rotateY(5deg) rotateX(5deg);
}

.glass-card {
  background: rgba(255, 255, 255, 0.1);
  backdrop-filter: blur(20px) saturate(180%);
  -webkit-backdrop-filter: blur(20px) saturate(180%);
  border: 1px solid rgba(255, 255, 255, 0.2);
  border-radius: 16px;
  box-shadow: 0 8px 32px 0 rgba(107, 217, 56, 0.15);
}

/* ========================================
   BUTTON EFFECTS
   ======================================== */
.btn-shimmer {
  background: linear-gradient(90deg, #006f00 0%, #001d00 50%, #006f00 100%);
  background-size: 200% 100%;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  position: relative;
  overflow: hidden;
}

.btn-shimmer::before {
  content: "";
  position: absolute;
  top: 0;
  left: -100%;
  width: 100%;
  height: 100%;
  background: linear-gradient(
    90deg,
    transparent,
    rgba(255, 255, 255, 0.3),
    transparent
  );
  transition: left 0.5s ease;
}

.btn-shimmer:hover {
  background-position: 100% 0;
  transform: translateY(-2px);
  box-shadow: 0 10px 25px -5px rgba(0, 111, 0, 0.4);
}

.btn-shimmer:hover::before {
  left: 100%;
}

.btn-shimmer:active {
  transform: translateY(0);
}

.magnetic-btn {
  transition: transform 0.2s cubic-bezier(0.4, 0, 0.2, 1);
  cursor: pointer;
}

.btn-glow {
  position: relative;
  box-shadow: 0 0 20px rgba(0, 111, 0, 0.3);
  transition: all 0.3s ease;
}

.btn-glow:hover {
  box-shadow:
    0 0 40px rgba(0, 111, 0, 0.6),
    0 0 60px rgba(0, 111, 0, 0.4);
  transform: scale(1.05);
}

/* ========================================
   NAVIGATION STYLES
   ======================================== */
.bg-size-200 {
  background-size: 200% 100%;
}

.nav-link {
  position: relative;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.nav-link .nav-bg {
  transition:
    opacity 0.3s ease,
    transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.nav-link .nav-indicator {
  transition: width 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.nav-link:hover .nav-bg,
.nav-link.active .nav-bg {
  opacity: 1;
  transform: scale(1);
}

.nav-link:hover .nav-indicator,
.nav-link.active .nav-indicator {
  width: 100%;
}

.hamburger-line {
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

#mobile-menu-btn.active .hamburger-line:nth-child(1) {
  transform: translateY(9px) rotate(45deg);
}

#mobile-menu-btn.active .hamburger-line:nth-child(2) {
  opacity: 0;
  transform: scale(0);
}

#mobile-menu-btn.active .hamburger-line:nth-child(3) {
  transform: translateY(-9px) rotate(-45deg);
}

@supports (backdrop-filter: blur(20px)) {
  #main-nav {
    backdrop-filter: blur(20px) saturate(180%);
    -webkit-backdrop-filter: blur(20px) saturate(180%);
  }
}

/* ========================================
   MOBILE MENU
   ======================================== */
.mobile-menu {
  transform: translate3d(100%, 0, 0);
  transition: transform 0.5s cubic-bezier(0.68, -0.55, 0.265, 1.55);
  will-change: transform;
}

.mobile-menu.active {
  transform: translate3d(0, 0, 0);
}

.mobile-nav-item {
  opacity: 0;
  transform: translate3d(20px, 0, 0);
  animation: slideInStagger 0.5s cubic-bezier(0.4, 0, 0.2, 1) forwards;
}

.mobile-nav-item:nth-child(1) {
  animation-delay: 0.1s;
}
.mobile-nav-item:nth-child(2) {
  animation-delay: 0.2s;
}
.mobile-nav-item:nth-child(3) {
  animation-delay: 0.3s;
}
.mobile-nav-item:nth-child(4) {
  animation-delay: 0.4s;
}
.mobile-nav-item:nth-child(5) {
  animation-delay: 0.5s;
}

/* ========================================
   DECORATIVE ELEMENTS
   ======================================== */
.decorative-line {
  position: relative;
}

.decorative-line::after {
  content: "";
  position: absolute;
  bottom: -10px;
  left: 0;
  width: 80px;
  height: 3px;
  background: linear-gradient(90deg, #006f00, transparent);
  border-radius: 2px;
}

.gradient-divider {
  height: 2px;
  background: linear-gradient(
    90deg,
    transparent,
    #006f00,
    #6bd938,
    #006f00,
    transparent
  );
  margin: 2rem 0;
}

.shadow-glow-gold {
  box-shadow:
    0 0 10px rgba(0, 111, 0, 0.6),
    0 0 20px rgba(0, 111, 0, 0.4);
}

/* ========================================
   IMAGE EFFECTS
   ======================================== */
.img-overlay {
  position: relative;
  overflow: hidden;
  border-radius: 12px;
}

.img-overlay::before {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(
    180deg,
    transparent 0%,
    rgba(107, 217, 56, 0.6) 100%
  );
  opacity: 0;
  transition: opacity 0.4s cubic-bezier(0.4, 0, 0.2, 1);
  z-index: 1;
}

.img-overlay:hover::before {
  opacity: 1;
}

.img-overlay img {
  transition: transform 0.6s cubic-bezier(0.4, 0, 0.2, 1);
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.img-overlay:hover img {
  transform: scale(1.1) rotate(2deg);
}

.img-parallax {
  transform: translate3d(0, 0, 0);
  transition: transform 0.3s ease-out;
}

/* ========================================
   BACKGROUNDS
   ======================================== */
.pattern-bg {
  background-image:
    radial-gradient(
      circle at 20% 50%,
      rgba(0, 111, 0, 0.05) 0%,
      transparent 50%
    ),
    radial-gradient(
      circle at 80% 80%,
      rgba(107, 217, 56, 0.05) 0%,
      transparent 50%
    );
}

.gradient-bg-animated {
  background: linear-gradient(135deg, #6bd938, #006f00, #6bd938);
  background-size: 400% 400%;
  animation: gradient 15s ease infinite;
}

.mesh-gradient {
  background:
    radial-gradient(at 40% 20%, rgba(0, 111, 0, 0.3) 0, transparent 50%),
    radial-gradient(at 80% 0%, rgba(107, 217, 56, 0.2) 0, transparent 50%),
    radial-gradient(at 0% 50%, rgba(212, 246, 255, 0.3) 0, transparent 50%),
    radial-gradient(at 80% 100%, rgba(0, 111, 0, 0.2) 0, transparent 50%);
}

.glass {
  background: rgba(255, 255, 255, 0.05);
  backdrop-filter: blur(20px) saturate(180%);
  -webkit-backdrop-filter: blur(20px) saturate(180%);
}

/* ========================================
   GLASSMORPHISM
   ======================================== */
.testimonial-card {
  backdrop-filter: blur(10px) saturate(150%);
  -webkit-backdrop-filter: blur(10px) saturate(150%);
  background: rgba(255, 255, 255, 0.9);
  border: 1px solid rgba(0, 111, 0, 0.2);
  border-radius: 16px;
  box-shadow: 0 8px 32px 0 rgba(31, 38, 135, 0.1);
}

/* ========================================
   STABLE GLASSMORPHISM (NO FLICKER)
   ======================================== */

/* Glass Badge - Premium Badge Effect */
.glass-badge {
  background: rgba(255, 255, 255, 0.08) !important;
  backdrop-filter: blur(12px) saturate(180%) !important;
  -webkit-backdrop-filter: blur(12px) saturate(180%) !important;
  box-shadow:
    0 4px 24px rgba(0, 0, 0, 0.1),
    inset 0 1px 0 rgba(255, 255, 255, 0.2);
  transform: translateZ(0);
  -webkit-transform: translateZ(0);
  will-change: auto;
  position: relative;
}

/* Glass Button - CTA Button Effect */
.glass-button {
  background: rgba(255, 255, 255, 0.05) !important;
  backdrop-filter: blur(10px) saturate(150%) !important;
  -webkit-backdrop-filter: blur(10px) saturate(150%) !important;
  transform: translateZ(0);
  -webkit-transform: translateZ(0);
  will-change: auto;
  position: relative;
}

/* Glass Control - Video Control Effect */
.glass-control {
  background: rgba(255, 255, 255, 0.05) !important;
  backdrop-filter: blur(10px) saturate(150%) !important;
  -webkit-backdrop-filter: blur(10px) saturate(150%) !important;
  transform: translateZ(0);
  -webkit-transform: translateZ(0);
  will-change: auto;
  position: relative;
}

/* Browser Support & Optimization */
@supports (backdrop-filter: blur(10px)) or (-webkit-backdrop-filter: blur(10px)) {
  .glass-badge,
  .glass-button,
  .glass-control {
    isolation: isolate;
    contain: layout style paint;
  }
}

/* Pseudo-element for additional backdrop stability */
.glass-badge::before,
.glass-button::before,
.glass-control::before {
  content: "";
  position: absolute;
  inset: 0;
  backdrop-filter: inherit;
  -webkit-backdrop-filter: inherit;
  z-index: -1;
  border-radius: inherit;
  pointer-events: none;
}

/* Fallback for browsers without backdrop-filter */
@supports not (backdrop-filter: blur(10px)) {
  .glass-badge,
  .glass-button,
  .glass-control {
    background: rgba(107, 217, 56, 0.3) !important;
  }
}

/* Prevent layout shift during load */
.glass-badge,
.glass-button,
.glass-control {
  backface-visibility: hidden;
  -webkit-backface-visibility: hidden;
  -moz-backface-visibility: hidden;
}

/* Smooth transitions for glass elements */
@media (prefers-reduced-motion: no-preference) {
  .glass-badge,
  .glass-button,
  .glass-control {
    transition:
      background-color 0.3s ease,
      transform 0.3s ease,
      box-shadow 0.3s ease;
  }
}

/* Force immediate render on page load */
html.loading .glass-badge,
html.loading .glass-button,
html.loading .glass-control {
  opacity: 1 !important;
  visibility: visible !important;
}

/* ========================================
   BACK TO TOP BUTTON
   ======================================== */
#backToTop {
  position: fixed;
  bottom: 30px;
  right: 30px;
  width: 55px;
  height: 55px;
  background: linear-gradient(135deg, #006f00 0%, #001d00 100%);
  color: white;
  border: none;
  border-radius: 50%;
  cursor: pointer;
  opacity: 0;
  visibility: hidden;
  transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
  z-index: 1000;
  box-shadow: 0 8px 20px rgba(0, 111, 0, 0.4);
  display: flex;
  align-items: center;
  justify-content: center;
}

#backToTop.show {
  opacity: 1;
  visibility: visible;
}

#backToTop:hover {
  transform: translateY(-5px) scale(1.1);
  box-shadow: 0 12px 30px rgba(0, 111, 0, 0.6);
  background: linear-gradient(135deg, #001d00 0%, #006f00 100%);
}

#backToTop:active {
  transform: translateY(-3px) scale(1.05);
}

#backToTop i {
  font-size: 22px;
  animation: float 2s ease-in-out infinite;
}

/* ========================================
   LOADING STATES
   ======================================== */
.skeleton {
  background: linear-gradient(90deg, #f0f0f0 25%, #e0e0e0 50%, #f0f0f0 75%);
  background-size: 200% 100%;
  animation: shimmer 1.5s infinite;
  border-radius: 4px;
}

.loading-spinner {
  width: 40px;
  height: 40px;
  border: 4px solid #d4f6ff;
  border-top-color: #006f00;
  border-radius: 50%;
  animation: spin 1s linear infinite;
}

/* ========================================
   ACCESSIBILITY ENHANCEMENTS
   ======================================== */
.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border-width: 0;
}

:focus-visible {
  outline: 2px solid #006f00;
  outline-offset: 2px;
  border-radius: 4px;
}

.skip-to-content {
  position: absolute;
  top: -40px;
  left: 0;
  background: #006f00;
  color: white;
  padding: 8px 16px;
  text-decoration: none;
  border-radius: 0 0 8px 0;
  z-index: 9999;
}

.skip-to-content:focus {
  top: 0;
}

/* ========================================
   RESPONSIVE UTILITIES
   ======================================== */
@media (max-width: 768px) {
  .hero-overlay {
    background: linear-gradient(
      180deg,
      rgba(107, 217, 56, 0.208) 0%,
      rgba(0, 29, 0, 0.355) 100%
    );
  }

  #backToTop {
    width: 50px;
    height: 50px;
    bottom: 20px;
    right: 20px;
  }

  #backToTop i {
    font-size: 20px;
  }

  .card-hover:hover {
    transform: translateY(-8px);
  }

  .card-hover:active {
    transform: translateY(-4px);
  }
}

@media (min-width: 769px) and (max-width: 1024px) {
  .container {
    padding: 0 2rem;
  }
}

@media (min-width: 1920px) {
  .container {
    max-width: 1600px;
  }
}

@media (prefers-color-scheme: dark) {
  body {
    background-color: #1c1c1c;
    color: #d4f6ff;
  }

  .glass-card {
    background: rgba(28, 28, 28, 0.8);
    border-color: rgba(0, 111, 0, 0.3);
  }
}

@media (prefers-contrast: high) {
  .btn-shimmer,
  .card-hover {
    border: 2px solid currentColor;
  }
}

@media print {
  #backToTop,
  .mobile-menu,
  .floating {
    display: none !important;
  }

  * {
    animation: none !important;
    transition: none !important;
  }
}

/* ========================================
   SCROLL ANIMATIONS
   ======================================== */

.animate-scroll-wheel {
  animation: scroll-wheel 2s ease-in-out infinite;
}

/* Active dot indicator based on scroll position */
.dot-nav-active {
  background: #006f00 !important;
  border: 2px solid white !important;
  transform: scale(1.5);
  box-shadow:
    0 0 10px rgba(0, 111, 0, 0.6),
    0 0 20px rgba(0, 111, 0, 0.4);
}

/* Hide scroll indicator on scroll */
.hide-on-scroll {
  transition:
    opacity 0.3s ease,
    visibility 0.3s ease;
}

.hide-on-scroll.hidden-scroll {
  opacity: 0;
  visibility: hidden;
}

/* ========================================
   END OF STYLESHEET
   ======================================== */
/* ── Content Protection ── */
img {
  pointer-events: none;
  -webkit-user-drag: none;
  user-drag: none;
}

::selection {
  background: transparent;
}

::-moz-selection {
  background: transparent;
}
