/* Make all bullet points interactive - underline on hover */
li {
  cursor: pointer;
  transition: all 0.2s ease;
}

li:hover span {
  text-decoration: underline;
}

/* Make clickable skills interactive - same effect as bullet points */
.clickable-skill {
  cursor: pointer;
  transition: all 0.2s ease;
}

.clickable-skill:hover {
  text-decoration: underline;
}

/* Page containers */
.page-container {
  display: block;
  opacity: 1;
  position: absolute;
  top: 20px;
  left: 50%;
  transform: translateX(-50%) scale(0.68);
  transform-origin: top center;
  z-index: 1;
  will-change: transform;
  backface-visibility: hidden;
  -webkit-backface-visibility: hidden;
}

.page-container.active {
  z-index: 2;
  animation: none;
}

.page-container.page-exit {
  z-index: 3;
  animation: pageExit 0.6s ease-in-out forwards;
}

/* Page exit animation - slides to the left and behind the stack */
@keyframes pageExit {
  0% {
    transform: translateX(-50%) translateX(0) scale(0.68);
    z-index: 3;
  }
  50% {
    transform: translateX(-50%) translateX(-150%) scale(0.646);
    z-index: 3;
  }
  51% {
    z-index: 0;
  }
  100% {
    transform: translateX(-50%) translateX(0) scale(0.68);
    z-index: 0;
  }
}

/* Apply home page styling to all page containers */
body .page-container {
  background-color: #ffffff;
  max-width: 468pt;
  min-height: 725pt;
  padding: 22pt 55pt 50pt 55pt;
  margin: 0;
  box-shadow: 0 0 10px rgba(0,0,0,0.08);
  position: absolute;
}

/* Container wrapper for absolute positioning */
body {
  position: relative;
  min-height: 100vh;
  padding: 0;
  margin: 0;
}

/* Go Home button styling */
.go-home-btn {
  display: inline-block;
  margin-top: 20px;
  padding: 10px 20px;
  background-color: #f5f5f5;
  border: 1px solid #ccc;
  border-radius: 4px;
  cursor: pointer;
  font-family: "Helvetica Neue", Arial, sans-serif;
  font-size: 11pt;
  text-decoration: none;
  color: #000;
  transition: all 0.2s ease;
}

.go-home-btn:hover {
  background-color: #e0e0e0;
  text-decoration: underline;
}

/* Page curl in bottom right corner */
.page-curl {
  position: absolute;
  bottom: 0;
  right: 0;
  width: 80px;
  height: 80px;
  cursor: pointer;
  z-index: 100;
  overflow: hidden;
}

.page-curl::before {
  content: '';
  position: absolute;
  bottom: 0;
  right: 0;
  width: 0;
  height: 0;
  border-style: solid;
  border-width: 0 0 60px 60px;
  border-color: transparent transparent #f5f5f5 transparent;
  transition: all 0.3s ease;
  box-shadow: -2px 2px 8px rgba(0, 0, 0, 0.15);
}

.page-curl:hover::before {
  border-width: 0 0 80px 80px;
  box-shadow: -3px 3px 12px rgba(0, 0, 0, 0.2);
}

.page-curl::after {
  content: '→';
  position: absolute;
  bottom: 10px;
  right: 10px;
  font-size: 18px;
  color: #666;
  transition: all 0.3s ease;
  pointer-events: none;
}

.page-curl:hover::after {
  bottom: 15px;
  right: 15px;
  color: #333;
}

/* Project Tabs */
.project-tabs {
  display: flex;
  justify-content: center;
  gap: 0;
  margin: 20px auto 0 auto;
  max-width: 582px;
}

.project-tab {
  flex: 1;
  padding: 10px 20px;
  background-color: #f5f5f7;
  border: none;
  cursor: pointer;
  font-family: 'Helvetica Neue', Helvetica, Arial, sans-serif;
  font-size: 14px;
  color: #1d1d1f;
  transition: background-color 0.2s ease;
  border-bottom: 2px solid #d2d2d7;
}

