/*
================================================================
| BITZETTA IT SOLUTIONS             |
================================================================
| Design Philosophy: "Digital Intelligence"                    |
| - Includes the AI dark theme with a full set of layout fixes |
| - Restores scrolling tech stack, card visibility, centering, |
|   and contact form layout.                                   |
----------------------------------------------------------------
*/

/* --- 1. ROOT VARIABLES & GLOBAL SETUP --- */
:root {
  --dark-bg: #0d1117;
  --card-bg: #161b22;
  --border-color: #30363d;
  --text-primary: #c9d1d9;
  --text-secondary: #8b949e;
  --accent-cyan: #00c6ff;
  --accent-orange: #fa5d0f;
  --white: #ffffff;
  --font-primary: "Poppins", sans-serif;
  --header-height: 70px;
  --border-radius: 12px;
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}
html {
  scroll-behavior: smooth;
  scroll-padding-top: var(--header-height);
}
body {
  font-family: var(--font-primary);
  line-height: 1.7;
  color: var(--text-primary);
  background: var(--dark-bg);
}
.container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 20px;
}
img {
  max-width: 100%;
  height: auto;
  display: block;
}
a {
  text-decoration: none;
  color: var(--accent-cyan);
  transition: color 0.3s ease;
}
a:hover {
  color: var(--white);
}
ul {
  list-style: none;
}
.content-section {
  padding: 100px 0;
  position: relative;
}
.bg-light {
  background-color: #10141b;
}

/* ====================================================== */
/* ==== NEW: PRELOADER AND CONTENT REVEAL STYLES ==== */
/* ====================================================== */

/* Initially hide the main content */
.main-header,
main,
.main-footer {
  opacity: 0;
  transition: opacity 0.8s ease-in-out;
}

/* Reveal the main content when the body has the 'loaded' class */
body.loaded .main-header,
body.loaded main,
body.loaded .main-footer {
  opacity: 1;
}

/* Preloader container */
#preloader {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100vh;
  background: var(--dark-bg);
  z-index: 9999;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: opacity 0.5s ease-out, visibility 0.5s ease-out;
}

#preloader.preloader-hidden {
  opacity: 0;
  visibility: hidden;
}

.preloader-content {
  text-align: center;
}

/* Glitch effect styles */
.glitch-wrapper {
  position: relative;
}
.glitch {
  font-size: 5rem; /* Adjust size as needed */
  font-weight: 700;
  color: var(--white);
  position: relative;
  letter-spacing: 0.1em;
  animation: fadeIn 1s ease-in forwards;
  opacity: 0;
}
.glitch::before,
.glitch::after {
  content: attr(data-text);
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: var(--dark-bg);
  overflow: hidden;
}
.glitch::before {
  left: 2px;
  text-shadow: -2px 0 var(--accent-orange);
  animation: glitch-anim-1 2.5s infinite linear alternate-reverse;
}
.glitch::after {
  left: -2px;
  text-shadow: -2px 0 var(--accent-cyan), 2px 2px var(--accent-orange);
  animation: glitch-anim-2 2.5s infinite linear alternate-reverse;
}

/* Sub-tagline reveal */
.tagline-reveal {
  font-size: 1.2rem;
  color: var(--text-secondary);
  letter-spacing: 0.5em;
  text-transform: uppercase;
  opacity: 0;
  transform: translateY(10px);
  animation: fadeIn-up 1s ease-out 0.5s forwards;
}

/* Keyframe animations */
@keyframes fadeIn {
  to {
    opacity: 1;
  }
}

@keyframes fadeIn-up {
  to {
    opacity: 0.8;
    transform: translateY(0);
  }
}

@keyframes glitch-anim-1 {
  0% {
    clip-path: inset(3% 0 95% 0);
  }
  10% {
    clip-path: inset(78% 0 3% 0);
  }
  20% {
    clip-path: inset(45% 0 50% 0);
  }
  30% {
    clip-path: inset(12% 0 10% 0);
  }
  40% {
    clip-path: inset(92% 0 3% 0);
  }
  50% {
    clip-path: inset(25% 0 20% 0);
  }
  60% {
    clip-path: inset(66% 0 14% 0);
  }
  70% {
    clip-path: inset(88% 0 5% 0);
  }
  80% {
    clip-path: inset(42% 0 55% 0);
  }
  90% {
    clip-path: inset(22% 0 70% 0);
  }
  100% {
    clip-path: inset(95% 0 2% 0);
  }
}

@keyframes glitch-anim-2 {
  0% {
    clip-path: inset(83% 0 10% 0);
  }
  10% {
    clip-path: inset(5% 0 80% 0);
  }
  20% {
    clip-path: inset(33% 0 33% 0);
  }
  30% {
    clip-path: inset(62% 0 30% 0);
  }
  40% {
    clip-path: inset(2% 0 92% 0);
  }
  50% {
    clip-path: inset(40% 0 30% 0);
  }
  60% {
    clip-path: inset(70% 0 24% 0);
  }
  70% {
    clip-path: inset(92% 0 5% 0);
  }
  80% {
    clip-path: inset(50% 0 50% 0);
  }
  90% {
    clip-path: inset(10% 0 85% 0);
  }
  100% {
    clip-path: inset(77% 0 5% 0);
  }
}

