/* ========================================
   SKILLS — Optimized Cosmic Orbital System
   ======================================== */

/* Main Universe Container */
.skills-universe {
  position: relative;
  width: 100%;  
  min-height: 500px;
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 70px;
  flex-wrap: wrap;
  padding: 20px 20px 60px;
  overflow: visible;
}

/* Skill Orbit Container */
.skill-orbit {
  position: relative;
  width: 320px;
  height: 320px;
  display: flex;
  justify-content: center;
  align-items: center;
  will-change: transform;
  animation: orbitFloat 8s ease-in-out infinite;
}

.skill-orbit:nth-child(1) { animation-delay: 0s; }
.skill-orbit:nth-child(2) { animation-delay: 2.5s; }
.skill-orbit:nth-child(3) { animation-delay: 5s; }

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

/* Orbit Ring - Dual Rotating Circles for Depth */
.orbit-ring {
  position: absolute;
  width: 100%;
  height: 100%;
  border-radius: 50%;
  will-change: transform;
}

.orbit-ring::before,
.orbit-ring::after {
  content: '';
  position: absolute;
  inset: 0;
  border-radius: 50%;
  border: 2px solid transparent;
}

/* Outer ring */
.orbit-ring::before {
  border-color: rgba(138, 43, 226, 0.3);
  box-shadow: 0 0 20px rgba(138, 43, 226, 0.15);
  animation: rotateOrbit 24s linear infinite;
}

/* Inner ring - counter rotation */
.orbit-ring::after {
  inset: 15%;
  border-color: rgba(138, 43, 226, 0.2);
  animation: rotateOrbit 18s linear infinite reverse;
}

/* Different colors for each orbit */
.orbit-1 .orbit-ring::before {
  border-color: rgba(138, 43, 226, 0.4);
  box-shadow: 0 0 25px rgba(138, 43, 226, 0.2);
}

.orbit-1 .orbit-ring::after {
  border-color: rgba(138, 43, 226, 0.25);
}

.orbit-2 .orbit-ring::before {
  border-color: rgba(75, 0, 130, 0.4);
  box-shadow: 0 0 25px rgba(75, 0, 130, 0.2);
  animation-duration: 28s;
}

.orbit-2 .orbit-ring::after {
  border-color: rgba(75, 0, 130, 0.25);
  animation-duration: 22s;
}

.orbit-3 .orbit-ring::before {
  border-color: rgba(123, 104, 238, 0.4);
  box-shadow: 0 0 25px rgba(123, 104, 238, 0.2);
  animation-duration: 32s;
}

.orbit-3 .orbit-ring::after {
  border-color: rgba(123, 104, 238, 0.25);
  animation-duration: 26s;
}

@keyframes rotateOrbit {
  from { transform: rotate(0deg); }
  to { transform: rotate(360deg); }
}

/* Center Icon of Each Orbit */
.orbit-center {
  position: relative;
  width: 75px;
  height: 75px;
  display: flex;
  justify-content: center;
  align-items: center;
  background: linear-gradient(135deg, rgba(138, 43, 226, 0.2), rgba(75, 0, 130, 0.15));
  border: 2px solid rgba(138, 43, 226, 0.5);
  border-radius: 50%;
  box-shadow: 0 0 35px rgba(138, 43, 226, 0.4);
  z-index: 10;
}

.orbit-2 .orbit-center {
  background: linear-gradient(135deg, rgba(75, 0, 130, 0.2), rgba(138, 43, 226, 0.15));
  border-color: rgba(75, 0, 130, 0.5);
  box-shadow: 0 0 35px rgba(75, 0, 130, 0.4);
}

.orbit-3 .orbit-center {
  background: linear-gradient(135deg, rgba(123, 104, 238, 0.2), rgba(138, 43, 226, 0.15));
  border-color: rgba(123, 104, 238, 0.5);
  box-shadow: 0 0 35px rgba(123, 104, 238, 0.4);
}

.orbit-center i {
  font-size: 30px;
  color: rgba(255, 255, 255, 0.95);
  filter: drop-shadow(0 0 12px rgba(138, 43, 226, 0.9));
  will-change: transform;
  animation: iconPulse 4s ease-in-out infinite;
}

.center-glow {
  position: absolute;
  inset: -25px;
  background: radial-gradient(circle, rgba(138, 43, 226, 0.25), transparent 70%);
  border-radius: 50%;
  will-change: transform, opacity;
  animation: glowPulse 4s ease-in-out infinite;
  pointer-events: none;
}

.orbit-2 .center-glow {
  background: radial-gradient(circle, rgba(75, 0, 130, 0.25), transparent 70%);
}

.orbit-3 .center-glow {
  background: radial-gradient(circle, rgba(123, 104, 238, 0.25), transparent 70%);
}

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

@keyframes glowPulse {
  0%, 100% { opacity: 0.6; transform: scale(1); }
  50% { opacity: 1; transform: scale(1.15); }
}

