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

/* Enhanced Glass Navigation */
.glass-nav {
  background-color: rgba(0, 0, 0, 0.75);
  backdrop-filter: saturate(180%) blur(20px);
  -webkit-backdrop-filter: saturate(180%) blur(20px);
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
  transition:
    background-color 0.5s,
    border-color 0.5s;
}

/* Light Mode Overrides */
body.light-mode {
  background-color: #f5f5f7 !important;
  /* Apple's Off-White */
  color: #1d1d1f !important;
}

body.light-mode .glass-nav {
  background-color: rgba(255, 255, 255, 0.7) !important;
  border-bottom: 1px solid rgba(0, 0, 0, 0.1);
  color: #1d1d1f !important;
}

body.light-mode nav a,
body.light-mode nav svg {
  color: #1d1d1f !important;
  fill: #1d1d1f !important;
}

body.light-mode .bg-black {
  background-color: #f5f5f7 !important;
  /* Section backgrounds */
  color: #1d1d1f !important;
}

body.light-mode #main-footer {
  background-color: transparent !important;
  color: #1d1d1f !important;
}

/* Logo Toggles */
body.light-mode .logo-dark {
  display: none !important;
}

body.light-mode .logo-light {
  display: block !important;
}

body.light-mode #main-footer h2,
body.light-mode #main-footer h3,
body.light-mode #main-footer a {
  color: #1d1d1f !important;
}

body.light-mode #main-footer .text-gray-400 {
  color: #48484a !important;
}

/* Carousel Dots Light Mode Fix */
body.light-mode #carousel-dots .bg-white {
  background-color: #1d1d1f !important;
}

body.light-mode #carousel-dots .bg-white\/30 {
  background-color: rgba(29, 29, 31, 0.3) !important;
}

