/* =====================================================
   GLOBAL RESET
   ===================================================== */

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
  font-family: 'Poppins', sans-serif;
}

/* Disable scroll when dragging robot */
body.no-scroll {
  overflow: hidden;
  overscroll-behavior: none; /* disables pull-to-refresh */
  touch-action: none;
}

body {
  background: #0f172a;
  color: #e5e7eb;
  overflow-x: hidden;
}

a {
  text-decoration: none;
  color: inherit;
}

a,
p,
h3 {
  color: white;
}

/* =====================================================
   NAVBAR
   ===================================================== */

.navbar {
  position: sticky;
  top: 0;
  z-index: 1000;

  display: flex;
  justify-content: space-between;
  align-items: center;

  padding: 15px 60px;
  background: rgba(15, 23, 42, 0.9);
  backdrop-filter: blur(10px);
}

nav img {
  border-radius: 50%;
}

nav ul {
  display: flex;
  gap: 30px;
  list-style: none;
}

nav ul li {
  cursor: pointer;
  position: relative;
}

nav ul li::after {
  content: '';
  position: absolute;
  left: 0;
  bottom: -6px;

  width: 0;
  height: 2px;
  background: #38bdf8;
  transition: 0.3s;
}

nav ul li:hover::after {
  width: 100%;
}

.nav-item a,
.nav-item a:hover {
  color: white;
}

/* =====================================================
   HERO SECTION
   ===================================================== */

.hero {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: space-around;

  padding-top: 100px;
  padding-left: 60px;
  padding-right: 60px;

  gap: 40px;
}

.hero-text {
  max-width: 600px;
  animation: fadeInLeft 1.2s ease;
}

.hero-text h1 {
  font-size: 3.5rem;
  color: #38bdf8;
}

.hero-text p {
  margin: 20px 0;
  font-size: 1.1rem;
  color: #cbd5f5;
}

/* Button */

.btn {
  display: inline-block;
  padding: 12px 30px;
  border-radius: 30px;

  background: #0f172a;
  border: 1px solid rgba(255, 255, 255, 0.15);

  color: #fff;
  transition: 0.3s;
}

.btn:hover {
  transform: scale(1.08);
}

/* =====================================================
   HERO VIDEO
   ===================================================== */

.hero-video {
  position: relative;
  width: 100%;
  max-width: 720px;

  aspect-ratio: 16 / 9;
  border-radius: 24px;
  overflow: hidden;

  box-shadow: 0 0 40px rgba(56, 189, 248, 0.45);
}

.hero-video video {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  pointer-events: none;
}

/* =====================================================
   SERVICES / SECTIONS
   ===================================================== */

section:not(.hero) {
  padding: 100px 60px;
}

h2 {
  text-align: center;
  font-size: 2.8rem;
  color: #38bdf8;
  margin-bottom: 60px;
}

/* =====================================================
   CARDS
   ===================================================== */

.cards {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 30px;
}

.card {
  background: rgba(30, 41, 59, 0.7);
  padding: 30px;
  border-radius: 20px;
  text-align: center;
  transition: 0.4s;
}

.card:hover {
  transform: translateY(-15px);
  box-shadow: 0 0 35px rgba(56, 189, 248, 0.4);
}

.card img {
  width: 70px;
  margin-bottom: 20px;
}

/* =====================================================
   CAROUSEL
   ===================================================== */

.carousel-container {
  position: relative;
  min-height: 420px;
  width: 100%;
  overflow: hidden;
  padding: 0;
}

.carousel-wrapper {
  overflow: hidden;
  position: relative;
  cursor: grab;
  touch-action: pan-y;
}

.carousel-wrapper,
.carousel-wrapper * {
  user-select: none;
  -webkit-user-drag: none;
}

.carousel-wrapper:active {
  cursor: grabbing;
}

/* ❌ NO GAP */
.carousel-track {
  display: flex;
  will-change: transform;
  transition: transform 0.45s linear;
}

/* =====================================================
   PROJECT CARD
   ===================================================== */

.project-card {
  flex: 0 0 33.3333%;
  max-width: 33.3333%;

  display: flex;
  flex-direction: column;
  justify-content: space-between;

  min-height: 420px;

  background: rgba(30, 41, 59, 0.7);
  padding: 30px;
  border-radius: 20px;

  /* ✅ spacing moved HERE */
  margin: 0 10px;
}


