/* Global Styles */
html, body {
  height: 100%;
  margin: 0;
  padding: 0;
  color: #f8f9fa; /* Light text by default for better contrast */
}
body {
  display: flex;
  flex-direction: column;
  font-family: 'Roboto', sans-serif;  /* Consistent global font */
  position: relative; /* For proper z-index stacking */
}
body::before {
  content: "";
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  z-index: -100; /* Far behind all content */
  background-attachment: fixed;
  background-position: center center;
  background-size: cover;
  background-repeat: no-repeat;
  /* Enhanced blur with grey overlay */
  filter: blur(3px) brightness(0.7);
  will-change: transform; /* Performance hint for browser */
  backface-visibility: hidden;
}
/* Add a grey overlay for consistency across all pages */
body::after {
  content: "";
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  z-index: -99; /* Between background and particles */
  background-color: rgba(70, 70, 70, 0.3); /* Grey tint overlay */
  pointer-events: none;
}
/* Home page background */
body.home::before {
  background-image: url('../images/background.webp');
}
/* Services page background */
body.services::before {
  background-image: url('../images/MLservices.webp');
}
/* About page background */
body.about::before {
  background-image: url('../images/teamwork.webp');
}
/* Contact page background */
body.contact::before {
  background-image: url('../images/survey.webp');
}
main {
  flex: 1;
  position: relative; /* Ensure proper stacking */
  z-index: 1; /* Above the background */
}

/* Content overlay to improve readability over the background */
.content-wrapper {
  background-color: rgba(0, 0, 0, 0.5);
  position: relative;
  z-index: 1;
}
.content-section {
  background-color: rgba(255, 255, 255, 0.85);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  border-radius: 12px;
  box-shadow: 0 8px 16px rgba(0, 0, 0, 0.1);
  margin-bottom: 30px;
  color: #212529;
}

/* Links */
a, a:visited {
  color: #c9d1d9;
  text-decoration: none;
}
a:hover {
  color: #ffffff;
  text-decoration: underline;
}

/* Section Background Overrides */
.bg-light {
  background-color: rgba(248, 249, 250, 0.9) !important;
  color: #0d1117 !important; /* Dark text on light backgrounds */
}

section.container {
  background-color: rgba(255, 255, 255, 0.85);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  border-radius: 12px;
  padding: 30px;
  box-shadow: 0 8px 16px rgba(0, 0, 0, 0.1);
  color: #212529; /* Ensuring dark text on white container backgrounds */
}

/* Page header styling - simplified */
.page-header {
  padding: 100px 0 50px 0;
  text-align: center;
  position: relative;
  z-index: 1;
}

.page-header h1 {
  font-family: 'Roboto', sans-serif;
  font-weight: bold;
  color: white;
  text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.5);
}

.page-header .lead {
  color: white;
  text-shadow: 1px 1px 3px rgba(0, 0, 0, 0.5);
}

/* Footer */
footer {
  position: relative;
  bottom: 0;
  width: 100%;
  background-color: rgba(33, 37, 41, 0.95) !important;
}

/* Particles Container - Fixed position like background */
#particles-js, #particles-js-services, #particles-js-about, #particles-js-contact {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  z-index: -90; /* Behind content but in front of background */
  pointer-events: none; /* Ensure clicks pass through to elements below */
  background-color: transparent;
  background-image: none;
  background-position: 50% 50%;
  background-repeat: no-repeat;
}

/* Typed.js cursor style */
.typed-cursor {
  font-size: 1.25rem;
  color: #f8c040;
  opacity: 1;
  animation: blink 0.4s infinite;
}
@keyframes blink {
  0% { opacity: 1; }
  50% { opacity: 0; }
  100% { opacity: 1; }
}

/* Interactive element effects */
.hover-lift {
  transition: transform 0.15s ease, box-shadow 0.15s ease;
  will-change: transform, box-shadow;
}
.hover-lift:hover {
  transform: translateY(-5px);
  box-shadow: 0 10px 20px rgba(0, 0, 0, 0.15);
}

/* Swiper carousel styling */
.swiper-container {
  width: 100%;
  padding-bottom: 50px;
}
.swiper-slide {
  background-position: center;
  background-size: cover;
  height: auto; /* Ensure proper height adjustment */
}
.swiper-pagination-bullet-active {
  background-color: #6610f2 !important;
}

/* Elegant Headings */
h1.display-3 {
  font-family: 'Roboto', sans-serif;  /* Consistent heading font */
  text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.4);
}