/* --- 2. TYPOGRAPHY & HEADINGS --- */
.section-title {
  text-align: center;
  font-size: 2.8rem;
  font-weight: 700;
  margin-bottom: 20px;
  color: var(--white);
  position: relative;
  padding-bottom: 20px;
}
.section-title::after {
  content: "";
  position: absolute;
  bottom: 0;
  left: 50%;
  transform: translateX(-50%);
  width: 80px;
  height: 4px;
  background: linear-gradient(90deg, var(--accent-orange), var(--accent-cyan));
  border-radius: 2px;
}
.subtitle {
  text-align: center;
  max-width: 700px;
  margin: -10px auto 50px auto;
  color: var(--text-secondary);
  font-size: 1.1rem;
}
.section-title-left {
  text-align: left;
  font-size: 2.8rem;
  font-weight: 700;
  margin-bottom: 20px;
  color: var(--white);
  position: relative;
  padding-bottom: 20px;
}
.section-title-left::after {
  content: "";
  position: absolute;
  bottom: 0;
  left: 0; /* Align the underline to the left */
  transform: translateX(0); /* Remove the centering transform */
  width: 80px;
  height: 4px;
  background: linear-gradient(90deg, var(--accent-orange), var(--accent-cyan));
  border-radius: 2px;
}
/* --- 3. REUSABLE COMPONENTS (Buttons) --- */
.btn {
  display: inline-block;
  padding: 14px 35px;
  border-radius: 50px;
  font-weight: 600;
  transition: all 0.3s ease;
  border: 2px solid transparent;
  text-align: center;
  text-transform: uppercase;
  letter-spacing: 1px;
}
.btn-primary {
  background: var(--accent-orange);
  color: var(--white);
  border-color: var(--accent-orange);
  box-shadow: 0 0 20px rgba(250, 93, 15, 0.4);
}
.btn-primary:hover {
  background: transparent;
  color: var(--accent-orange);
  transform: translateY(-3px);
  box-shadow: 0 5px 25px rgba(250, 93, 15, 0.6);
}
.btn-secondary {
  background: transparent;
  color: var(--white);
  border-color: var(--accent-cyan);
}
.btn-secondary:hover {
  background: var(--accent-cyan);
  color: var(--dark-bg);
  transform: translateY(-3px);
  box-shadow: 0 5px 25px rgba(0, 198, 255, 0.4);
}

/* --- 4. HEADER & NAVIGATION --- */
.main-header {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  z-index: 1000;
  height: var(--header-height);
  transition: background 0.4s ease, border-bottom 0.4s ease;
}
.main-header.scrolled {
  background: rgba(13, 17, 23, 0.7);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--border-color);
}
.navbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  height: 100%;
}
.nav-logo img {
    margin-top: 5px;
  height: 45px;
  width: auto;
}
.nav-menu {
  display: flex;
  align-items: center;
  gap: 30px;
}
.nav-link {
  color: var(--text-primary);
  font-weight: 500;
  transition: color 0.3s ease;
}
.nav-link:hover {
  color: var(--accent-cyan);
}
.nav-link.contact-btn {
  border: 2px solid var(--accent-orange);
  padding: 8px 20px;
  border-radius: 50px;
  color: var(--accent-orange);
  transition: all 0.3s;
}
.nav-link.contact-btn:hover {
  background: var(--accent-orange);
  color: var(--white);
}
.hamburger {
  display: none;
}
.bar {
  display: block;
  width: 25px;
  height: 3px;
  margin: 5px auto;
  transition: all 0.3s ease-in-out;
  background-color: var(--white);
}

/* --- 5. HERO SECTION --- */
.hero-section {
  height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  color: var(--white);
  position: relative;
  overflow: hidden;
  /* Use a darker, more solid background for the data stream effect */
  background: var(--dark-bg);
}

/* Style for the new 2D canvas */
#ai-hero-canvas {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  z-index: 1; /* Sits behind the content */
}

.hero-content {
  position: relative;
  z-index: 2; /* Sits on top of the canvas */
}

.hero-content h1 {
  font-size: 4.5rem;
  font-weight: 700;
  margin-bottom: 15px;
  text-shadow: 0 0 30px rgba(0, 198, 255, 0.3);
}

.hero-content .tagline {
  font-size: 1.5rem;
  color: var(--text-secondary);
  margin-bottom: 40px;
  font-weight: 400;
}

.tagline .accent-text {
  color: var(--accent-cyan);
  font-weight: 600;
}

.cta-buttons a {
  margin: 0 10px;
}

/* --- 6. COUNTERS, ABOUT, GRIDS --- */
.counters-section {
  background: var(--card-bg);
  padding: 40px 0;
  border-bottom: 1px solid var(--border-color);
}
.counter-container {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  text-align: center;
}
.counter-item h3 {
  font-size: 3rem;
  color: var(--accent-orange);
  font-weight: 700;
}
.counter-item p {
  color: var(--text-secondary);
  font-weight: 500;
}

.two-column {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 60px;
  align-items: center;
}
.about-section img {
  border-radius: var(--border-radius);
  border: 1px solid var(--border-color);
}
.text-content h2 {
  text-align: left;
}

.grid-layout-3,
.grid-layout-4 {
  display: grid;
  gap: 30px;
  margin-top: 50px;
}
.grid-layout-3 {
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
}
.grid-layout-4 {
  grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
}

/* --- 7. CARDS (Capabilities, etc.) --- */
#capabilities.bg-light {
  background-color: var(--dark-bg);
  position: relative;
  overflow: hidden;
}

/* Optional: Add a subtle background pattern for more depth */
#capabilities::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-image: radial-gradient(var(--border-color) 1px, transparent 1px);
  background-size: 20px 20px;
  opacity: 0.1;
  z-index: 0;
}

.ai-capabilities-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
  gap: 30px;
  position: relative;
  z-index: 1;
}

.ai-capability-card {
  background: rgba(22, 27, 34, 0.5); /* Semi-transparent glass background */
  backdrop-filter: blur(12px);
  border: 1px solid var(--border-color);
  border-radius: var(--border-radius);
  padding: 2px; /* Padding for the border-like effect of the glow */
  position: relative;
  overflow: hidden;
  transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.ai-capability-card:hover {
  transform: translateY(-8px);
  box-shadow: 0 20px 40px rgba(0, 0, 0, 0.4);
}

/* This is the interactive glow element */
.ai-capability-card::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  /* The gradient is positioned by JS-controlled CSS variables */
  background: radial-gradient(
    350px circle at var(--mouse-x) var(--mouse-y),
    rgba(0, 198, 255, 0.2),
    /* Glow color */ transparent 80%
  );
  opacity: 0;
  transition: opacity 0.4s ease-out;
  z-index: 1;
}

.ai-capability-card:hover::before {
  opacity: 1;
}

