/* ==================== INDEX.HTML SPECIFIC STYLES ==================== */
/* Common styles are in common.css */

/* ==================== BODY - INDEX SPECIFIC ==================== */
body {
  -webkit-user-select: none;
  -moz-user-select: none;
  -ms-user-select: none;
  user-select: none;
}

body.popup-open {
  overflow: hidden;
  position: fixed;
  width: 100%;
  height: 100%;
}

/* ==================== HERO SECTION ==================== */
.year {
  font-family: "Raleway", sans-serif;
  color: var(--color-text);
  font-size: 1.2rem;
  font-weight: normal;
}

.hero-section {
  padding: 10vh 0;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 40px;
}

.hero-title {
  flex-basis: 50%;
}

.hero-title .hero-image-title {
  width: 100%;
  height: auto;
  max-width: 550px;
  margin-bottom: 20px;
}

.hero-text {
  flex-basis: 40%;
  color: #ffffff;
  line-height: 1.6;
}

/* ==================== PROJECT BUTTONS ==================== */
.project-buttons {
  display: flex;
  justify-content: center;
  flex-wrap: wrap;
  gap: 15px;
  margin: 15px 0;
  width: 50%;
}

#project-button {
  display: flex;
  justify-content: center;
  flex-wrap: wrap;
  gap: 15px;
  margin: 15px 0;
  width: 50%;
}

/* ==================== PORTFOLIO GRID ==================== */
.portfolio-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 30px;
  padding-bottom: 100px;
  text-align: left;
}

@keyframes fadeIn {
  from {
    opacity: 0;
    transform: scale(0.95);
  }
  to {
    opacity: 1;
    transform: scale(1);
  }
}

.portfolio-item {
  position: relative;
  overflow: hidden;
  border-radius: 20px;
  cursor: pointer;
  aspect-ratio: 4 / 3;
  animation: fadeIn 0.5s ease forwards;
}

.portfolio-item .project-details {
  display: none;
}

.portfolio-item.hidden {
  display: none;
}

/* Progressive loading - lazy hidden items */
.portfolio-item.lazy-hidden {
  display: none;
}

/* Load more trigger - invisible element for Intersection Observer */
.load-more-trigger {
  width: 100%;
  height: 1px;
  grid-column: 1 / -1;
  pointer-events: none;
}

.portfolio-item img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.5s ease;
}

.portfolio-item .overlay {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: url("Media/Backgrounds/gradient.png") center / 100% 100%;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  opacity: 0;
  transition: opacity 0.5s ease;
}

.portfolio-item:hover .overlay {
  opacity: 1;
}

.overlay h3 {
  font-size: 2rem;
  margin-bottom: 10px;
}

h3 {
  text-align: center;
}

.overlay span {
  font-size: 1rem;
}

/* ==================== BACK TO TOP BUTTON ==================== */
#back-to-top-btn {
  position: fixed;
  bottom: 30px;
  right: 30px;
  z-index: 999;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.3s ease, transform 0.3s ease, bottom 0.3s ease;
  transform: translateY(20px);
}

#back-to-top-btn.visible {
  opacity: 1;
  pointer-events: auto;
  transform: translateY(0);
}

#back-to-top-btn img {
  height: 20px;
  transition: transform 0.2s ease;
}

#back-to-top-btn:hover img {
  transform: scale(1.1) translateY(-5px);
}

/* ==================== MOBILE NAV MENU ==================== */
.mobile-nav-menu {
  position: fixed;
  top: 0;
  right: 0;
  width: 100%;
  height: 100%;
  background-color: rgba(13, 13, 13, 0.95);
  backdrop-filter: blur(10px);
  z-index: 2000;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  transform: translateX(100%);
  transition: transform 0.4s ease-in-out;
  color: var(--color-text-header);
}

.mobile-nav-menu.menu-open {
  transform: translateX(0);
}

.close-menu-btn {
  position: absolute;
  top: 30px;
  right: 30px;
  background: none;
  border: none;
  cursor: pointer;
}

.close-menu-btn svg {
  width: 30px;
  height: 30px;
  fill: var(--color-text);
}

.mobile-links {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 25px;
  width: 100%;
}

.mobile-links .filter-btn {
  font-size: 1.2rem;
  width: 70%;
  text-align: center;
  border: 1.5px solid transparent;
}

/* ==================== POPUP ==================== */
.popup-container {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-color: rgba(0, 0, 0, 0.95);
  z-index: 3000;
  display: flex;
  justify-content: center;
  align-items: center;
  padding: 20px;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.4s ease;
}