.project-tab:first-child {
  border-radius: 8px 0 0 0;
}

.project-tab:last-child {
  border-radius: 0 8px 0 0;
}

.project-tab:hover {
  background-color: #e8e8ed;
}

.project-tab.active {
  background-color: #ffffff;
  border-bottom: 2px solid #0071e3;
  color: #0071e3;
  font-weight: 500;
}

/* Image Carousel */
.carousel-container {
  position: relative;
  width: 100%;
  max-width: 582px;
  height: 582px;
  margin: 20px auto;
  overflow: hidden;
  border-radius: 8px;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.carousel-track {
  display: flex;
  height: 100%;
  transition: transform 0.5s ease-in-out;
  will-change: transform;
  backface-visibility: hidden;
  -webkit-backface-visibility: hidden;
}

.carousel-image {
  width: 582px;
  height: 582px;
  flex-shrink: 0;
  object-fit: contain;
  display: block;
  background-color: #f5f5f5;
}

.carousel-btn {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  background-color: rgba(255, 255, 255, 0.8);
  border: none;
  font-size: 32px;
  padding: 10px 15px;
  cursor: pointer;
  z-index: 10;
  transition: background-color 0.3s ease;
  border-radius: 4px;
  line-height: 1;
  color: #333;
}

.carousel-btn:hover {
  background-color: rgba(255, 255, 255, 0.95);
}

.carousel-prev {
  left: 10px;
}

.carousel-next {
  right: 10px;
}

.carousel-indicators {
  position: absolute;
  bottom: 15px;
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  gap: 8px;
  z-index: 10;
}

.carousel-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background-color: rgba(255, 255, 255, 0.5);
  cursor: pointer;
  transition: background-color 0.3s ease;
}

.carousel-dot:hover {
  background-color: rgba(255, 255, 255, 0.8);
}

.carousel-dot.active {
  background-color: rgba(255, 255, 255, 1);
}

/* Carousel Text Card (inside carousel as last slide) */
.carousel-text-card {
  width: 582px;
  height: 582px;
  flex-shrink: 0;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  padding: 60px;
  box-sizing: border-box;
  background-color: #f5f5f7;
  text-align: center;
}

.carousel-card-title {
  font-family: 'Helvetica Neue', Helvetica, Arial, sans-serif;
  font-size: 28px;
  font-weight: 600;
  color: #1d1d1f;
  margin: 0 0 20px 0;
}

.carousel-card-text {
  font-family: 'Helvetica Neue', Helvetica, Arial, sans-serif;
  font-size: 17px;
  font-weight: 400;
  color: #424245;
  line-height: 1.6;
  margin: 0;
  max-width: 400px;
}