/* The actual content container sits on top of the glow */
.card-content {
  background: var(--card-bg); /* Opaque background for readability */
  border-radius: calc(var(--border-radius) - 2px);
  padding: 40px 30px;
  width: 100%;
  height: 100%;
  position: relative;
  z-index: 2; /* Sits above the ::before pseudo-element */
  text-align: center;
}

.capability-icon {
  font-size: 2.5rem;
  margin-bottom: 20px;
  color: var(--accent-cyan);
  background: linear-gradient(45deg, var(--accent-cyan), var(--accent-orange));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  transition: transform 0.3s ease;
}

.ai-capability-card:hover .capability-icon {
  transform: scale(1.1);
}

.card-content h3 {
  color: var(--white);
  margin-bottom: 10px;
  font-size: 1.4rem;
}

.card-content p {
  color: var(--text-secondary);
}

/* --- 7B. TECHNOLOGY STACK (SCROLLING) - RESTORED --- */
.tech-stack-section {
  padding: 40px 0;
  background: var(--dark-bg);
  overflow: hidden;
  position: relative;
}
.tech-stack-section::before,
.tech-stack-section::after {
  content: "";
  position: absolute;
  top: 0;
  width: 100px;
  height: 100%;
  z-index: 2;
}
.tech-stack-section::before {
  left: 0;
  background: linear-gradient(to right, var(--dark-bg), transparent);
}
.tech-stack-section::after {
  right: 0;
  background: linear-gradient(to left, var(--dark-bg), transparent);
}

.scrolling-wrapper {
  display: flex;
}
.tech-logos {
  display: flex;
  align-items: center;
  gap: 80px;
  padding: 0 40px;
  animation: scroll 25s linear infinite;
  flex-shrink: 0;
}
.tech-logos span {
  font-size: 1.5rem;
  font-weight: 600;
  color: var(--text-secondary);
  white-space: nowrap;
  transition: color 0.3s;
}
.tech-logos span:hover {
  color: var(--white);
}
@keyframes scroll {
  from {
    transform: translateX(0);
  }
  to {
    transform: translateX(-100%);
  }
}

/* --- 7C. INDUSTRIES WE SERVE - RESTORED --- */
#industries {
  background-color: var(--dark-bg);
  padding-bottom: 120px; /* Add some extra space at the bottom */
}

.industry-focus-container {
  margin-top: 60px;
  position: relative;
  min-height: 500px; /* Ensure container has height */
  border-radius: var(--border-radius);
  overflow: hidden; /* Crucial for rounded corners on background images */
  border: 1px solid var(--border-color);
  background: var(--dark-bg); /* Default background */
}

/* Container for all background images */
.industry-backgrounds {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  z-index: 0;
}

/* Individual background image style */
.industry-bg {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-size: cover;
  background-position: center;
  opacity: 0; /* Hidden by default */
  transition: opacity 0.5s ease-in-out;
}

/* Dark overlay for better text readability */
.industry-bg::after {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: linear-gradient(
    to right,
    rgba(13, 17, 23, 0.9),
    rgba(13, 17, 23, 0.5)
  );
}

/* Class added by JS to show the background */
.industry-bg.active {
  opacity: 1;
}

/* The list of industries */
.industry-list {
  position: relative;
  z-index: 2;
  padding: 40px;
  display: flex;
  flex-direction: column;
  gap: 15px;
}

.industry-list li {
  background: rgba(22, 27, 34, 0.6); /* Glass effect */
  backdrop-filter: blur(10px);
  border: 1px solid var(--border-color);
  border-radius: 10px;
  padding: 25px 30px;
  cursor: pointer;
  transition: all 0.3s ease;
  opacity: 0.7; /* Dimmed by default */
}

.industry-list:hover li {
  opacity: 0.4; /* Dim all items when hovering the container */
}

.industry-list li:hover {
  opacity: 1; /* Highlight the hovered item */
  transform: scale(1.03);
  border-color: var(--accent-orange);
  background: rgba(22, 27, 34, 0.8);
}

.industry-header {
  display: flex;
  align-items: center;
  gap: 15px;
  margin-bottom: 10px;
}
.industry-header i {
  font-size: 1.8rem;
  color: var(--accent-orange);
  transition: color 0.3s ease;
}
.industry-list li:hover .industry-header i {
  color: var(--accent-cyan);
}
.industry-header h3 {
  color: var(--white);
  font-size: 1.3rem;
  margin: 0;
}
.industry-list li p {
  color: var(--text-secondary);
  font-size: 1rem;
  line-height: 1.6;
  margin: 0;
}

/* Responsive adjustments */
@media (max-width: 768px) {
  .industry-list {
    padding: 20px;
  }
  .industry-list li {
    opacity: 1; /* Disable dimming effect on mobile for clarity */
  }
  .industry-list:hover li {
    opacity: 1; /* Disable dimming effect on mobile */
  }
}

/* --- 7D. INTERNSHIP & COLLABORATE CTA - RESTORED --- */
#internship,
#collaborate {
  text-align: center;
}
#collaborate {
  padding: 80px 0;
  background: linear-gradient(45deg, var(--accent-orange), var(--accent-cyan));
  color: var(--white);
}
#collaborate h2 {
  color: var(--white);
}
#collaborate p {
  color: rgba(255, 255, 255, 0.9);
  max-width: 600px;
  margin: 0 auto 30px auto;
}
#collaborate .btn-primary {
  background: var(--white);
  color: var(--accent-orange);
  border-color: var(--white);
  box-shadow: none;
}
#collaborate .btn-primary:hover {
  background: transparent;
  color: var(--white);
  border-color: var(--white);
}
#collaborate .btn-secondary {
  border-color: var(--white);
}
#collaborate .btn-secondary:hover {
  background: var(--white);
  color: var(--dark-bg);
}

/* --- 8. TEAM SECTION --- */
#team.bg-light {
  background-color: #10141b; /* A dark, slightly off-black background */
}

.leadership-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
  gap: 40px;
  margin-top: 60px;
}

.leader-card {
  position: relative;
  overflow: hidden; /* This is crucial for the slide-up panel and zoom effect */
  border-radius: var(--border-radius);
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3);
  border: 1px solid var(--border-color);
  transition: box-shadow 0.4s ease;
}

