/* Advanced UI Styling for Portfolio */

/* Skills Slideshow */
.skills-slideshow {
  position: relative;
  margin: 0 auto;
  max-width: 900px;
  overflow: hidden;
}

.slideshow-container {
  position: relative;
  height: 300px;
}

.skill-slide {
  position: absolute;
  opacity: 0;
  width: 100%;
  height: 100%;
  transform: translateX(50px);
  transition: opacity 1s cubic-bezier(0.19, 1, 0.22, 1),
    transform 1s cubic-bezier(0.19, 1, 0.22, 1);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  pointer-events: none;
  will-change: transform, opacity; /* Performance optimization */
}

.skill-slide.active {
  opacity: 1;
  transform: translateX(0);
  z-index: 2;
  pointer-events: all;
}

.skill-slide h3 {
  text-align: center;
  margin-bottom: 30px;
  font-size: 2rem;
  background: linear-gradient(120deg, var(--primary), var(--accent));
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
}

.skill-icons {
  display: flex;
  justify-content: center;
  flex-wrap: wrap;
  gap: 30px;
}

.skill-icon {
  display: flex;
  flex-direction: column;
  align-items: center;
  opacity: 0;
  transform: translateY(20px);
  animation: fadeInUp 0.6s forwards;
  animation-delay: calc(var(--i, 0) * 0.1s + 0.3s);
}

.skill-slide.active .skill-icon:nth-child(1) {
  --i: 0;
}
.skill-slide.active .skill-icon:nth-child(2) {
  --i: 1;
}
.skill-slide.active .skill-icon:nth-child(3) {
  --i: 2;
}

.skill-icon .icon {
  font-size: 3rem;
  margin-bottom: 10px;
  filter: drop-shadow(0 0 10px rgba(125, 249, 255, 0.4));
  transition: transform 0.3s ease, filter 0.3s ease;
}

.skill-icon:hover .icon {
  transform: scale(1.1);
  filter: drop-shadow(0 0 15px rgba(125, 249, 255, 0.7));
}

.skill-icon .icon i {
  font-size: 3rem;
  background: linear-gradient(120deg, var(--primary), var(--accent));
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
}

.skill-icon .label {
  font-size: 0.9rem;
  color: var(--text-color);
}

.slideshow-nav {
  display: flex;
  justify-content: center;
  margin-top: 30px;
  gap: 12px;
}

.slide-btn {
  width: 14px;
  height: 14px;
  border-radius: 50%;
  background-color: rgba(125, 249, 255, 0.2);
  border: 1px solid rgba(125, 249, 255, 0.1);
  cursor: pointer;
  transition: all 0.3s ease;
  position: relative;
  margin: 0 5px;
}

.slide-btn:hover {
  background-color: rgba(125, 249, 255, 0.5);
  transform: scale(1.1);
}

.slide-btn.active {
  background-color: var(--primary);
  transform: scale(1.3);
}

.slide-btn.active::after {
  content: '';
  position: absolute;
  inset: -5px;
  border-radius: 50%;
  border: 1px solid var(--primary);
  animation: pulse 2s infinite;
}

.slide-btn.active::before {
  content: '';
  position: absolute;
  inset: 0;
  border-radius: 50%;
  background: var(--primary);
  animation: progress 5s linear infinite; /* Matches the slide duration */
}

.slide-btn.transitioning {
  animation: blink 0.3s ease;
}

@keyframes blink {
  0%,
  100% {
    transform: scale(1.3);
  }
  50% {
    transform: scale(1.5);
  }
}