/* Image loading states */
.carousel-image.lazy-load {
  background: linear-gradient(90deg, #f0f0f0 25%, #e0e0e0 50%, #f0f0f0 75%);
  background-size: 200% 100%;
  animation: loading 1.5s ease-in-out infinite;
  min-height: 200px;
}

@keyframes loading {
  0% {
    background-position: 200% 0;
  }
  100% {
    background-position: -200% 0;
  }
}

.carousel-image.loaded {
  animation: fadeIn 0.3s ease-in;
}

@keyframes fadeIn {
  from {
    opacity: 0;
  }
  to {
    opacity: 1;
  }
}

/* Smooth touch interactions for all devices */
li, .project-tab, .carousel-btn, .go-home-btn {
  -webkit-tap-highlight-color: rgba(0, 0, 0, 0.1);
  touch-action: manipulation;
}

/* ===== DESKTOP-ONLY STYLES ===== */
@media screen and (min-width: 769px) {
  /* Make carousel images clickable on desktop */
  .carousel-image {
    cursor: zoom-in;
    transition: opacity 0.2s ease;
  }

  .carousel-image:hover {
    opacity: 0.9;
  }

  /* Image Modal Styles - Desktop Only */
  .image-modal {
    display: none;
    position: fixed;
    z-index: 10000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.95);
    animation: fadeIn 0.3s ease;
  }

  .image-modal.active {
    display: flex;
    justify-content: center;
    align-items: center;
  }

  .image-modal-content {
    position: relative;
    width: 90vw;
    height: 90vh;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
  }

  .image-modal-close {
    position: absolute;
    top: 20px;
    right: 30px;
    color: #ffffff;
    font-size: 48px;
    font-weight: 300;
    background: none;
    border: none;
    cursor: pointer;
    z-index: 10002;
    line-height: 1;
    padding: 0;
    width: 50px;
    height: 50px;
    transition: all 0.2s ease;
  }

  .image-modal-close:hover {
    color: #cccccc;
    transform: scale(1.1);
  }

  .image-modal-carousel {
    position: relative;
    width: 100%;
    height: calc(100% - 80px);
    overflow: hidden;
    display: flex;
    justify-content: center;
    align-items: center;
  }

  .image-modal-track {
    display: flex;
    height: 100%;
    width: 100%;
    transition: transform 0.4s cubic-bezier(0.25, 0.8, 0.25, 1);
    will-change: transform;
  }

  .image-modal-track img {
    width: 100%;
    min-width: 100%;
    height: 100%;
    object-fit: contain;
    flex-shrink: 0;
    user-select: none;
    -webkit-user-drag: none;
  }

  .image-modal-prev,
  .image-modal-next {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    background-color: rgba(255, 255, 255, 0.15);
    backdrop-filter: blur(10px);
    border: none;
    font-size: 48px;
    padding: 20px 25px;
    cursor: pointer;
    z-index: 10001;
    transition: all 0.3s ease;
    border-radius: 8px;
    line-height: 1;
    color: #ffffff;
    font-weight: 300;
  }

  .image-modal-prev:hover,
  .image-modal-next:hover {
    background-color: rgba(255, 255, 255, 0.25);
    transform: translateY(-50%) scale(1.1);
  }

  .image-modal-prev {
    left: 30px;
  }

  .image-modal-next {
    right: 30px;
  }

  .image-modal-indicators {
    display: none;
  }

  .image-modal-counter {
    position: absolute;
    bottom: 20px;
    left: 50%;
    transform: translateX(-50%);
    color: #ffffff;
    font-family: 'Helvetica Neue', Helvetica, Arial, sans-serif;
    font-size: 16px;
    font-weight: 400;
    background-color: rgba(0, 0, 0, 0.5);
    padding: 8px 16px;
    border-radius: 20px;
    backdrop-filter: blur(10px);
  }

  /* Keyboard navigation hint */
  .image-modal-content::before {
    content: 'Use ← → arrow keys or ESC to close';
    position: absolute;
    top: 20px;
    left: 30px;
    color: rgba(255, 255, 255, 0.6);
    font-family: 'Helvetica Neue', Helvetica, Arial, sans-serif;
    font-size: 14px;
    font-weight: 300;
    opacity: 1;
    animation: fadeOut 3s ease forwards;
    animation-delay: 2s;
    z-index: 10003;
  }

  @keyframes fadeOut {
    to {
      opacity: 0;
    }
  }
}