.leader-card:hover {
  box-shadow: 0 15px 40px rgba(0, 198, 255, 0.2);
}

.leader-image {
  width: 100%;
  height: 400px; /* A fixed height for uniformity */
  object-fit: cover;
  object-position: top center; /* Ensures the top of the image (head) is prioritized */
  transition: transform 0.6s cubic-bezier(0.165, 0.84, 0.44, 1); /* Smooth, premium zoom */
}

.leader-card:hover .leader-image {
  transform: scale(1.05); /* The subtle zoom effect */
}

.leader-info-panel {
  position: absolute;
  bottom: 0;
  left: 0;
  width: 100%;
  padding: 25px 30px;
  color: var(--white);

  /* A gradient that is solid at the bottom and fades to transparent */
  background: linear-gradient(
    to top,
    rgba(13, 17, 23, 1) 40%,
    rgba(13, 17, 23, 0.8) 70%,
    transparent
  );

  /* Initial state: Panel is mostly hidden, only showing the details */
  /* calc(100% - 90px) means 90px of the panel will be visible */
  transform: translateY(calc(100% - 90px));
  transition: transform 0.6s cubic-bezier(0.165, 0.84, 0.44, 1);
}

.leader-card:hover .leader-info-panel {
  transform: translateY(0); /* On hover, panel slides fully into view */
}

.leader-details h3 {
  margin: 0;
  font-size: 1.5rem;
  font-weight: 600;
}

.leader-details p {
  margin: 5px 0 0 0;
  font-size: 1rem;
  color: var(--accent-cyan);
}

.leader-socials {
  margin-top: 20px;
  /* Initially hidden, will fade in on hover */
  opacity: 0;
  transform: translateY(10px);
  transition: opacity 0.4s ease 0.2s, transform 0.4s ease 0.2s; /* Note the 0.2s delay */
}

.leader-card:hover .leader-socials {
  opacity: 1;
  transform: translateY(0);
}

.leader-socials a {
  display: inline-flex; /* Use flexbox for perfect alignment */
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  background: var(--border-color);
  color: var(--white);
  border-radius: 50%;
  font-size: 1.1rem;
  text-decoration: none;
  transition: background-color 0.3s ease, transform 0.3s ease;
}

.leader-socials a:hover {
  background-color: var(--accent-cyan);
  color: var(--dark-bg);
  transform: scale(1.1);
}

/* --- 9. TESTIMONIALS & CAROUSEL --- */
.carousel-item {
  min-width: 100%;
  display: none;
}
.carousel-item.active {
  display: block;
}
.carousel-inner {
  display: flex;
  transition: transform 0.5s ease-in-out;
}
.carousel {
  position: relative;
  max-width: 900px;
  margin: auto;
  overflow: visible;
}
.testimonial-card {
  background: var(--card-bg);
  border: 1px solid var(--border-color);
  padding: 40px 40px 80px 40px; /* Padding for buttons */
  border-radius: var(--border-radius);
  text-align: center;
}
.avatar {
  width: 80px !important;
  height: 80px !important;
  border-radius: 50% !important;
  border: 4px solid var(--accent-cyan) !important;
  box-shadow: 0 0 20px rgba(0, 198, 255, 0.3);
  margin: 0 auto 25px auto;
  object-fit: cover !important;
}
.quote {
  font-size: 1.1rem;
  font-style: italic;
  margin-bottom: 20px;
  color: var(--text-secondary);
}
.client-name {
  color: var(--white);
  font-weight: 600;
  font-size: 1.2rem;
}
.company-name {
  font-size: 1rem;
  color: var(--accent-cyan);
}
.carousel-control {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  background: var(--border-color);
  color: var(--white);
  border: none;
  border-radius: 50%;
  width: 45px;
  height: 45px;
  font-size: 20px;
  cursor: pointer;
  z-index: 10;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 2px 5px rgba(0, 0, 0, 0.1);
  transition: all 0.3s ease;
}
.carousel-control.prev {
  left: -60px;
}
.carousel-control.next {
  right: -60px;
}
.carousel-control:hover {
  background: var(--accent-cyan);
  color: var(--dark-bg);
}
#testimonial-carousel .carousel-control {
  top: auto;
  bottom: 20px;
  transform: none;
}
#testimonial-carousel .prev {
  left: calc(50% - 55px);
}
#testimonial-carousel .next {
  right: calc(50% - 55px);
}

/*
============================================================
| FIX: UNIFORM IMAGE SIZING FOR SOLUTIONS CAROUSEL          |
============================================================
*/

.solutions-archive {
    margin-top: 60px;
    display: grid;
    grid-template-columns: 300px 1fr; /* Fixed width for index, flexible for display */
    gap: 40px;
    
    /* --- THE KEY FIX --- */
    /* Set a max-height for the entire container and make it a contained block. */
    height: 60vh;
    max-height: 550px;
    min-height: 500px;
    
    background: var(--card-bg);
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius);
    padding: 30px;
    overflow: hidden; /* Hide overflow from the main container */
}

/* Left Panel: Project Index */
.project-index {
    border-right: 1px solid var(--border-color);
    padding-right: 30px;
    /* --- FIX ---: Allow this column to scroll independently */
    overflow-y: auto;
}
/* Scrollbar styling for the index */
.project-index::-webkit-scrollbar { width: 4px; }
.project-index::-webkit-scrollbar-track { background: transparent; }
.project-index::-webkit-scrollbar-thumb { background: var(--border-color); border-radius: 2px; }

.project-index ul { list-style: none; padding: 0; margin: 0; }

