/* ================= GLOBAL & DARK MODE ================= */
body.dark-mode {
  background: linear-gradient(135deg, #0f0f1a, #1a1a2e);
  color: #e5e7eb;
}

/* ================= THE "OVERLAP KILLER" SECTION ================= */
.skills-section {
  display: block !important;    /* Force it to be a block */
  clear: both !important;      /* Force it to stay BELOW certificates */
  position: relative !important;
  text-align: center;
  margin: 20px 0 20px;

  overflow: hidden;            /* Keep the infinite scroll contained */
  width: 100%;
   margin-bottom: 0 !important;
  padding-bottom: 40px; /* controlled spacing */
}

.skills-title {
  font-size: 3rem;
  font-weight: 800;
  margin-bottom: 50px;
  color: #c084fc;
  text-shadow: 0 0 14px rgba(192, 132, 252, 0.6);
  position: relative;
}

/* ================= MARQUEE ENGINE ================= */
.skills-marquee {
  position: relative;
  width: 100%;
  overflow: hidden;
  margin-bottom: 40px;
  padding: 10px 0;
  /* Premium fade effect for the edges */
  mask-image: linear-gradient(to right, transparent, black 15%, black 85%, transparent);
  -webkit-mask-image: linear-gradient(to right, transparent, black 15%, black 85%, transparent);
}

.skills-track {
  display: flex !important;
  flex-direction: row !important;
  flex-wrap: nowrap !important; /* Forces icons to stay in one single line */
  width: max-content;
  gap: 40px;
  animation: scroll-left 25s linear infinite;
  will-change: transform;
}

.skills-track.reverse {
  animation: scroll-right 25s linear infinite;
}

.skills-marquee:hover .skills-track {
  animation-play-state: paused;
}

/* ================= SKILL CARDS ================= */
.skill {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
  min-width: 140px;
  padding: 20px;
  border-radius: 12px;
  background: #12122b;
  border: 2px solid rgba(192, 132, 252, 0.35);
  transition: all 0.3s ease;
  flex-shrink: 0; /* Prevents cards from squishing */
}

.skill i {
  font-size: 2.5rem;
  color: #c084fc;
  transition: transform 0.3s ease;
}

.skill span {
  font-size: 1rem;
  color: #e9d5ff;
}

.skill:hover {
  border-color: #c084fc;
  box-shadow: 0 0 20px rgba(192, 132, 252, 0.4);
  transform: scale(1.05);
}

/* ================= KEYFRAMES ================= */
@keyframes scroll-left {
  0% { transform: translateX(0); }
  100% { transform: translateX(-50%); }
}

@keyframes scroll-right {
  0% { transform: translateX(-50%); }
  100% { transform: translateX(0); }
}

/* ================= MOBILE VIEW (RESPONSIVE) ================= */
@media (max-width: 768px) {
  .skills-section {
    padding: 60px 15px;
    margin-top: 20px;
    /* Ensure no certificate "floating" element covers this */
    z-index: 99; 
  }

  .skills-title {
    font-size: 2.2rem;
    margin-bottom: 30px;
  }

  .skills-track {
    gap: 20px;
    /* Slow down for better mobile reading */
    animation-duration: 35s; 
  }

  .skill {
    min-width: 110px;
    padding: 15px;
  }

  .skill i {
    font-size: 1.8rem;
  }
}

@media (max-width: 480px) {
  .skills-section {
    padding: 40px 10px;
  }

  .skills-track {
    gap: 15px;
  }

  .skill {
    min-width: 95px;
    padding: 12px;
  }
}
/* ================= MOBILE FIX FOR CERTIFICATES ================= */
@media (max-width: 768px) {

  #certificates {
    position: relative;
    z-index: 1;
  }

  .carousel-container {
    height: auto !important;
    perspective: none !important;
    overflow: visible !important;
    padding-bottom: 60px;
  }

  .carousel {
    position: static !important;
    transform: none !important;
    height: auto !important;

    display: flex;
    flex-direction: column;
    gap: 20px;
    align-items: center;
  }

  .cert-card {
    position: relative !important;
    transform: none !important;
    opacity: 1 !important;

    width: min(92vw, 420px);
    height: auto;
  }

  /* Hide arrows on mobile */
  
}