/* ===== MOBILE RESPONSIVE STYLES ===== */
@media screen and (max-width: 768px) {
  /* Remove the gray background on mobile and disable scrolling */
  html, body {
    background: #ffffff;
    margin: 0;
    padding: 0;
    overflow: hidden !important;
    height: 100vh;
    width: 100vw;
    position: fixed;
  }

  /* Make the page container full-width, fixed, and scrollable */
  body .page-container {
    position: fixed !important;
    top: 0 !important;
    left: 0 !important;
    right: 0 !important;
    bottom: 0 !important;
    transform: none !important;
    transform-origin: initial !important;
    width: 100% !important;
    max-width: 100% !important;
    height: 100vh !important;
    padding: 20px !important;
    margin: 0 !important;
    box-shadow: none !important;
    min-height: auto !important;
    background-color: #ffffff !important;
    box-sizing: border-box;
    overflow-y: scroll !important;
    overflow-x: hidden !important;
    -webkit-overflow-scrolling: touch;
  }

  .page-container.active {
    display: block !important;
    position: fixed !important;
    transform: none !important;
    z-index: 10;
  }

  /* Hide non-active pages */
  .page-container:not(.active):not(.page-exit) {
    display: none !important;
  }

  /* Page animations for mobile - all pages are fixed and overlay */
  .page-container.page-exit {
    position: fixed !important;
    top: 0 !important;
    left: 0 !important;
    right: 0 !important;
    bottom: 0 !important;
    width: 100% !important;
    height: 100vh !important;
    z-index: 20;
    overflow: hidden !important;
    padding: 20px !important;
    box-sizing: border-box;
  }

  /* Slide left animation with fade */
  .page-container.page-exit[data-exit-direction="left"] {
    animation: mobilePageExitLeft 0.4s ease-in-out forwards !important;
  }

  /* Slide right animation with fade */
  .page-container.page-exit[data-exit-direction="right"] {
    animation: mobilePageExitRight 0.4s ease-in-out forwards !important;
  }

  /* Page entering from left */
  .page-container.active[data-enter-direction="left"] {
    animation: mobilePageEnterLeft 0.4s ease-in-out forwards !important;
  }

  /* Page entering from right */
  .page-container.active[data-enter-direction="right"] {
    animation: mobilePageEnterRight 0.4s ease-in-out forwards !important;
  }

  @keyframes mobilePageExitLeft {
    0% {
      transform: translateX(0);
      opacity: 1;
    }
    100% {
      transform: translateX(-100%);
      opacity: 0.8;
    }
  }

  @keyframes mobilePageExitRight {
    0% {
      transform: translateX(0);
      opacity: 1;
    }
    100% {
      transform: translateX(100%);
      opacity: 0.8;
    }
  }

  @keyframes mobilePageEnterLeft {
    0% {
      transform: translateX(-100%);
      opacity: 0.8;
    }
    100% {
      transform: translateX(0);
      opacity: 1;
    }
  }

  @keyframes mobilePageEnterRight {
    0% {
      transform: translateX(100%);
      opacity: 0.8;
    }
    100% {
      transform: translateX(0);
      opacity: 1;
    }
  }

  /* Hide page curl on mobile */
  .page-curl {
    display: none;
  }

  /* Make carousels responsive */
  .carousel-container {
    max-width: 100%;
    height: auto;
    aspect-ratio: 1;
    margin: 15px 0;
  }

  .carousel-image {
    width: 100%;
    height: 100%;
  }

  .carousel-text-card {
    width: 100%;
    height: 100%;
    padding: 40px 20px;
  }

  /* Adjust tabs for mobile */
  .project-tabs {
    max-width: 100%;
    margin: 15px 0 0 0;
  }

  .project-tab {
    font-size: 12px;
    padding: 8px 12px;
  }

  /* Adjust carousel buttons for mobile */
  .carousel-btn {
    font-size: 24px;
    padding: 8px 12px;
  }

  .carousel-prev {
    left: 5px;
  }

  .carousel-next {
    right: 5px;
  }

  /* Adjust indicators for mobile */
  .carousel-indicators {
    bottom: 10px;
    gap: 6px;
  }

  .carousel-dot {
    width: 8px;
    height: 8px;
  }

  /* Adjust go home button for mobile */
  .go-home-btn {
    margin-top: 15px;
    padding: 8px 16px;
    font-size: 10pt;
  }
}

/* Landscape orientation on mobile */
@media screen and (max-width: 768px) and (orientation: landscape) {
  .carousel-container {
    aspect-ratio: 16 / 9;
    max-height: 60vh;
  }
}