.project-index-item {
    padding: 15px 20px;
    font-weight: 500;
    color: var(--text-secondary);
    border-radius: 8px;
    cursor: pointer;
    position: relative;
    transition: color 0.3s ease, background-color 0.3s ease;
}
.project-index-item:hover { color: var(--white); background-color: #21262d; }
.project-index-item.active { color: var(--white); background-color: #21262d; }
.project-index-item.active::before {
    content: ''; position: absolute; left: 0; top: 50%;
    transform: translateY(-50%); width: 4px; height: 60%;
    background: var(--accent-cyan); border-radius: 2px;
}

/* Right Panel: Project Display */
.project-display {
    position: relative;
    /* --- FIX ---: Allow this column to scroll independently */
    overflow-y: auto;
    padding-right: 15px; /* Space for the scrollbar */
}
/* Scrollbar styling for the display panel */
.project-display::-webkit-scrollbar { width: 6px; }
.project-display::-webkit-scrollbar-track { background: var(--card-bg); border-radius: 3px; }
.project-display::-webkit-scrollbar-thumb { background: var(--border-color); border-radius: 3px; }
.project-display::-webkit-scrollbar-thumb:hover { background: var(--text-secondary); }

.project-pane {
    /* --- FIX ---: Panes are no longer absolutely positioned. They will be toggled with 'display'. */
    display: none;
    width: 100%;
    height: 100%;
    opacity: 0;
    transition: opacity 0.4s ease;
}
.project-pane.active {
    display: block; /* Show the active pane */
    opacity: 1;
}

.project-image {
    width: 100%;
    /* --- FIX ---: Use aspect-ratio for modern, responsive images instead of fixed height. */
    aspect-ratio: 16 / 9;
    object-fit: cover;
    border-radius: 10px;
    margin-bottom: 25px;
    opacity: 0;
    transform: translateY(15px);
}
.project-details h3 {
    color: var(--white);
    font-size: 1.8rem;
    margin-bottom: 10px;
    opacity: 0;
    transform: translateY(15px);
}
.project-details p {
    color: var(--text-secondary);
    line-height: 1.7;
    opacity: 0;
    transform: translateY(15px);
    /* --- FIX ---: Ensure text wraps correctly */
    white-space: pre-wrap;
    word-break: break-word;
}

/* Animations are now triggered by the pane's 'active' class */
.project-pane.active .project-image {
    animation: content-fade-in 0.6s ease forwards;
}
.project-pane.active .project-details h3 {
    animation: content-fade-in 0.6s ease 0.1s forwards;
}
.project-pane.active .project-details p {
    animation: content-fade-in 0.6s ease 0.2s forwards;
}

@keyframes content-fade-in {
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* --- FULLY REDESIGNED RESPONSIVE STYLES --- */
@media (max-width: 992px) {
    .solutions-archive {
        /* On mobile, let the container's height be determined by its content */
        display: block;
        height: auto;
        max-height: none;
        min-height: 0;
        padding: 20px;
    }
    .project-index {
        border-right: none;
        border-bottom: 1px solid var(--border-color);
        padding: 0 0 20px 0;
        margin-bottom: 20px;
        max-height: 250px; /* Keep the index scrollable and compact */
    }
    .project-display {
        overflow-y: visible; /* Let the content flow naturally */
        padding-right: 0;
    }
    .project-image {
        /* Let the image height be natural based on its aspect ratio */
        height: auto;
    }
    /* Panes are always visible in the DOM flow, but only the active one is shown */
    .project-pane {
        position: relative;
    }
}

/* --- 10. CONTACT FORM & MAP - RESTORED --- */
#contact {
    position: relative;
    padding-bottom: 120px;
}

.contact-hub {
    margin-top: 60px;
    padding: 40px;
    border-radius: var(--border-radius);
    border: 1px solid var(--border-color);
    background: rgba(22, 27, 34, 0.6); /* Glassmorphism */
    backdrop-filter: blur(12px);
    box-shadow: 0 15px 40px rgba(0,0,0,0.4);
    margin-bottom: 20px;
}

.contact-options {
    display: flex;
    justify-content: center;
    gap: 20px;
    margin-bottom: 40px;
    padding-bottom: 40px;
    border-bottom: 1px solid var(--border-color);
}

.contact-option-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 10px;
    padding: 20px 30px;
    border-radius: 10px;
    border: 1px solid transparent;
    cursor: pointer;
    transition: background-color 0.3s ease, border-color 0.3s ease;
    flex-grow: 1;
    text-align: center;
}
.contact-option-item:hover {
    background-color: var(--card-bg);
}
.contact-option-item.active {
    border-color: var(--accent-cyan);
    background-color: var(--card-bg);
}

.contact-option-item i {
    font-size: 2rem;
    color: var(--accent-cyan);
}
.contact-option-item span {
    font-weight: 600;
    color: var(--text-primary);
}

.contact-content-panes {
    position: relative;
    display: grid;
    grid-template-columns: 1fr;
    grid-template-rows: 1fr;
}
.contact-pane {
    grid-area: 1 / 1 / 2 / 2;
    width: 100%;
    opacity: 0;
    transform: translateY(15px);
    transition: opacity 0.5s ease, transform 0.5s ease;
    pointer-events: none;
}
.contact-pane.active {
    opacity: 1;
    transform: translateY(0);
    pointer-events: auto;
}

/* Form Styling within the hub */
.contact-form input, .contact-form textarea {
    width: 100%; padding: 15px; margin-bottom: 20px; background: var(--card-bg);
    border: 1px solid var(--border-color); color: var(--text-primary); border-radius: 8px;
    font-family: inherit; font-size: 1rem; transition: border-color 0.3s, box-shadow 0.3s;
}
.contact-form input:focus, .contact-form textarea:focus {
    outline: none; border-color: var(--accent-cyan);
    box-shadow: 0 0 15px rgba(0, 198, 255, 0.2);
}
.contact-form button { width: 100%; margin-top: 10px; }

/* Info Box Styling */
.info-box { text-align: center; max-width: 600px; margin: 0 auto; }
.info-box h3 { color: var(--white); margin-bottom: 15px; }
.info-box p { color: var(--text-secondary); margin-bottom: 30px; }
.info-box .small-text { font-size: 0.9rem; margin-top: 20px; }

/* Contact Details & Map Styling */
.contact-details-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 40px;
    align-items: center;
}
.contact-info-block p { font-size: 1.1rem; color: var(--text-secondary); margin-bottom: 15px; }
.contact-info-block strong { color: var(--text-primary); }
.map-container {
    height: 250px; border-radius: var(--border-radius);
    overflow: hidden; border: 1px solid var(--border-color);
}
.map-container iframe { filter: invert(90%) grayscale(80%); width: 100%; height: 100%; }