.popup-container.active {
  opacity: 1;
  pointer-events: auto;
}

.popup-content {
  position: relative;
  background-color: #000;
  padding: 40px;
  border-radius: 20px;
  max-width: 900px;
  width: 100%;
  max-height: 90vh;
  overflow-y: auto;
  transform: scale(0.9);
  transition: transform 0.4s ease;
  border: 3px solid transparent;
  background-clip: padding-box;
  background: linear-gradient(var(--color-background), var(--color-background))
      padding-box,
    url("Media/Backgrounds/gradient.png") center / cover border-box;
  -ms-overflow-style: none;
  scrollbar-width: none;
}

.popup-content::-webkit-scrollbar {
  display: none;
}

.popup-container.active .popup-content {
  transform: scale(1);
}

.popup-close-btn {
  position: absolute;
  top: 20px;
  right: 20px;
  width: 20px;
  height: 20px;
  background: none;
  border: none;
  cursor: pointer;
  z-index: 10;
  padding: 0;
}

/* Hide mobile-only elements on desktop */
.popup-drag-handle,
.popup-dots,
.popup-swipe-hint {
  display: none;
}

.popup-close-btn img {
  width: 100%;
  height: 100%;
}

.popup-image-container {
  margin-top: 30px;
  border-radius: 10px;
  overflow: hidden;
}

.popup-content img {
  width: 100%;
  height: auto;
  display: block;
}

#popup-title {
  font-family: "Raleway", serif;
  font-size: 2rem;
  text-align: center;
  margin-bottom: 30px;
  margin-top: 20px;
}

#popup-text-content p {
  margin-bottom: 1em;
  line-height: 1.7;
  color: #e0e0e0;
}

#popup-text-content b {
  color: #ffffff;
}

#popup-text-content h4 {
  margin-top: 0.5em;
  margin-bottom: 0.5em;
  font-size: 1.1rem;
}

#popup-text-content ul {
  list-style: none;
  padding-left: 0;
}

#popup-text-content li {
  padding-left: 25px;
  position: relative;
  margin-bottom: 0.5em;
}

#popup-text-content li::before {
  content: "+";
  position: absolute;
  left: 0;
  color: var(--color-accent);
  font-weight: bold;
}

/* ==================== ACCORDION ==================== */
.accordion-item {
  border-bottom: 1px solid rgba(167, 66, 235, 0.3);
  overflow: hidden;
}

.accordion-item:last-child {
  border-bottom: none;
}

.accordion-header {
  padding: 20px 0;
  cursor: pointer;
  position: relative;
  display: flex;
  align-items: center;
}

.accordion-header::before {
  content: "";
  flex: 1;
  transition: flex 0.6s cubic-bezier(0.25, 0.1, 0.25, 1);
}

.accordion-item.active .accordion-header::before {
  flex: 0;
}

.accordion-header::after {
  content: "+";
  flex: 1;
  text-align: right;
  font-size: 1.5rem;
  color: var(--color-accent);
  transition: transform 0.4s ease, flex 0.6s cubic-bezier(0.25, 0.1, 0.25, 1);
}

/* .accordion-item.active .accordion-header::after {
  transform: rotate(45deg);
  flex: 1;
} */

.accordion-header h4 {
  margin: 0;
  font-size: 1.1rem;
  color: #fff;
  flex: 0 0 auto;
}

.accordion-content {
  max-height: 0;
  overflow: hidden;
  opacity: 0;
  transition: max-height 0.5s cubic-bezier(0.25, 0.1, 0.25, 1),
    padding 0.5s cubic-bezier(0.25, 0.1, 0.25, 1), opacity 0.3s ease;
  padding: 0 0;
}

.accordion-item.active .accordion-content {
  max-height: 2000px;
  padding: 0 0 20px 0;
  opacity: 1;
  transition: max-height 0.5s cubic-bezier(0.25, 0.1, 0.25, 1),
    padding 0.5s cubic-bezier(0.25, 0.1, 0.25, 1), opacity 0.4s ease 0.1s;
}

.accordion-content p {
  margin-bottom: 1em;
  line-height: 1.7;
  color: #e0e0e0;
}

.accordion-content b {
  color: #ffffff;
}

.accordion-content ul {
  list-style: none;
  padding-left: 0;
  margin: 0.5em 0;
}

.accordion-content li {
  padding-left: 25px;
  position: relative;
  margin-bottom: 0.5em;
  color: #e0e0e0;
  line-height: 1.7;
}

.accordion-content li::before {
  content: "+";
  position: absolute;
  left: 0;
  color: var(--color-accent);
  font-weight: bold;
}