/* Skill Stars Positioned on Orbit */
.skill-star {
  position: absolute;
  width: 70px;
  height: 70px;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  cursor: pointer;
  will-change: transform;
  transition: transform 0.35s cubic-bezier(0.34, 1.56, 0.64, 1);
  z-index: 5;
}

/* Position stars around the orbit (4 cardinal points) */
.skill-star.star-1 { top: -35px; left: 50%; transform: translateX(-50%); }
.skill-star.star-2 { right: -35px; top: 50%; transform: translateY(-50%); }
.skill-star.star-3 { bottom: -35px; left: 50%; transform: translateX(-50%); }
.skill-star.star-4 { left: -35px; top: 50%; transform: translateY(-50%); }

/* Star Core - The glowing orb with stagger animations */
.star-core {
  position: relative;
  width: 24px;
  height: 24px;
  background: linear-gradient(135deg, #fff 0%, rgba(138, 43, 226, 0.9) 100%);
  border-radius: 50%;
  box-shadow: 
    0 0 20px rgba(138, 43, 226, 0.9),
    0 0 35px rgba(138, 43, 226, 0.6);
  will-change: transform, opacity;
  animation: starTwinkle 4s ease-in-out infinite;
  transition: all 0.3s ease;
}

/* Star particles - sparkle effect */
.star-core::before,
.star-core::after {
  content: '';
  position: absolute;
  width: 3px;
  height: 3px;
  background: rgba(255, 255, 255, 0.9);
  border-radius: 50%;
  box-shadow: 0 0 6px rgba(138, 43, 226, 0.8);
}

.star-core::before {
  top: -6px;
  right: -6px;
  animation: particleFloat 3s ease-in-out infinite;
}

.star-core::after {
  bottom: -6px;
  left: -6px;
  animation: particleFloat 3s ease-in-out infinite 1.5s;
}

@keyframes particleFloat {
  0%, 100% { transform: translate(0, 0) scale(1); opacity: 0.7; }
  50% { transform: translate(2px, -2px) scale(1.2); opacity: 1; }
}

/* Stagger twinkle timing for each star */
.star-1 .star-core { animation-delay: 0s; }
.star-2 .star-core { animation-delay: 1s; }
.star-3 .star-core { animation-delay: 2s; }
.star-4 .star-core { animation-delay: 3s; }

.orbit-2 .star-core {
  background: linear-gradient(135deg, #fff 0%, rgba(75, 0, 130, 0.9) 100%);
  box-shadow: 
    0 0 20px rgba(75, 0, 130, 0.9),
    0 0 35px rgba(75, 0, 130, 0.6);
}

.orbit-3 .star-core {
  background: linear-gradient(135deg, #fff 0%, rgba(123, 104, 238, 0.9) 100%);
  box-shadow: 
    0 0 20px rgba(123, 104, 238, 0.9),
    0 0 35px rgba(123, 104, 238, 0.6);
}

@keyframes starTwinkle {
  0%, 100% { opacity: 1; transform: scale(1); }
  50% { opacity: 0.75; transform: scale(0.92); }
}

/* Star Glow - Subtle expanding aura */
.star-glow {
  position: absolute;
  width: 50px;
  height: 50px;
  background: radial-gradient(circle, rgba(138, 43, 226, 0.35), transparent 70%);
  border-radius: 50%;
  will-change: transform, opacity;
  animation: glowExpand 4s ease-in-out infinite;
  pointer-events: none;
}

.star-1 .star-glow { animation-delay: 0s; }
.star-2 .star-glow { animation-delay: 1s; }
.star-3 .star-glow { animation-delay: 2s; }
.star-4 .star-glow { animation-delay: 3s; }

.orbit-2 .star-glow {
  background: radial-gradient(circle, rgba(75, 0, 130, 0.35), transparent 70%);
}

.orbit-3 .star-glow {
  background: radial-gradient(circle, rgba(123, 104, 238, 0.35), transparent 70%);
}

@keyframes glowExpand {
  0%, 100% { transform: scale(1); opacity: 0.6; }
  50% { transform: scale(1.4); opacity: 0.3; }
}

/* Skill Labels - Polished Card Style with Glow */
.skill-label {
  position: absolute;
  top: 75px;
  white-space: nowrap;
  font-size: 13px;
  font-weight: 600;
  letter-spacing: 0.8px;
  color: rgba(255, 255, 255, 0.95);
  text-shadow: 0 2px 10px rgba(0, 0, 0, 0.8);
  opacity: 0;
  transform: translateY(-10px);
  transition: all 0.35s cubic-bezier(0.34, 1.56, 0.64, 1);
  pointer-events: none;
  background: linear-gradient(135deg, rgba(20, 20, 40, 0.98), rgba(30, 20, 50, 0.98));
  padding: 7px 14px;
  border-radius: 8px;
  border: 1px solid rgba(138, 43, 226, 0.5);
  box-shadow: 0 4px 25px rgba(0, 0, 0, 0.6), 0 0 15px rgba(138, 43, 226, 0.3);
}

.orbit-2 .skill-label {
  border-color: rgba(75, 0, 130, 0.5);
  box-shadow: 0 4px 25px rgba(0, 0, 0, 0.6), 0 0 15px rgba(75, 0, 130, 0.3);
}

.orbit-3 .skill-label {
  border-color: rgba(123, 104, 238, 0.5);
  box-shadow: 0 4px 25px rgba(0, 0, 0, 0.6), 0 0 15px rgba(123, 104, 238, 0.3);
}

.skill-level {
  position: absolute;
  top: 108px;
  font-size: 12px;
  font-weight: 700;
  color: rgba(138, 43, 226, 1);
  text-shadow: 0 0 15px rgba(138, 43, 226, 1);
  opacity: 0;
  transform: translateY(-10px);
  transition: all 0.35s cubic-bezier(0.34, 1.56, 0.64, 1) 0.08s;
  pointer-events: none;
  letter-spacing: 1px;
}

.orbit-2 .skill-level {
  color: rgba(75, 0, 130, 1);
  text-shadow: 0 0 15px rgba(75, 0, 130, 1);
}

.orbit-3 .skill-level {
  color: rgba(123, 104, 238, 1);
  text-shadow: 0 0 15px rgba(123, 104, 238, 1);
}

/* Hover Effects - Smooth and Performant */
.skill-star:hover {
  transform: scale(1.35);
  z-index: 20;
}

.skill-star.star-1:hover { transform: translateX(-50%) scale(1.35); }
.skill-star.star-2:hover { transform: translateY(-50%) scale(1.35); }
.skill-star.star-3:hover { transform: translateX(-50%) scale(1.35); }
.skill-star.star-4:hover { transform: translateY(-50%) scale(1.35); }

.skill-star:hover .star-core {
  width: 34px;
  height: 34px;
  box-shadow: 
    0 0 35px rgba(138, 43, 226, 1),
    0 0 70px rgba(138, 43, 226, 0.8);
  animation: none;
}

.orbit-2 .skill-star:hover .star-core {
  box-shadow: 
    0 0 35px rgba(75, 0, 130, 1),
    0 0 70px rgba(75, 0, 130, 0.8);
}

.orbit-3 .skill-star:hover .star-core {
  box-shadow: 
    0 0 35px rgba(123, 104, 238, 1),
    0 0 70px rgba(123, 104, 238, 0.8);
}

.skill-star:hover .star-glow {
  width: 90px;
  height: 90px;
  opacity: 0.8;
  animation: none;
}

.skill-star:hover .skill-label,
.skill-star:hover .skill-level {
  opacity: 1;
  transform: translateY(0);
}

/* Responsive Design */
@media (max-width: 1200px) {
  .skills-universe {
    gap: 60px;
    min-height: 600px;
  }
  
  .skill-orbit {
    width: 300px;
    height: 300px;
  }
  
  .orbit-center {
    width: 70px;
    height: 70px;
  }
  
  .orbit-center i {
    font-size: 28px;
  }
}

@media (max-width: 768px) {
  .skills-universe {
    flex-direction: column;
    min-height: auto;
    gap: 100px;
    padding: 20px 20px 40px;
  }
  
  .skill-orbit {
    width: 280px;
    height: 280px;
  }
  
  .orbit-center {
    width: 65px;
    height: 65px;
  }
  
  .orbit-center i {
    font-size: 26px;
  }
  
  .skill-star {
    width: 60px;
    height: 60px;
  }
  
  .star-core {
    width: 20px;
    height: 20px;
  }
  
  .skill-label {
    font-size: 12px;
    top: 65px;
  }
  
  .skill-level {
    font-size: 11px;
    top: 95px;
  }
}

@media (max-width: 480px) {
  .skills-universe {
    gap: 80px;
    padding: 10px 20px 40px;
  }
  
  .skill-orbit {
    width: 250px;
    height: 250px;
  }
  
  .orbit-center {
    width: 60px;
    height: 60px;
  }
  
  .orbit-center i {
    font-size: 24px;
  }
  
  .skill-star {
    width: 55px;
    height: 55px;
  }
  
  .star-core {
    width: 18px;
    height: 18px;
  }
  
  .skill-label {
    font-size: 11px;
    padding: 6px 10px;
    top: 60px;
  }
  
  .skill-level {
    font-size: 10px;
    top: 88px;
  }
}

/* Performance Optimization: Reduced Motion */
@media (prefers-reduced-motion: reduce) {
  * {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
  
  .skill-star:hover {
    transform: scale(1.15);
  }
  
  .skill-star.star-1:hover { transform: translateX(-50%) scale(1.15); }
  .skill-star.star-2:hover { transform: translateY(-50%) scale(1.15); }
  .skill-star.star-3:hover { transform: translateX(-50%) scale(1.15); }
  .skill-star.star-4:hover { transform: translateY(-50%) scale(1.15); }
}