/* Contact Alerts */
.contact-alert {
    padding: 15px; margin-bottom: 20px; border-radius: 5px;
    font-weight: 500; text-align: center; border: 1px solid transparent;
}
.alert-success { background-color: #d4edda; color: #155724; border-color: #c3e6cb; }
.alert-error { background-color: #f8d7da; color: #721c24; border-color: #f5c6cb; }

/* Responsive Adjustments */
@media (max-width: 768px) {
    .contact-options { flex-direction: column; }
    .contact-details-grid { grid-template-columns: 1fr; }
    .map-container { order: -1; margin-bottom: 30px; }
    .contact-hub { padding: 30px 20px; }
}

/* --- 11. FOOTER --- */
.main-footer {
  background: #010409;
  color: var(--text-secondary);
  padding-top: 60px;
  border-top: 1px solid var(--border-color);
}
.footer-grid {
  display: grid;
  grid-template-columns: 2fr 1fr 1fr;
  gap: 40px;
  padding-bottom: 40px;
}
.footer-about h4,
.footer-links h4,
.footer-contact h4 {
  color: var(--white);
  margin-bottom: 20px;
  font-size: 1.2rem;
}
.footer-links a {
  color: var(--text-secondary);
}
.footer-links a:hover {
  color: var(--accent-cyan);
}
.footer-bottom {
  text-align: center;
  padding: 20px 0;
  border-top: 1px solid var(--border-color);
  font-size: 0.9rem;
}
.footer-social {
  margin-top: 20px;
  display: flex;
  gap: 15px;
}
.footer-social a {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  background-color: var(--border-color);
  color: var(--white);
  text-decoration: none;
  font-size: 1.2rem;
  border-radius: 50%;
  transition: background-color 0.3s ease, transform 0.3s ease;
}
.footer-social a:hover {
  background-color: var(--accent-cyan);
  color: var(--dark-bg);
  transform: translateY(-3px);
}
/* === FOOTER WATERMARK STYLES === */

/* 1. Prepare the main footer container */
.main-footer {
  position: relative; /* This is CRUCIAL for positioning the watermark inside it */
  overflow: hidden; /* Prevents the watermark from spilling out on small screens */
}

/* 2. Style the watermark image itself */
.footer-watermark {
  position: absolute; /* Lifts the image out of the normal document flow */
  bottom: 60px; /* Positions it 10px from the bottom of the footer */
  right: 280px; /* Positions it 20px from the right of the footer */

  max-width: 200px; /* Controls the size of the logo */
  opacity: 0.5; /* THIS CREATES THE FAINT WATERMARK EFFECT. Adjust between 0.03 to 0.1 for desired faintness. */

  pointer-events: none; /* Makes the image un-clickable so it doesn't block links underneath */
  z-index: 0; /* Puts the watermark on the lowest layer */
}

/* 3. Ensure the footer text and links are on top of the watermark */
.footer-grid,
.footer-bottom {
  position: relative; /* Lifts the content into a new stacking context */
  z-index: 1; /* Puts the content on a layer above the watermark */
}
/* --- 12. SCROLL ANIMATIONS --- */
.reveal {
  opacity: 0;
  transform: translateY(50px);
  transition: opacity 0.8s ease-out, transform 0.8s ease-out;
}
.reveal.active {
  opacity: 1;
  transform: translateY(0);
}

/* --- 13. RESPONSIVE DESIGN --- */
html,
body {
  overflow-x: hidden;
}

/* 2. Constrain Carousel Buttons on Mobile and Tablet */
/* This media query targets screens smaller than 1024px */
@media (max-width: 1024px) {
  .carousel-control.prev {
    /* Move the button from -60px (outside) to 10px (inside) */
    left: 10px;
  }
  .carousel-control.next {
    /* Move the button from -60px (outside) to 10px (inside) */
    right: 10px;
  }

  /* Optional: Make buttons semi-transparent on mobile so they don't block content too much */
  .carousel-control {
    background-color: rgba(
      48,
      54,
      61,
      0.7
    ); /* Use var(--border-color) with transparency */
  }
}

/* 3. Refine Existing Media Queries for Better Box Fitting */
/* This is an update to your existing @media blocks */

@media (max-width: 992px) {
  .section-title {
    font-size: 2.2rem;
  }
  .hero-content h1 {
    font-size: 3rem;
  }
  .two-column,
  .contact-grid,
  .footer-grid {
    grid-template-columns: 1fr;
  }
  .about-section .text-content {
    order: 2;
    text-align: center;
  }
  .about-section .image-content {
    order: 1;
  }
  .text-content h2 {
    text-align: center;
  }
  .footer-grid {
    text-align: center;
  }
  .footer-social {
    justify-content: center;
  }
}

@media (max-width: 768px) {
  .content-section {
    padding: 80px 0;
  }

  .nav-menu {
    position: fixed;
    left: -100%;
    top: var(--header-height);
    flex-direction: column;
    background-color: var(--dark-bg);
    width: 100%;
    text-align: center;
    transition: 0.3s;
    height: calc(100vh - var(--header-height));
    padding-top: 40px;
    gap: 25px;
  }
  .nav-menu.active {
    left: 0;
  }

  .hamburger {
    display: block;
  }
  .hamburger.active .bar:nth-child(2) {
    opacity: 0;
  }
  .hamburger.active .bar:nth-child(1) {
    transform: translateY(8px) rotate(45deg);
  }
  .hamburger.active .bar:nth-child(3) {
    transform: translateY(-8px) rotate(-45deg);
  }

  .counter-container {
    grid-template-columns: 1fr 1fr;
    gap: 30px;
  }
  .hero-content h1 {
    font-size: 2.5rem;
  }
  .hero-content .tagline {
    font-size: 1.2rem;
  }
  .btn {
    padding: 12px 28px;
    font-size: 0.9rem;
  }

  /* Ensure carousel buttons are inside the screen */
  .carousel-control.prev {
    left: 10px;
  }
  .carousel-control.next {
    right: 10px;
  }

  /*
     * THE CRUCIAL FIX FOR THE CAPABILITIES BOXES IS HERE:
     * This forces the grids to stack vertically into a single column.
     */
  .grid-layout-3,
  .grid-layout-4 {
    grid-template-columns: 1fr;
  }
}
/* === WATERMARK MEDIA QUERY FOR MOBILE === */

/* This rule applies to screens 768px wide or smaller */
@media (max-width: 768px) {
  .main-footer {
    display: flex;
    flex-direction: column;
    align-items: center;
  }

  /* 2. Target the watermark image specifically on mobile */
  .footer-watermark {
    position: absolute;
    bottom: 60px;
    right: auto;
    max-width: 100px;
    opacity: 0.5;
    pointer-events: none;
    z-index: 0;
  }
}

/* ====================================================== */
/* 2. REDESIGNED ABOUT US SECTION                         */
/* ====================================================== */

#about {
    background-color: var(--dark-bg);
    overflow: hidden;
}

.about-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 60px;
    align-items: center;
    min-height: 60vh;
    --pillar-color: var(--accent-cyan);
}
.about-grid.mission-active { --pillar-color: var(--accent-orange); }
.about-grid.vision-active { --pillar-color: var(--accent-cyan); }