/* Text Gradients for "Pro" feel (optional, can be used on headers) */
.text-gradient {
  background-clip: text;
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-image: linear-gradient(to right, #fff, #a1a1aa);
}

body.light-mode .text-gradient {
  background-image: linear-gradient(to right, #1d1d1f, #86868b);
}

/* Apple-style Button Hover Strings */
.btn-atomic {
  transition: all 0.3s cubic-bezier(0.25, 0.1, 0.25, 1);
}

.btn-atomic:hover {
  transform: scale(1.03);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

/* Refined Reveal Animation */
.reveal {
  opacity: 1;
  transform: translateY(40px);
  /* Slightly more travel */
  transition:
    opacity 1s cubic-bezier(0.16, 1, 0.3, 1),
    transform 1s cubic-bezier(0.16, 1, 0.3, 1);
  will-change: opacity, transform;
}

.reveal.active {
  opacity: 1;
  transform: translateY(0);
}

/* Ambient Background Toggles */
.section-bg-dark {
  opacity: 1;
  pointer-events: none;
}

.section-bg-light {
  opacity: 0;
  pointer-events: none;
}

body.light-mode .section-bg-dark {
  opacity: 0;
}

body.light-mode .section-bg-light {
  opacity: 1;
}

/* Staggered delays for grid items */
.delay-100 {
  transition-delay: 0.1s;
}

.delay-200 {
  transition-delay: 0.2s;
}

.delay-300 {
  transition-delay: 0.3s;
}

/* Force white text for overlays */
.text-always-white,
body.light-mode .text-always-white {
  color: #ffffff !important;
}

/* Flower Pattern Background - Full Cover */
.bg-flower-pattern {
  background-image: url("../flower_pattern.png");
  background-size: cover;
  background-repeat: no-repeat;
  background-position: center;
  opacity: 0.3;
  /* Subtle blend */
}

/* Theme Aware Section */
.bento-section {
  background-color: #000000;
  /* Dark mode default */
  transition: background-color 0.5s ease;
}

body.light-mode .bento-section {
  background-color: #f5f5f7;
  /* Light mode */
}

/* Theme Aware Card */
.apple-card-theme {
  background-color: #1c1c1e;
  /* Dark mode default */
  color: #ffffff;
  transition:
    background-color 0.5s ease,
    color 0.5s ease,
    transform 0.3s ease,
    box-shadow 0.3s ease;
}

body.light-mode .apple-card-theme {
  background-color: #ffffff !important;
  /* Light mode */
  color: #1d1d1f !important;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.08);
}

/* Theme Aware Text */
.text-theme-title {
  color: #ffffff;
}

.text-theme-desc {
  color: #e5e5e5;
}

.text-theme-eyebrow {
  color: #9ca3af;
}

body.light-mode .text-theme-title {
  color: #1d1d1f !important;
}

body.light-mode .text-theme-desc {
  color: #1d1d1f !important;
}

body.light-mode .text-theme-eyebrow {
  color: #86868b !important;
}

/* Apple-style Card (Legacy/Base) */
.apple-card {
  background-color: #1c1c1e;
  /* Dark mode default */
  color: white;
  box-shadow:
    0 4px 6px -1px rgba(0, 0, 0, 0.1),
    0 2px 4px -1px rgba(0, 0, 0, 0.06);
  transition:
    transform 0.3s ease,
    box-shadow 0.3s ease,
    background-color 0.5s ease;
}

.apple-card:hover {
  transform: scale(1.02);
  box-shadow:
    0 20px 25px -5px rgba(0, 0, 0, 0.1),
    0 10px 10px -5px rgba(0, 0, 0, 0.04);
}

/* Light Mode Card Overrides */
body.light-mode .apple-card {
  background-color: #ffffff !important;
  color: #1d1d1f !important;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.08);
  /* Soft ambient shadow */
}

body.light-mode .apple-card:hover {
  box-shadow: 0 20px 40px rgba(0, 0, 0, 0.12);
}

/* 3D Coverflow Slider CSS */
.coverflow-scene {
  perspective: 1000px;
  overflow: hidden;
  width: 100%;
  height: 100%; /* Will depend on aspect ratio */
  position: relative;
  display: flex;
  justify-content: center;
  align-items: center;
  padding: 20px 0;
}

.coverflow-card {
  position: absolute;
  width: 85%; /* Increased from 70% */
  aspect-ratio: 16/9;
  transition: all 0.6s cubic-bezier(0.25, 0.8, 0.25, 1);
  background: #000;
  border-radius: 4px; /* Slight rounded corners for screen */
  /* Monitor Border Style */
  border: 12px solid #3d3d3d;
  box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.5);
}

body.light-mode .coverflow-card {
  border-color: #1d1d1f;
  box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.2);
}

/* Mobile Adjustments */
@media (max-width: 768px) {
  .coverflow-card {
    width: 95%; /* Increased from 85% */
    border-width: 6px;
  }
}

/* States */
.coverflow-card.active {
  z-index: 30;
  transform: translateX(0) scale(1);
  opacity: 1;
  /* box-shadow: 0 0 0 1px rgba(255,255,255,0.1); Glass reflection hint? */
}

.coverflow-card.prev {
  z-index: 20;
  transform: translateX(-80%) scale(0.8); /* Pushed out further to reduce overlap */
  opacity: 0.6;
  cursor: pointer;
  filter: brightness(0.7); /* Dim side cards */
}

.coverflow-card.next {
  z-index: 20;
  transform: translateX(80%) scale(0.8);
  opacity: 0.6;
  cursor: pointer;
  filter: brightness(0.7);
}

.coverflow-card.hidden-left {
  z-index: 10;
  transform: translateX(-200%) scale(0.7);
  opacity: 0;
  pointer-events: none;
}

.coverflow-card.hidden-right {
  z-index: 10;
  transform: translateX(200%) scale(0.7);
  opacity: 0;
  pointer-events: none;
}

/* Navigation Arrows */
.slider-nav-btn {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  z-index: 50;
  background: rgba(255, 255, 255, 0.1);
  backdrop-filter: blur(10px);
  border-radius: 50%;
  width: 48px;
  height: 48px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: white;
  border: 1px solid rgba(255, 255, 255, 0.2);
  cursor: pointer;
  transition: all 0.3s ease;
}

@media (max-width: 768px) {
  .slider-nav-btn {
    width: 32px;
    height: 32px;
  }
  .slider-nav-btn svg {
    width: 16px;
    height: 16px;
  }
}
.slider-nav-btn:hover {
  background: rgba(255, 255, 255, 0.2);
  scale: 1.1;
}
body.light-mode .slider-nav-btn {
  background: rgba(0, 0, 0, 0.05); /* Dark tint for light mode controls */
  border-color: rgba(0, 0, 0, 0.1);
  color: #1d1d1f;
}
body.light-mode .slider-nav-btn:hover {
  background: rgba(0, 0, 0, 0.1);
}

/* Ambient Pulse Animation */
@keyframes pulse-slow {
  0%,
  100% {
    transform: scale(1);
    opacity: 0.5;
  }

  50% {
    transform: scale(1.1);
    opacity: 0.7;
  }
}

.animate-pulse-slow {
  animation: pulse-slow 6s cubic-bezier(0.4, 0, 0.6, 1) infinite;
}

/* Ensure texts inside apple-card update correctly in light mode */
body.light-mode .apple-card h3 {
  color: #1d1d1f !important;
}

body.light-mode .apple-card p {
  color: #86868b !important;
}

/* Ghost Button Overrides */
.btn-ghost-always-white,
body.light-mode .btn-ghost-always-white {
  border-color: #ffffff !important;
  color: #ffffff !important;
  backdrop-filter: blur(10px);
  background-color: rgba(255, 255, 255, 0.1);
}

.btn-ghost-always-white:hover,
body.light-mode .btn-ghost-always-white:hover {
  background-color: #ffffff !important;
  color: #000000 !important;
}

/* Card Hover Zoom */
.card-zoom-container {
  overflow: hidden;
  border-radius: 24px;
  /* Apple-like curvature */
}

.card-zoom-image {
  transition: transform 0.7s cubic-bezier(0.25, 0.46, 0.45, 0.94);
}

.group:hover .card-zoom-image {
  transform: scale(1.05);
}

/* Apple-style Slider Card - REDESIGNED */
.apple-slider-card {
  background-color: #1c1c1e;
  /* Fallback */
  border-radius: 24px;
  /* Slightly more rounded */
  height: 500px;
  /* Taller to match reference */
  width: 100%;
  position: relative;
  overflow: hidden;
  transition:
    transform 0.3s ease,
    box-shadow 0.3s ease;
  box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.3);
  display: block;
  /* Ensure it's a block for positioning */
}