/* Card Styling */
.card {
  border: none;
  border-radius: 12px;
  background-color: rgba(255, 255, 255, 0.85);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  color: #212529; /* Ensuring dark text on card backgrounds */
  box-shadow: 0 8px 16px rgba(0, 0, 0, 0.1);
  /* Hardware acceleration for cards */
  transform: translateZ(0);
}

/* Two-Column Sections & Spacing */
section.py-5 > .container .row {
  margin-bottom: 2rem;
}
section.py-5 > .container .row:last-child {
  margin-bottom: 0;
}
section:last-of-type {
  margin-bottom: 0 !important;
  padding-bottom: 0 !important;
}

/* Core Values Icons */
.fas {
  color: #f8c040;
}

/* Custom Button Styles */
.btn-primary {
  background: linear-gradient(45deg, #007BFF, #6610f2);
  border: none;
  box-shadow: 0 4px 10px rgba(0, 0, 0, 0.2);
  transition: background 0.3s ease, box-shadow 0.3s ease;
}

.btn-primary:hover,
.btn-primary:focus {
  background: linear-gradient(45deg, #0056b3, #520dc2);
  box-shadow: 0 6px 12px rgba(0, 0, 0, 0.3);
}

.btn-outline-primary {
  color: #6610f2;
  border-color: #6610f2;
  transition: background 0.3s ease, color 0.3s ease;
}

.btn-outline-primary:hover,
.btn-outline-primary:focus {
  color: #ffffff;
  background-color: #6610f2;
  border-color: #6610f2;
}

/* Core Value Card Styling */
.core-value-card {
  background-color: rgba(255, 255, 255, 0.85);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  border: none;
  border-radius: 12px;
  box-shadow: 0 8px 16px rgba(0, 0, 0, 0.1);
  transition: transform 0.3s ease, box-shadow 0.3s ease;
  color: #212529; /* Ensuring dark text on core value cards */
  /* Hardware acceleration for cards */
  transform: translateZ(0);
}
.core-value-card:hover {
  transform: translateY(-5px);
  box-shadow: 0 12px 24px rgba(0, 0, 0, 0.15);
}

/* Form label colors */
.form-label {
  color: #212529;
}

/* Text in light sections */
.bg-light p, .bg-light h1, .bg-light h2, .bg-light h3, .bg-light h4, .bg-light h5, .bg-light h6 {
  color: #212529;
}

/* Links in white containers */
section.container a:not(.btn), .card a:not(.btn) {
  color: #0d6efd;
}
section.container a:not(.btn):hover, .card a:not(.btn):hover {
  color: #0a58ca;
}

/* Dark mode overrides */
@media (prefers-color-scheme: dark) {
  body::before {
    filter: blur(3px) brightness(0.5);
  }
  
  body::after {
    background-color: rgba(30, 30, 30, 0.4); /* Darker grey overlay for dark mode */
  }
  
  section.container, .content-section {
    background-color: rgba(33, 37, 41, 0.85);
    color: #f8f9fa; /* Light text in dark mode containers */
  }
  
  .bg-light {
    background-color: rgba(33, 37, 41, 0.85) !important;
    color: #f8f9fa !important;
  }
  
  /* Updated - Add dark mode specific styling for the bg-dark sections */
  .bg-dark {
    background-color: rgba(33, 37, 41, 0.95) !important;
  }
  
  /* Light text for dark backgrounds in dark mode */
  .bg-light p, .bg-light h1, .bg-light h2, .bg-light h3, .bg-light h4, .bg-light h5, .bg-light h6,
  .bg-dark p, .bg-dark h1, .bg-dark h2, .bg-dark h3, .bg-dark h4, .bg-dark h5, .bg-dark h6 {
    color: #f8f9fa;
  }
  
  /* Form labels in dark mode */
  .form-label {
    color: #f8f9fa;
  }
  
  /* Unified dark card colors - exact same values for all card types */
  .card, .core-value-card, .testimonial-card, .cta-section, .form-container {
    background-color: rgba(40, 44, 50, 0.8) !important;
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    color: #f8f9fa !important;
    box-shadow: 0 8px 16px rgba(0, 0, 0, 0.3) !important;
  }
  
  /* Links in dark mode */
  section.container a:not(.btn), .card a:not(.btn) {
    color: #8bb9fe;
  }
  section.container a:not(.btn):hover, .card a:not(.btn):hover {
    color: #afd3fe;
  }
  
  /* Button styling in dark mode */
  .btn-primary {
    background: linear-gradient(45deg, #0d6efd, #6610f2);
    border: none;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.3);
  }
  
  .btn-primary:hover,
  .btn-primary:focus {
    background: linear-gradient(45deg, #0b5ed7, #520dc2);
    box-shadow: 0 6px 12px rgba(0, 0, 0, 0.4);
  }
  
  /* Particles visibility in dark mode */
  #particles-js, #particles-js-services, #particles-js-about, #particles-js-contact {
    opacity: 0.8;
  }
  
  /* Ensure text-muted is properly visible in dark mode */
  .text-muted {
    color: #adb5bd !important; /* Lighter muted text for better visibility in dark mode */
  }
}

/* Text colors */
.text-muted {
  color: #6c757d !important; /* Darker muted text for better visibility */
}

/* Call to Action Sections */
.cta-section {
  background-color: rgba(255, 255, 255, 0.85);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  border-radius: 12px;
  padding: 40px 30px;
  margin-bottom: 30px;
  box-shadow: 0 8px 16px rgba(0, 0, 0, 0.1);
  color: #212529;
  position: relative;
  overflow: hidden;
}

.cta-section .btn-container {
  margin-top: 25px;
  margin-bottom: 10px;
  text-align: center;
}

/* Form Container */
.form-container {
  background-color: rgba(255, 255, 255, 0.85);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  border-radius: 12px;
  padding: 40px 30px;
  box-shadow: 0 8px 16px rgba(0, 0, 0, 0.1);
  color: #212529;
  margin-bottom: 40px;
}

/* Testimonial Card Styling */
.testimonial-card {
  background-color: rgba(255, 255, 255, 0.92);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  margin-bottom: 20px;
  border-radius: 12px;
  height: 100%;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.testimonial-card .card-body {
  flex: 1;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  padding: 30px !important;
}

.testimonial-card svg {
  color: #f8c040;
  margin-bottom: 16px;
}

.testimonial-card .lead {
  font-size: 1rem;
  line-height: 1.6;
  flex-grow: 1;
  margin-bottom: 20px;
  overflow: hidden;
  display: -webkit-box;
  -webkit-line-clamp: 8;
  -webkit-box-orient: vertical;
  text-align: left;
}

.testimonial-card h5 {
  font-weight: 600;
  margin-bottom: 5px;
  color: #212529;
}

.testimonial-card .text-muted {
  font-size: 0.9rem;
  margin-bottom: 0;
}

/* Ensure consistent card heights */
.testimonial-slider .swiper-slide {
  height: auto;
}

.bg-dark .testimonial-card {
  border: 1px solid rgba(255, 255, 255, 0.1);
}

/* Fix testimonial name colors specifically for dark mode */
.bg-secondary .testimonial-card h5,
.bg-dark .testimonial-card h5 {
  color: #ffffff !important;
}

/* Override for dark mode */
@media (prefers-color-scheme: dark) {
  .testimonial-card h5 {
    color: #ffffff !important;
  }
  
  .card.bg-secondary h5 {
    color: #ffffff !important;
  }
}

/* Optimize performance for cards and containers */
.card, .core-value-card, .testimonial-card, .cta-section, .form-container, .content-section, section.container {
  /* Hardware acceleration - force GPU rendering */
  transform: translateZ(0);
  will-change: transform;
  /* Reduce expensive backdrop filters */
  backdrop-filter: blur(5px);
  -webkit-backdrop-filter: blur(5px);
  /* Simplify box shadows */
  box-shadow: 0 4px 10px rgba(0, 0, 0, 0.1);
}

/* Reduce animation complexity on mobile */
@media (max-width: 768px) {
  .hover-lift {
    transition: none;
  }
  
  [data-aos] {
    opacity: 1 !important;
    transform: none !important;
    transition: none !important;
  }
  
  .card, .core-value-card, .testimonial-card, .cta-section, .form-container {
    backdrop-filter: none;
    -webkit-backdrop-filter: none;
  }
}

/* Success animation for contact form */
@keyframes checkmark {
  0% {
    stroke-dashoffset: 100;
    opacity: 0;
  }
  100% {
    stroke-dashoffset: 0;
    opacity: 1;
  }
}

.success-icon svg {
  stroke-dasharray: 100;
  animation: checkmark 0.6s ease-in-out forwards;
}

#success-message {
  opacity: 0;
  transform: translateY(20px);
  transition: opacity 0.4s ease-out, transform 0.4s ease-out;
}

/* General transition speed for all elements */
.transition, a, button, .btn, .nav-link, .dropdown-item {
  transition-duration: 0.15s !important;
}

/* Time Series Line Animation */
.time-series-line {
  stroke-dasharray: 1000;
  stroke-dashoffset: 1000;
  animation: draw-line 2s forwards ease-out;
}

@keyframes draw-line {
  to {
    stroke-dashoffset: 0;
  }
}

/* Mobile Optimizations */
@media (max-width: 768px) {
  /* Quick reveal for mobile */
  [data-aos] {
    transition-duration: 300ms !important;
  }
  
  /* Ensure touch targets are large enough */
  .btn, .nav-link {
    padding: 0.75rem 1rem;
    margin: 0.25rem;
  }
  
  /* Better spacing for stats on mobile */
  .card {
    margin-bottom: 1rem;
  }
  
  /* Enhanced card for touch experiences */
  .card {
    transform: none !important;
    transition: box-shadow 0.3s ease;
  }
  
  .card:active {
    box-shadow: 0 0 0 3px rgba(102, 16, 242, 0.5);
  }
}

/* Advanced hover effects only for non-touch devices */
@media (hover: hover) {
  .hover-lift:hover {
    transform: translateY(-5px) scale(1.02);
    box-shadow: 0 15px 30px rgba(0, 0, 0, 0.1);
  }
  
  .btn-primary:hover {
    box-shadow: 0 5px 15px rgba(13, 110, 253, 0.4);
  }
}

.text-gradient {
  background: linear-gradient(90deg, #6610f2, #0d6efd);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  font-size: 2.5rem;
  font-weight: 700;
  margin-bottom: 0.5rem;
}

/* Stats - No card styling, just numbers */
.stat-number {
  font-size: 2.2rem; /* Reduced to match "Welcome to Time AI" title */
  font-weight: 400; /* Normal font weight instead of bold */
  line-height: 1.2;
  margin-bottom: 0.3rem;
  /* Replace bright gradient with elegant gold/silver gradient */
  background: linear-gradient(90deg, #c9b16c, #e2d9b5);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  display: inline-block;
  text-shadow: 0 2px 10px rgba(0, 0, 0, 0.2);
}

/* Gradient text for emphasis */
.gradient-text {
  /* Match the same elegant gradient */
  background: linear-gradient(90deg, #c9b16c, #e2d9b5);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

/* Override the text-muted color in stats section */
.container.my-5 .stat-number + .text-muted {
  color: rgba(225, 222, 202, 0.85) !important;
  letter-spacing: 0.5px;
  font-weight: 500;
}

/* Optimize animations and transitions */
@media (prefers-reduced-motion: reduce) {
  * {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }
}

.service-point {
  display: flex;
  align-items: flex-start;
  margin-bottom: 1.5rem;
  padding: 1.5rem;
  border-radius: 8px;
  transition: all 0.3s ease;
  background-color: rgba(255, 255, 255, 0.95);
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
  border: 1px solid rgba(0, 0, 0, 0.05);
}

.service-point:last-child {
  border-bottom: none;
}

.service-point:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
  background-color: #0d6efd;
  border-color: #0d6efd;
}

.service-point:hover .point-content h3,
.service-point:hover .point-content p {
  color: #ffffff;
}

.service-point:hover .point-number {
  color: #ffffff;
  opacity: 0.9;
}

.point-number {
  font-size: 1.5rem;
  font-weight: 700;
  color: #0d6efd;
  margin-right: 1.5rem;
  line-height: 1;
  min-width: 2.5rem;
}

.point-content {
  flex: 1;
}

.point-content h3 {
  font-size: 1.2rem;
  margin-bottom: 0.5rem;
  color: #212529;
  font-weight: 600;
}

.point-content p {
  color: #495057;
  margin-bottom: 0;
  font-size: 1rem;
  line-height: 1.6;
}

/* Dark mode overrides for service points */
@media (prefers-color-scheme: dark) {
  .service-point {
    background-color: rgba(33, 37, 41, 0.95);
    border-color: rgba(255, 255, 255, 0.1);
  }

  .service-point:hover {
    background-color: #0d6efd;
    border-color: #0d6efd;
  }

  .service-point:hover .point-content h3,
  .service-point:hover .point-content p {
    color: #ffffff;
  }

  .service-point:hover .point-number {
    color: #ffffff;
    opacity: 0.9;
  }

  .point-content h3 {
    color: #f8f9fa;
  }

  .point-content p {
    color: #e9ecef;
  }
}