.about-intro {
    color: var(--text-secondary);
    font-size: 1.1rem;
    margin-bottom: 40px;
}

.about-visual {
    width: 100%;
    height: 500px;
    border-radius: var(--border-radius);
    position: relative;
    background: #0d1117;
    border: 1px solid var(--border-color);
    /* Use flexbox to center the content pane inside */
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 40px;
}

#ai-brain-canvas {
    position: absolute;
    top: 0; left: 0;
    width: 100%; height: 100%;
    border-radius: var(--border-radius);
    z-index: 1; /* Sits behind the content */
}

/* Tab styling (no major changes here) */
.pillar-tabs {
    display: flex;
    gap: 15px;
    margin-bottom: 25px;
}
.pillar-tab-item {
    padding: 15px 25px;
    display: flex;
    align-items: center;
    gap: 15px;
    cursor: pointer;
    background: var(--card-bg);
    border-radius: 10px;
    border: 1px solid var(--border-color);
    transition: background-color 0.3s ease, border-color 0.3s ease;
}
.pillar-tab-item:hover {
    background-color: #21262d;
}
.pillar-tab-item.active {
    background-color: #21262d;
    border-color: var(--pillar-color);
}
.pillar-tab-item i {
    font-size: 1.5rem;
    color: var(--pillar-color);
    transition: color 0.3s ease;
}
.pillar-tab-item h3 {
    margin: 0;
    color: var(--text-primary);
    font-size: 1.2rem;
    transition: color 0.3s ease;
}
.pillar-tab-item.active h3 {
    color: var(--white);
}

/* --- NEW STYLES FOR THE OVERLAY CONTENT --- */
.pillar-content-panes {
    position: relative; /* Sits on top of the canvas */
    z-index: 2;
    width: 100%;
    height: 100%;
    
    /* Glassmorphism Effect */
    background: rgba(13, 17, 23, 0.6);
    backdrop-filter: blur(10px);
    border-radius: 10px;
    border: 1px solid rgba(48, 54, 61, 0.5); /* Semi-transparent border */
    
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 30px;
}

.pillar-content-pane {
    position: absolute;
    opacity: 0;
    transform: translateY(10px);
    transition: opacity 0.4s ease-out, transform 0.4s ease-out;
    pointer-events: none;
    text-align: center;
}

.pillar-content-pane.active {
    opacity: 1;
    transform: translateY(0);
    pointer-events: auto;
}

.pillar-content-pane h4 {
    font-size: 1.8rem;
    font-weight: 600;
    color: var(--pillar-color); /* Use the dynamic color */
    margin-bottom: 15px;
    transition: color 0.3s ease;
}
.pillar-content-pane p {
    margin: 0;
    color: var(--text-primary); /* Brighter text for readability on glass */
    line-height: 1.8;
    font-size: 1.1rem;
}

/* Responsive adjustments */
@media(max-width: 992px) {
    .about-grid { grid-template-columns: 1fr; }
    .about-visual { order: -1; height: 350px; padding: 20px; }
    .section-title-left { text-align: center; }
    .section-title-left::after { left: 50%; transform: translateX(-50%); }
    .pillar-tabs { flex-direction: column; }
    .pillar-content-pane h4 { font-size: 1.5rem; }
    .pillar-content-pane p { font-size: 1rem; }
}

/* ====================================================== */
/* 14. AI CHAT ASSISTANT WIDGET (with Bounce Animation)   */
/* ====================================================== */

/* --- NEW ---: Keyframe animation for the icon's bounce */
@keyframes fab-bounce {
  0%,
  20%,
  50%,
  80%,
  100% {
    transform: translateY(0);
  }
  40% {
    transform: translateY(-10px);
  }
  60% {
    transform: translateY(-5px);
  }
}

/* Floating Action Button (FAB) */
#ai-chat-fab {
  position: fixed;
  bottom: 30px;
  right: 30px;
  width: 60px;
  height: 60px;
  background: linear-gradient(45deg, var(--accent-orange), var(--accent-cyan));
  color: var(--white);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.8rem;
  cursor: pointer;
  box-shadow: 0 5px 20px rgba(0, 198, 255, 0.4);
  z-index: 998;
  transition: transform 0.3s ease, box-shadow 0.3s ease;

  /* --- NEW ---: Apply the bouncing animation */
  /* It runs for 2 seconds, then waits 5 seconds before repeating */
  animation: fab-bounce 2s ease-in-out 5s infinite;
}

#ai-chat-fab:hover {
  transform: scale(1.1);
  box-shadow: 0 8px 30px rgba(250, 93, 15, 0.5);
  /* --- NEW ---: Pause the animation on hover for a better user experience */
  animation-play-state: paused;
}