@keyframes progress {
  0% {
    clip-path: polygon(50% 50%, 50% 0%, 50% 0%, 50% 0%, 50% 0%, 50% 0%);
  }
  12.5% {
    clip-path: polygon(50% 50%, 50% 0%, 100% 0%, 100% 0%, 100% 0%, 100% 0%);
  }
  25% {
    clip-path: polygon(50% 50%, 50% 0%, 100% 0%, 100% 50%, 100% 50%, 100% 50%);
  }
  37.5% {
    clip-path: polygon(
      50% 50%,
      50% 0%,
      100% 0%,
      100% 50%,
      100% 100%,
      100% 100%
    );
  }
  50% {
    clip-path: polygon(50% 50%, 50% 0%, 100% 0%, 100% 50%, 100% 100%, 50% 100%);
  }
  62.5% {
    clip-path: polygon(
      50% 50%,
      50% 0%,
      100% 0%,
      100% 50%,
      100% 100%,
      50% 100%,
      0% 100%,
      0% 100%
    );
  }
  75% {
    clip-path: polygon(
      50% 50%,
      50% 0%,
      100% 0%,
      100% 50%,
      100% 100%,
      50% 100%,
      0% 100%,
      0% 50%
    );
  }
  87.5% {
    clip-path: polygon(
      50% 50%,
      50% 0%,
      100% 0%,
      100% 50%,
      100% 100%,
      50% 100%,
      0% 100%,
      0% 50%,
      0% 0%
    );
  }
  100% {
    clip-path: polygon(
      50% 50%,
      50% 0%,
      100% 0%,
      100% 50%,
      100% 100%,
      50% 100%,
      0% 100%,
      0% 50%,
      0% 0%,
      50% 0%
    );
  }
}

/* Project Card Styling */
.projects-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(350px, 1fr));
  gap: 30px;
  margin-top: 40px;
}

.project-card {
  background: rgba(26, 26, 46, 0.5);
  border-radius: var(--radius-lg);
  overflow: hidden;
  box-shadow: 0 5px 15px rgba(0, 0, 0, 0.2);
  transition: transform 0.3s ease, box-shadow 0.3s ease;
  -webkit-backdrop-filter: blur(5px);
  backdrop-filter: blur(5px);
  border: 1px solid rgba(125, 249, 255, 0.1);
}

.project-card:hover {
  transform: translateY(-5px);
  box-shadow: 0 15px 30px rgba(0, 0, 0, 0.3), 0 0 20px rgba(125, 249, 255, 0.2);
}

.project-image {
  position: relative;
  width: 100%;
  height: 200px;
  overflow: hidden;
}

.project-image img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.5s ease;
}

.project-card:hover .project-image img {
  transform: scale(1.05);
}

.project-overlay {
  position: absolute;
  bottom: 0;
  right: 0;
  background: linear-gradient(
    135deg,
    rgba(26, 26, 46, 0.8),
    rgba(10, 10, 15, 0.9)
  );
  padding: 10px;
  border-top-left-radius: var(--radius-md);
}

.project-overlay .emoji {
  font-size: 2rem;
  display: flex;
  justify-content: center;
  align-items: center;
}

.project-overlay .emoji i {
  font-size: 1.8rem;
  color: var(--primary);
  filter: drop-shadow(0 0 5px rgba(125, 249, 255, 0.5));
  transition: transform 0.3s ease;
}

.project-card:hover .project-overlay .emoji i {
  transform: scale(1.2);
  filter: drop-shadow(0 0 8px rgba(125, 249, 255, 0.8));
}

.project-info {
  padding: 20px;
}