.project-card h3 {
  margin-bottom: 10px;
}

.project-card p {
  flex-grow: 1;
  font-size: 14px;
  color: #cbd5f5;
}

/* =====================================================
   PROJECT IMAGES
   ===================================================== */

.project-images {
  display: flex;
  gap: 12px;
  margin-top: 16px;
}

.img-box {
  flex: 1;
  aspect-ratio: 9 / 19.5;
  background: #020617;
  border-radius: 14px;
  overflow: hidden;

  display: flex;
  align-items: center;
  justify-content: center;
}

.img-box img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  border-radius: 12px;
}

/* =====================================================
   CAROUSEL BUTTONS
   ===================================================== */

.carousel-btn {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);

  background: rgba(56, 189, 248, 0.8);
  color: white;
  border: none;

  padding: 10px 16px;
  border-radius: 50%;
  font-size: 24px;
  cursor: pointer;

  z-index: 10;
}

.left-btn {
  left: 10px;
}

.right-btn {
  right: 10px;
}
/* ================= TEAM SECTION ================= */
.team-section {
  padding: 80px 20px;
  text-align: center;
}

.team-section h2 {
  margin-bottom: 40px;
  color: #38bdf8; /* Ensures heading color matches theme */
}

/* IMPROVED GRID SYSTEM */
.team-grid {
  display: grid;
  /* Auto-fit makes it responsive. Min-width 220px prevents squishing. */
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); 
  gap: 30px;
  max-width: 1100px;
  margin: 0 auto;
  justify-content: center; /* Keeps cards centered */
}

/* IMPROVED CARD */
.team-card {
  background: #1e293b; /* Slightly lighter than bg for contrast */
  border-radius: 20px;
  padding: 30px 20px;
  box-shadow: 0 10px 25px rgba(0,0,0,0.25);
  
  display: flex;
  flex-direction: column;
  align-items: center;
  
  transition: transform 0.3s ease, box-shadow 0.3s ease;
  
  /* REMOVED fixed max-width: 200px so cards can fill the grid naturally */
  width: 100%; 
}

.team-card:hover {
  transform: translateY(-10px);
  box-shadow: 0 20px 40px rgba(56, 189, 248, 0.2); /* Added blue glow on hover */
}

/* FIXED IMAGE SIZE */
.team-card img {
  width: 120px;       /* Sets a perfect fixed size */
  height: 120px;      /* Ensures it is a perfect square */
  border-radius: 50%; /* Makes it a circle */
  object-fit: cover;  /* Prevents stretching */
  border: 3px solid #38bdf8; /* Adds a professional border */
  margin-bottom: 15px;
}

.team-card h3 {
  margin-bottom: 5px;
  font-size: 1.2rem;
  color: #fff;
}

.team-card p {
  font-size: 0.95rem;
  color: #94a3b8;
}

/* MOBILE ADJUSTMENTS */
@media (max-width: 768px) {
  .team-grid {
    grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
    gap: 20px;
  }
  
  .team-card {
    padding: 20px 15px;
  }
  
  .team-card img {
    width: 90px;  /* Slightly smaller images on mobile */
    height: 90px;
  }
}

/* =====================================================
   CONTACT
   ===================================================== */

.contact-box {
  max-width: 600px;
  margin: auto;
  background: rgba(0, 98, 255, 0.7);
  padding: 40px;
  border-radius: 20px;
}

.contact-box input,
.contact-box textarea {
  width: 100%;
  padding: 12px;
  margin-bottom: 15px;
  border: none;
  border-radius: 10px;
  outline: none;
}

.contact-box button {
  width: 100%;
  padding: 12px;
  border: none;
  border-radius: 30px;
  color: white;
  cursor: pointer;
  font-size: 1rem;
}

/* =====================================================
   FOOTER
   ===================================================== */

footer {
  background: #020617;
  text-align: center;
  padding: 30px;
  color: #94a3b8;
}

/* =====================================================
   ROBOT
   ===================================================== */