/* Chat Window */
#ai-chat-window {
  position: fixed;
  bottom: 100px;
  right: 30px;
  width: 370px;
  max-width: 90vw;
  height: 500px;
  max-height: 70vh; /* Set a max height relative to viewport */
  background: var(--card-bg);
  border: 1px solid var(--border-color);
  border-radius: var(--border-radius);
  box-shadow: 0 10px 40px rgba(0, 0, 0, 0.5);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  z-index: 999;

  /* Initial state for animation */
  opacity: 0;
  transform: translateY(20px) scale(0.9);
  visibility: hidden;
  transition: opacity 0.3s ease, visibility 0.3s; /* Only transition opacity and visibility */
  transform-origin: bottom right;
}

/* Keyframe animation for the chat window's bounce effect */
@keyframes chat-bounce-in {
  0% {
    opacity: 0;
    transform: translateY(20px) scale(0.9);
  }
  60% {
    opacity: 1;
    transform: translateY(-5px) scale(1.02);
  }
  80% {
    transform: translateY(2px) scale(0.99);
  }
  100% {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

/* Apply the bounce animation when the window opens */
#ai-chat-window.open {
  visibility: visible;
  animation: chat-bounce-in 0.5s cubic-bezier(0.175, 0.885, 0.32, 1.275)
    forwards;
}

/* Chat Header */
.chat-header {
  background: #0d1117; /* Darker bg */
  padding: 15px 20px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  border-bottom: 1px solid var(--border-color);
  flex-shrink: 0; /* Prevents header from shrinking */
}

.chat-header h3 {
  color: var(--white);
  font-size: 1.1rem;
  margin: 0;
}

#close-chat-btn {
  background: none;
  border: none;
  color: var(--text-secondary);
  font-size: 1.8rem;
  line-height: 1;
  cursor: pointer;
  transition: color 0.2s ease;
}
#close-chat-btn:hover {
  color: var(--white);
}

/* Messages Area */
#chat-messages {
  flex-grow: 1;
  padding: 20px;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 15px;
}

/* Scrollbar styling */
#chat-messages::-webkit-scrollbar {
  width: 6px;
}
#chat-messages::-webkit-scrollbar-track {
  background: var(--card-bg);
}
#chat-messages::-webkit-scrollbar-thumb {
  background: var(--border-color);
  border-radius: 3px;
}
#chat-messages::-webkit-scrollbar-thumb:hover {
  background: var(--text-secondary);
}

.chat-message {
  max-width: 80%;
  padding: 12px 18px;
  border-radius: 18px;
  line-height: 1.5;
  word-wrap: break-word;
  opacity: 0;
  transform: translateY(10px);
  animation: message-fade-in 0.4s ease forwards;
}

@keyframes message-fade-in {
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.chat-message.user {
  background: var(--accent-orange);
  color: var(--white);
  border-bottom-right-radius: 4px;
  align-self: flex-end;
}

.chat-message.bot {
  background: #21262d; /* Slightly lighter than card-bg */
  color: var(--text-primary);
  border-bottom-left-radius: 4px;
  align-self: flex-start;
}

.chat-message.bot a {
  font-weight: 600;
  text-decoration: underline;
}

/* Typing Indicator */
.typing-indicator-container {
  padding: 0 20px 10px 20px;
  display: none; /* Hidden by default */
}
.typing-indicator {
  display: flex;
  align-items: center;
  gap: 5px;
}
.typing-indicator span {
  width: 8px;
  height: 8px;
  background: var(--text-secondary);
  border-radius: 50%;
  animation: typing-bubble 1.2s infinite ease-in-out;
}
.typing-indicator span:nth-child(2) {
  animation-delay: 0.2s;
}
.typing-indicator span:nth-child(3) {
  animation-delay: 0.4s;
}

@keyframes typing-bubble {
  0%,
  80%,
  100% {
    transform: scale(0);
  }
  40% {
    transform: scale(1);
  }
}

/* Input Form */
#chat-form {
  display: flex;
  border-top: 1px solid var(--border-color);
  padding: 10px;
  flex-shrink: 0; /* Prevents input form from shrinking */
}

#chat-input {
  flex-grow: 1;
  background: transparent;
  border: none;
  color: var(--text-primary);
  padding: 10px;
  font-size: 1rem;
  font-family: inherit;
}
#chat-input:focus {
  outline: none;
}
#chat-input::placeholder {
  color: var(--text-secondary);
}

#chat-form button {
  background: none;
  border: none;
  color: var(--accent-cyan);
  font-size: 1.2rem;
  padding: 10px 15px;
  cursor: pointer;
  transition: color 0.2s ease;
}
#chat-form button:hover {
  color: var(--white);
}

/* Responsive adjustments for mobile chat window */
@media (max-width: 480px) {
  #ai-chat-window {
    width: 95vw;
    height: 85vh;
    max-height: 700px;

    bottom: 10px;
    left: 50%;
    right: auto; /* Unset the 'right' property from the desktop style */

    /* --- FIX #1 --- */
    /* Set the transform origin to the new centered position for the animation */
    transform-origin: bottom center;

    /* --- FIX #2 --- */
    /* Apply the centering transform to the initial state of the element */
    transform: translateX(-50%) translateY(20px) scale(0.9);

    border-radius: var(--border-radius);
    border: 1px solid var(--border-color);
  }

  /* --- FIX #3 --- */
  /* Redefine the entire animation within the media query. */
  /* This ensures the centering transform (translateX) is present at every step of the animation. */
  @keyframes chat-bounce-in {
    0% {
      opacity: 0;
      transform: translateX(-50%) translateY(20px) scale(0.9);
    }
    60% {
      opacity: 1;
      transform: translateX(-50%) translateY(-5px) scale(1.02);
    }
    80% {
      transform: translateX(-50%) translateY(2px) scale(0.99);
    }
    100% {
      opacity: 1;
      transform: translateX(-50%) translateY(0) scale(1);
    }
  }

  #ai-chat-fab {
    bottom: 20px;
    right: 20px;
    transition: opacity 0.3s ease, transform 0.3s ease, box-shadow 0.3s ease;
  }

  #ai-chat-window.open + #ai-chat-fab {
    opacity: 0;
    transform: scale(0.5);
    pointer-events: none;
  }
}