.accordion-content a.filter-btn {
  display: inline-block;
  margin: 10px 0;
}

.popup-main-image {
  margin-top: 15px;
  margin-bottom: 30px;
  border-radius: 10px;
  overflow: hidden;
}

.popup-main-image img {
  width: 100%;
  height: auto;
  display: block;
}

.accordion-images {
  padding-top: 20px;
  border-top: 1px solid rgba(167, 66, 235, 0.3);
}

.accordion-images img {
  width: 100%;
  height: auto;
  border-radius: 10px;
  margin-bottom: 15px;
}

.accordion-images img:last-child {
  margin-bottom: 0;
}

/* ==================== RESPONSIVE - INDEX SPECIFIC ==================== */
@media (max-width: 768px) {
  main {
    padding-top: 2vh;
  }

  .hero-section {
    flex-direction: column;
    text-align: center;
  }

  .portfolio-grid {
    grid-template-columns: 1fr;
  }

  #back-to-top-btn {
    display: none;
  }

  .filter-buttons {
    display: none;
  }

  /* Accordion mobile */
  .accordion-header {
    padding: 15px 0;
  }

  .accordion-header h4 {
    font-size: 0.9rem;
  }

  .accordion-content {
    padding: 0 5px;
  }

  .accordion-item.active .accordion-content {
    padding: 0 5px 15px 5px;
  }

  .accordion-content p,
  .accordion-content li {
    font-size: 0.85rem;
    line-height: 1.6;
  }

  #popup-title {
    font-size: 1.4rem;
    margin-top: 20px;
    margin-bottom: 20px;
  }

  /* ==================== MOBILE BOTTOM SHEET ==================== */
  .popup-container {
    align-items: flex-end;
    padding: 0;
  }

  .popup-content {
    max-width: 100%;
    height: 75vh;
    border-radius: 20px;
    padding: 15px 20px 30px 20px;
    transform: translateY(100%);
    transition: transform 0.3s ease-out;
    overflow: hidden;
    display: flex;
    flex-direction: column;
  }

  .popup-container.active .popup-content {
    transform: translateY(0);
  }

  /* Drag handle */
  .popup-drag-handle {
    width: 40px;
    height: 5px;
    background: rgba(255, 255, 255, 0.3);
    border-radius: 3px;
    margin: 0 auto 15px auto;
    display: block;
  }

  .popup-close-btn {
    display: none;
  }

  /* Dots indicator */
  .popup-dots {
    display: flex;
    justify-content: center;
    gap: 8px;
    margin-bottom: 15px;
  }

  .popup-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.3);
    transition: background 0.3s ease, transform 0.3s ease;
  }

  .popup-dot.active {
    background: var(--color-accent);
    transform: scale(1.2);
  }

  /* Swipe hint */
  .popup-swipe-hint {
    text-align: center;
    font-size: 0.75rem;
    color: rgba(255, 255, 255, 0.5);
    margin-bottom: 10px;
  }

  /* Carousel swipe */
  .popup-carousel {
    display: flex;
    flex: 1;
    min-height: 0;
  }

  .popup-carousel.animating {
    transition: transform 0.3s ease-out;
  }

  .popup-slide {
    width: 100%;
    flex-shrink: 0;
    padding: 0 20px;
    box-sizing: border-box;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
    -ms-overflow-style: none;
    scrollbar-width: none;
  }

  .popup-slide::-webkit-scrollbar {
    display: none;
  }

  /* Slide content styles (matching original popup styles) */
  .slide-title {
    font-family: "Raleway", serif;
    font-size: 1.4rem;
    text-align: center;
    margin-bottom: 20px;
  }

  .slide-text {
    margin-bottom: 20px;
  }

  .slide-text p {
    margin-bottom: 1em;
    line-height: 1.7;
    color: #e0e0e0;
  }

  .slide-text b {
    color: #ffffff;
  }

  .slide-text h4 {
    margin-top: 0.5em;
    margin-bottom: 0.5em;
    font-size: 0.9rem;
  }

  .slide-text ul {
    list-style: none;
    padding-left: 0;
  }

  .slide-text li {
    padding-left: 25px;
    position: relative;
    margin-bottom: 0.5em;
  }

  .slide-text li::before {
    content: "+";
    position: absolute;
    left: 0;
    color: var(--color-accent);
    font-weight: bold;
  }

  .slide-main-image {
    margin-top: 20px;
    border-radius: 10px;
    overflow: hidden;
  }

  .slide-main-image img {
    width: 100%;
    height: auto;
    display: block;
  }
}