#robot-container {
  position: fixed;
  right: 20px;
  bottom: 80px;

  width: 160px;
  height: 160px;

  z-index: 9999;
  pointer-events: auto;
}

#robot-container:active {
  cursor: grabbing;
}

#robot {
  width: 100%;
  height: 100%;
  pointer-events: auto;
  cursor: grab;
  animation: robotFloat 3s ease-in-out infinite;
}

/* ================= ROBOT BUBBLE ================= */
#robot-bubble {
  position: absolute;
  bottom: 170px;
  right: 0;
  background: #ffffff;
  color: #000;
  padding: 8px 14px;
  border-radius: 14px;
  font-size: 13px;
  font-weight: 600;
  pointer-events: none;
}

.face-left { scale: -1 1; }
.face-right { scale: 1 1; }

/* =====================================================
   ANIMATIONS (UNCHANGED)
   ===================================================== */

@keyframes robotFloat {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-12px); }
}

@keyframes bubblePop {
  0%, 100% { transform: scale(1); opacity: 1; }
  50% { transform: scale(1.08); opacity: 0.9; }
}

@keyframes wave {
  0% { transform: rotate(0deg); }
  25% { transform: rotate(6deg); }
  50% { transform: rotate(0deg); }
  75% { transform: rotate(-6deg); }
}

@keyframes blink {
  0%, 50%, 100% { opacity: 1; }
  25%, 75% { opacity: 0; }
}

@keyframes fadeInLeft {
  from { opacity: 0; transform: translateX(-50px); }
  to { opacity: 1; }
}

@keyframes float {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-15px); }
}

/* =====================================================
   MOBILE
   ===================================================== */

/* =====================================================
   MOBILE FIX (STABLE & JS-SAFE)
   ===================================================== */

@media (max-width: 768px) {

  .carousel-container {
    min-height: 560px;
    padding: 0;
  }

  .carousel-wrapper {
    overflow: hidden;
    touch-action: pan-y;
  }

  .carousel-track {
    transition: transform 0.35s linear;
  }

  /* ✅ EXACTLY ONE CARD */
  .project-card {
    flex: 0 0 100%;
    max-width: 100%;
    min-height: 520px;

    margin: 0 16px; /* symmetric spacing */
  }

  .carousel-btn {
    display: none !important;
  }

  section:not(.hero) {
    padding: 70px 20px;
  }

  #robot-container {
    width: 150px;
    height: 150px;
  }

  .hero-video {
    border-radius: 18px;
  }
}


/* =====================================================
   ALERT
   ===================================================== */

.alert-box {
  position: fixed;
  top: 30px;
  right: -400px;

  background: rgba(15, 23, 42, 0.9);
  backdrop-filter: blur(12px);

  color: #fff;
  padding: 16px 22px;
  border-radius: 14px;
  font-weight: 600;

  box-shadow: 0 0 30px rgba(56, 189, 248, 0.4);
  transition: all 0.5s ease;
  z-index: 99999;
}

.alert-box.show {
  right: 30px;
}

.alert-success {
  border-left: 5px solid #22c55e;
}

.alert-error {
  border-left: 5px solid #ef4444;
}

/* =====================================================
   GLASS FORM
   ===================================================== */

.glass-form {
  background: rgba(255, 255, 255, 0.08);
  backdrop-filter: blur(16px);
  border-radius: 20px;
  border: 1px solid rgba(255, 255, 255, 0.15);
}

.glass-form input,
.glass-form textarea {
  background: rgba(15, 23, 42, 0.85);
  color: #fff;
  border: none;
}

.glass-form input::placeholder,
.glass-form textarea::placeholder {
  color: #94a3b8;
}


/* ================= DESKTOP ONLY FIXES ================= */
@media (min-width: 769px) {

  /* Prevent text & image selection ONLY on desktop carousel */
  .carousel-wrapper,
  .carousel-wrapper * {
    user-select: none;
    -webkit-user-drag: none;
  }

  /* Fix right-most card cutoff on desktop */
  .carousel-container {
    padding: 0; /* remove outer padding */
  }
  
  .carousel-wrapper:active {
    cursor: grabbing;
  }

  .carousel-wrapper {
    padding: 0 50px; /* desktop spacing */
    cursor: grab;
    overflow: hidden;
  }
}