.apple-slider-card:hover {
  transform: scale(1.03);
  box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.4);
  z-index: 10;
}

/* Light Mode Slider Card - specific overrides if needed, but image dominates */
body.light-mode .apple-slider-card {
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.15);
}

/* Background Image Layer */
.slider-bg-img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.7s ease;
}

.apple-slider-card:hover .slider-bg-img {
  transform: scale(1.05);
}

/* Gradient Overlay for Readability */
.slider-overlay {
  position: absolute;
  inset: 0;
  background: linear-gradient(
    to top,
    rgba(0, 0, 0, 0.9) 0%,
    rgba(0, 0, 0, 0.5) 40%,
    rgba(0, 0, 0, 0) 100%
  );
  z-index: 1;
}

/* Content Container */
.slider-content {
  position: absolute;
  bottom: 30px;
  left: 24px;
  right: 24px;
  z-index: 2;
  color: white;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
}

.slider-content.center {
  align-items: center;
  text-align: center;
}

/* Card Text Styles - Updated */
.slider-eyebrow {
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: rgba(255, 255, 255, 0.8);
  margin-bottom: 8px;
}

.slider-title {
  font-size: 28px;
  font-weight: 700;
  line-height: 1.1;
  color: #ffffff;
  margin-bottom: 12px;
  letter-spacing: -0.01em;
}

/* Ensure title stays white even in light mode due to dark overlay */
body.light-mode .slider-title {
  color: #ffffff !important;
}

.slider-desc {
  font-size: 15px;
  line-height: 1.4;
  color: rgba(255, 255, 255, 0.9);
  margin-bottom: 24px;
  /* Space for buttons */
  font-weight: 400;
  display: -webkit-box;
  -webkit-line-clamp: 3;
  line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

/* Slider Section Backgrounds */
/* Slider Section Backgrounds - Now using inner divs for Gradient */
.slider-section {
  position: relative;
}

/* Ensure content sits above the background overlay */
.slider-section > * {
  position: relative;
  z-index: 1;
}

/* Light Mode Footer Overrides */
body.light-mode .footer-section {
  background-color: #f5f5f7 !important;
  color: #86868b !important;
  border-top: 1px solid #d2d2d7;
}

body.light-mode .footer-section h2,
body.light-mode .footer-section h3 {
  color: #1d1d1f !important;
}

body.light-mode .footer-section a:hover {
  color: #1d1d1f !important;
}

body.light-mode .footer-section .border-gray-700\/50 {
  border-color: #d2d2d7 !important;
}

/* Apple Store Gradient Text */
.text-gradient-store {
  background: linear-gradient(to right, #3b82f6, #8b5cf6, #f97316);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  color: transparent;
  display: inline-block;
  padding-bottom: 0.1em;
  /* Prevent descender clipping */
}
/* Typing Indicator */
.typing-indicator {
  display: flex;
  align-items: center;
  gap: 4px;
  padding: 4px 0;
}

.typing-dot {
  width: 6px;
  height: 6px;
  background-color: #9ca3af; /* Gray 400 */
  border-radius: 50%;
  animation: typingBounce 1.4s infinite ease-in-out both;
}

.typing-dot:nth-child(1) {
  animation-delay: -0.32s;
}
.typing-dot:nth-child(2) {
  animation-delay: -0.16s;
}

@keyframes typingBounce {
  0%,
  80%,
  100% {
    transform: scale(0);
  }
  40% {
    transform: scale(1);
  }
}

/* Utility Classes */
.no-scrollbar::-webkit-scrollbar {
    display: none;
}
.no-scrollbar {
    -ms-overflow-style: none;  /* IE and Edge */
    scrollbar-width: none;  /* Firefox */
}
.scroll-smooth {
    scroll-behavior: smooth;
}

/* Utility Classes for Third-Party Scripts (SEO Fix) */
.hidden-pixel {
  display: none;
}

.hidden-gtm {
  display: none;
  visibility: hidden;
}

.google-attr-style {
  opacity: 0.8;
  font-size: 10px;
  color: #888;
  margin-top: 10px;
  text-align: center;
}
