/* Custom theme and glass morphism */
:root {
  --primary: 217.2 91.2% 59.8%;
  --background: 0 0% 0%;
  --foreground: 210 40% 98%;
  --muted: 217.2 32.6% 17.5%;
  --muted-foreground: 215 20.2% 65.1%;
  --accent: 217.2 32.6% 17.5%;
  --border: 217.2 32.6% 17.5%;
}

body {
  background-color: #000000;
  color: hsl(var(--foreground));
  font-family: ui-sans-serif, system-ui, sans-serif;
}

.glass {
  background-color: rgba(23, 37, 84, 0.4);
  backdrop-filter: blur(12px);
  border: 1px solid hsl(var(--border) / 0.5);
}

.text-primary {
  color: hsl(var(--primary));
}

.bg-primary {
  background-color: hsl(var(--primary));
}

.text-muted-foreground {
  color: hsl(var(--muted-foreground));
}

.section {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  justify-content: flex-start;
  padding-top: 5rem;
  padding-bottom: 5rem;
}

/* Keep the about section centered as hero section */
#about {
  justify-content: center;
}

@keyframes fadeIn {
  from {
    opacity: 0;
    transform: translateY(20px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.fade-in {
  animation: fadeIn 0.5s ease-out forwards;
}

/* Static background for canvas */
.bg-animated {
  background: #000000;
}

.nav-link {
  position: relative;
  transition: color 0.3s;
}

.nav-link:hover {
  color: hsl(var(--primary));
}

.nav-link::after {
  content: '';
  position: absolute;
  bottom: -4px;
  left: 0;
  width: 0;
  height: 2px;
  background-color: hsl(var(--primary));
  transition: width 0.3s;
}

.nav-link:hover::after {
  width: 100%;
}

/* Make SVG icons white */
img[src$=".svg"] {
  filter: brightness(0) invert(1);
}

/* Timeline animation */
@keyframes progress {
  from { height: 0%; }
  to { height: 100%; }
}

.animate-progress {
  animation: progress 2s ease-out forwards;
}

/* CV item animations */
.cv-item {
  opacity: 0;
  transform: translateX(-4rem);
  animation: slideIn 0.7s ease-out forwards;
}

.cv-item:nth-child(1) { animation-delay: 0.1s; }
.cv-item:nth-child(2) { animation-delay: 0.2s; }
.cv-item:nth-child(3) { animation-delay: 0.3s; }
.cv-item:nth-child(4) { animation-delay: 0.4s; }
.cv-item:nth-child(5) { animation-delay: 0.5s; }
.cv-item:nth-child(6) { animation-delay: 0.6s; }

@keyframes slideIn {
  to {
    opacity: 1;
    transform: translateX(0);
  }
}

/* Timeline dot fill on hover */
.group:hover .timeline-dot {
  background-color: hsl(var(--primary)) !important;
}

/* Project image hover effect */
.project-image-wrapper {
  position: relative;
  overflow: hidden;
  border-radius: 0.5rem;
  aspect-ratio: 9 / 5;
  background-color: white;
}

.project-image-wrapper img {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  object-fit: contain;
  display: block;
}

.project-image-main {
  z-index: 4;
}

.project-image-background {
  z-index: 1;
  opacity: 1;
}

.project-dark-overlay {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  z-index: 2;
  background: rgba(0, 0, 0, 0.6);
  opacity: 0;
  transition: opacity 0.5s ease;
  pointer-events: none;
}

.project-canvas-overlay {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  z-index: 3;
  opacity: 0;
  transition: opacity 0.5s ease;
  pointer-events: none;
}

.project-image-wrapper:hover .project-image-main {
  opacity: 0;
  transition: opacity 0.5s ease;
}

.project-image-wrapper:hover .project-dark-overlay {
  opacity: 1;
}

.project-image-wrapper:hover .project-canvas-overlay {
  opacity: 1;
}

/* Simple image wrapper for projects without hover effects */
.project-image-simple {
  position: relative;
  overflow: hidden;
  border-radius: 0.5rem;
  aspect-ratio: 9 / 5;
  background-color: white;
}

.project-image-simple img {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  object-fit: contain;
  display: block;
  z-index: 1;
}

.project-image-simple .project-dark-overlay {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  z-index: 2;
  background: rgba(0, 0, 0, 0.6);
  opacity: 0;
  transition: opacity 0.5s ease;
  pointer-events: none;
}

.project-image-simple .project-canvas-overlay {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  z-index: 3;
  opacity: 0;
  transition: opacity 0.5s ease;
  pointer-events: none;
}

.project-image-simple:hover .project-dark-overlay {
  opacity: 1;
}

.project-image-simple:hover .project-canvas-overlay {
  opacity: 1;
}

/* PDF Modal Overlay */
.pdf-modal {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-color: rgba(0, 0, 0, 0.9);
  z-index: 9999;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 2rem;
}

.pdf-modal.active {
  display: flex;
}

.pdf-modal-content {
  position: relative;
  width: 100%;
  max-width: 1200px;
  height: 90vh;
  background: white;
  border-radius: 0.5rem;
  overflow: hidden;
}

.pdf-modal-close {
  position: absolute;
  top: -3rem;
  right: 0;
  background: rgba(255, 255, 255, 0.1);
  border: 1px solid rgba(255, 255, 255, 0.2);
  color: white;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  font-size: 24px;
  transition: all 0.3s;
  backdrop-filter: blur(10px);
}

.pdf-modal-close:hover {
  background: rgba(255, 255, 255, 0.2);
  transform: scale(1.1);
}

.pdf-modal iframe {
  width: 100%;
  height: 100%;
  border: none;
}

/* Project button fill effect on hover */
.glass a[class*="inline-flex"] {
  position: relative;
  overflow: hidden;
  background-color: transparent;
  border-color: hsl(var(--primary));
  color: hsl(var(--primary));
  transition: color 0.3s ease;
}

.glass a[class*="inline-flex"]::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-color: hsl(var(--primary));
  transform: translateY(100%);
  transition: transform 0.3s ease;
  z-index: -1;
}

.glass a[class*="inline-flex"]:hover::before {
  transform: translateY(0);
}

.glass a[class*="inline-flex"]:hover {
  color: #000000;
  border-color: hsl(var(--primary));
}

/* CV card logo styling */
.cv-logo {
  width: 70px;
  height: 70px;
  object-fit: contain;
  flex-shrink: 0;
  filter: none !important;
}

.cv-card-content {
  display: flex;
  gap: 1.5rem;
  align-items: center;
}

/* Mobile responsive text scaling */
@media (max-width: 768px) {
  /* Center profile image and name section */
  #about .flex.flex-col.items-center {
    margin-left: auto;
    margin-right: auto;
  }

  /* Shift bio text right to show emojis on mobile */
  #about .flex-1 {
    padding-left: 1.5rem;
  }

  /* Scale down bio text on mobile */
  #about .text-lg {
    font-size: 1.0rem;
    line-height: 1.5;
  }

  /* Adjust spacing for better mobile fit */
  #about .space-y-4 > p {
    margin-top: 0.5rem;
    margin-bottom: 0.5rem;
  }

  /* Scale down all headings */
  h2 {
    font-size: 1.6rem !important;
  }

  h3 {
    font-size: 1.25rem !important;
  }

  h4 {
    font-size: 1rem !important;
  }

  /* Scale down all card text */
  .glass p {
    font-size: 1rem;
  }

  .glass .text-sm {
    font-size: 0.85rem;
  }

  .glass .text-lg {
    font-size: 1.1rem;
  }

  /* Scale down CV cards */
  .cv-logo {
    width: 40px !important;
    height: 40px !important;
  }

  .cv-card {
    padding: 1rem !important;
  }

  /* Scale down project cards */
  .project-image-wrapper,
  .project-image-simple {
    aspect-ratio: 16 / 9;
  }

  /* Scale down buttons */
  .glass a[class*="inline-flex"] {
    font-size: 1.0rem;
    padding: 0.5rem 0.75rem;
    height: auto;
  }

  /* Reduce section padding */
  .section {
    padding-top: 6rem;
    padding-bottom: 3rem;
  }

  /* Extra padding for about section to clear nav bar */
  #about {
    padding-top: 7rem;
  }

  /* Scale down profile image */
  #about .w-60 {
    width: 12rem;
    height: 12rem;
  }

  /* Scale down social icons */
  #about .w-6 {
    width: 1.25rem;
    height: 1.25rem;
  }

  /* Scale down name */
  #about .text-xl {
    font-size: 1.5rem;
  }

  /* Reduce spacing in cards */
  .space-y-4 {
    gap: 0.75rem;
  }

  .space-y-6 {
    gap: 1rem;
  }

  .space-y-8 {
    gap: 1.25rem;
  }

  /* Disable particles and dark gradient on mobile */
  .project-image-wrapper .project-dark-overlay,
  .project-image-simple .project-dark-overlay,
  .project-image-wrapper .project-canvas-overlay,
  .project-image-simple .project-canvas-overlay {
    display: none !important;
  }

  /* Disable hover effects on mobile */
  .project-image-wrapper:hover .project-image-main,
  .project-image-simple:hover .project-image-main {
    opacity: 1 !important;
  }

  /* Enable clickability on mobile */
  .project-image-wrapper,
  .project-image-simple {
    cursor: pointer;
    -webkit-tap-highlight-color: transparent;
    position: relative;
  }

  /* Make child images pass clicks to wrapper */
  .project-image-wrapper img,
  .project-image-simple img {
    pointer-events: none;
  }

  /* Smooth transition for slideshow */
  .project-image-wrapper .project-image-main,
  .project-image-simple .project-image-main {
    transition: opacity 0.5s ease;
  }
}