.project-title {
  margin: 0 0 10px;
  font-size: 1.5rem;
  background: linear-gradient(120deg, #fff, var(--primary));
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
}

.project-image {
  position: relative;
  height: 200px;
  overflow: hidden;
  border-top-left-radius: var(--radius-md);
  border-top-right-radius: var(--radius-md);
}

.project-image .placeholder {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.project-tech {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 15px;
}

.project-tech span {
  background: rgba(125, 249, 255, 0.1);
  padding: 4px 10px;
  border-radius: 20px;
  font-size: 0.8rem;
  color: var(--primary);
}

.project-desc {
  margin: 0 0 20px;
  font-size: 0.95rem;
  line-height: 1.5;
  color: rgba(255, 255, 255, 0.8);
}

.project-links {
  display: flex;
  gap: 10px;
}

/* About section styling */
.about-container {
  display: flex;
  flex-direction: column;
  gap: 30px;
  max-width: 900px;
  margin: 0 auto;
}

.about-tagline {
  font-size: 1.5rem;
  line-height: 1.5;
  text-align: center;
  margin: 0;
  background: linear-gradient(120deg, #fff, var(--primary));
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
}

.about-focus {
  display: flex;
  justify-content: center;
  gap: 20px;
  flex-wrap: wrap;
  margin-top: 30px;
}

.focus-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
  padding: 20px;
  background: rgba(26, 26, 46, 0.5);
  border-radius: var(--radius-md);
  -webkit-backdrop-filter: blur(5px);
  backdrop-filter: blur(5px);
  border: 1px solid rgba(125, 249, 255, 0.1);
  transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.focus-item:hover {
  transform: translateY(-5px);
  box-shadow: 0 10px 20px rgba(0, 0, 0, 0.2), 0 0 15px rgba(125, 249, 255, 0.2);
}

.focus-icon {
  font-size: 2.5rem;
  display: flex;
  justify-content: center;
  align-items: center;
}

.focus-icon i {
  font-size: 2.3rem;
  color: var(--primary);
  transition: transform 0.3s ease, color 0.3s ease;
}

.focus-item:hover .focus-icon i {
  transform: scale(1.2);
  color: var(--accent);
}

.about-socials {
  display: flex;
  justify-content: center;
  gap: 20px;
  margin-top: 20px;
}

.social-link {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 10px 20px;
  background: rgba(26, 26, 46, 0.5);
  border-radius: var(--radius-md);
  text-decoration: none;
  color: var(--text-color);
  transition: all 0.3s ease;
  border: 1px solid rgba(125, 249, 255, 0.1);
}

.social-link:hover {
  transform: translateY(-3px);
  background: rgba(26, 26, 46, 0.8);
  box-shadow: 0 5px 15px rgba(0, 0, 0, 0.2), 0 0 10px rgba(125, 249, 255, 0.2);
  border-color: var(--primary);
}

.social-icon {
  font-size: 1.2rem;
  display: flex;
  justify-content: center;
  align-items: center;
  width: 24px;
  height: 24px;
  position: relative;
}

.social-icon i {
  font-size: 1.2rem;
  color: var(--primary);
  transition: transform 0.3s ease, color 0.3s ease;
}

.social-link:hover .social-icon i {
  transform: scale(1.2);
  color: var(--accent);
}

/* Typewriter effect */
.typewriter {
  font-size: 1.5rem;
  margin: 15px 0 30px;
  height: 30px;
  display: flex;
  justify-content: center;
}

.cursor {
  display: inline-block;
  width: 3px;
  background-color: var(--primary);
  animation: blink 1s infinite;
  margin-left: 5px;
}

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

/* Slideshow Controls */
.slideshow-controls {
  display: flex;
  justify-content: center;
  gap: 20px;
  margin-top: 25px;
  opacity: 1; /* Always visible */
  transform: translateY(0);
  transition: opacity 0.3s ease, transform 0.3s ease;
}

.control-btn {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: rgba(26, 26, 46, 0.6);
  border: 1px solid rgba(125, 249, 255, 0.2);
  color: var(--primary);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.3s ease;
  -webkit-backdrop-filter: blur(5px);
  backdrop-filter: blur(5px);
}

.control-btn i {
  font-size: 1rem;
  transition: transform 0.2s ease;
}

.control-btn:hover {
  background: rgba(26, 26, 46, 0.8);
  border-color: var(--primary);
  transform: scale(1.1);
}

.control-btn:hover i {
  transform: scale(1.2);
}

#pause-slide.playing i {
  font-family: 'Font Awesome 6 Free';
  content: '\f04b'; /* fa-play icon */
}

/* Touch device optimizations */
@media (hover: none) {
  .slideshow-controls {
    opacity: 1;
    transform: translateY(0);
  }

  .control-btn {
    background: rgba(26, 26, 46, 0.8);
  }
}

/* Offline notices */
.offline-notice {
  margin-top: 30px;
  padding: 15px 20px;
  background: rgba(26, 26, 46, 0.7);
  border-left: 4px solid var(--primary);
  border-radius: var(--radius-sm);
  display: flex;
  align-items: center;
  gap: 10px;
}

.offline-notice i {
  color: var(--primary);
  font-size: 1.2rem;
}

.offline-notice p {
  margin: 0;
  font-size: 0.95rem;
}

/* Media Queries */
@media (max-width: 768px) {
  .projects-grid {
    grid-template-columns: 1fr;
  }

  .skill-icons {
    gap: 20px;
  }

  .skill-icon .icon {
    font-size: 2.5rem;
  }

  .about-focus {
    flex-direction: column;
    align-items: center;
  }

  .focus-item {
    width: 80%;
  }

  .about-socials {
    flex-direction: column;
    align-items: center;
  }

  .social-link {
    width: 80%;
    justify-content: center;
  }
}
