:root {
  --active: 1;
  --inactive: 0.9;
  --primary-color: #2c3e50;
  --accent-color: #3498db;
  --text-light: #ecf0f1;
  --text-dark: #2c3e50;
  --background-light: #ffffff;
  --footer-bg: #34495e;
}

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

body {
  font-family: 'Inter', sans-serif;
  line-height: 1.6;
  color: var(--text-dark);
  min-height: 100vh;
  overflow-x: hidden;
  display: flex;
  flex-direction: column;
}

/* Header Image Styles */
.header-image {
  text-align: center;
  margin-bottom: 1rem;
}

.logo-image {
  max-width: 300px;
  width: 100%;
  height: auto;
  object-fit: contain;
}

/* Main Content */
.main-content {
  flex: 1;
  padding: 1rem 0;
  display: flex;
  flex-direction: column;
}

.portfolio-section {
  padding: 1rem;
  flex: 1;
  display: flex;
  flex-direction: column;
}

.wrapper {
  flex: 1;
  display: flex;
  justify-content: center;
  align-items: center;
  padding: 1rem;
  padding-bottom: 2rem;
  box-sizing: border-box;
  max-height: calc(100vh - 200px); /* Ensure it doesn't exceed available space */
}

.gallery-container {
  width: 100%;
  max-width: 1200px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1rem;
  margin: 0 auto;
}

/* Category Navigation */
.category-nav {
  display: flex;
  gap: 1rem;
  margin-bottom: 1rem;
}

.category-btn {
  padding: 12px 24px;
  border: 2px solid var(--primary-color);
  background: transparent;
  color: var(--primary-color);
  font-family: 'Inter', sans-serif;
  font-weight: 500;
  border-radius: 25px;
  cursor: pointer;
  transition: all 0.3s ease;
  position: relative;
  overflow: hidden;
}

.category-btn:hover {
  background: var(--primary-color);
  color: white;
  transform: translateY(-2px);
  box-shadow: 0 4px 15px rgba(44, 62, 80, 0.3);
}

.category-btn.active {
  background: var(--accent-color);
  border-color: var(--accent-color);
  color: white;
}

.lightbox {
  width: min(900px, 95vw); 
  max-width: 1200px;
  max-height: calc(100vh - 250px); /* Ensure it fits within available space */
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  box-shadow: 0 15px 50px rgba(0,0,0,0.25);
  border-radius: 16px;
  overflow: hidden;
  background: white;
  padding: 1rem;
  margin: 0 auto;
  box-sizing: border-box;
}

.image-container {
  position: relative;
}

  & .hero {
    aspect-ratio: 16/10;
    background-position: center;
    background-size: cover;
    background-repeat: no-repeat;
    border-radius: 12px;
    min-height: 280px;
    max-height: calc(100vh - 350px); /* Ensure hero doesn't get too tall */
    position: relative;
    flex: 1;
  }

/* Fullscreen Button */
.fullscreen-btn {
  position: absolute;
  top: 1rem;
  right: 1rem;
  background: rgba(0, 0, 0, 0.6);
  border: none;
  color: white;
  width: 48px;
  height: 48px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.3s ease;
  backdrop-filter: blur(10px);
}

.fullscreen-btn:hover {
  background: rgba(0, 0, 0, 0.8);
  transform: scale(1.1);
}

.fullscreen-btn .material-symbols-outlined {
  font-size: 24px;
}

/* Fullscreen Modal */
.fullscreen-modal {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  background: rgba(0, 0, 0, 0.95);
  z-index: 1000;
  display: flex;
  align-items: center;
  justify-content: center;
}

.fullscreen-content {
  position: relative;
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
}

.fullscreen-image {
  max-width: 90vw;
  max-height: 90vh;
  object-fit: contain;
  border-radius: 8px;
}

.close-btn {
  position: absolute;
  top: 2rem;
  right: 2rem;
  background: rgba(255, 255, 255, 0.2);
  border: none;
  color: white;
  width: 48px;
  height: 48px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.3s ease;
  backdrop-filter: blur(10px);
  z-index: 1001;
}

.close-btn:hover {
  background: rgba(255, 255, 255, 0.3);
  transform: scale(1.1);
}

.nav-btn {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  background: rgba(255, 255, 255, 0.2);
  border: none;
  color: white;
  width: 60px;
  height: 60px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.3s ease;
  backdrop-filter: blur(10px);
  z-index: 1001;
}

.nav-btn:hover {
  background: rgba(255, 255, 255, 0.3);
  transform: translateY(-50%) scale(1.1);
}

.prev-btn {
  left: 2rem;
}

.next-btn {
  right: 2rem;
}

.nav-btn .material-symbols-outlined {
  font-size: 28px;
}

.image-counter {
  position: absolute;
  bottom: 2rem;
  left: 50%;
  transform: translateX(-50%);
  background: rgba(0, 0, 0, 0.6);
  color: white;
  padding: 8px 16px;
  border-radius: 20px;
  font-size: 14px;
  backdrop-filter: blur(10px);
}

.lightbox {
  & .lightbox-nav {
    display: flex;
    justify-content: center;
    gap: 0.5rem;
    padding-top: 1rem;
    overflow-x: auto;
    overflow-y: hidden;
    scrollbar-width: thin;
    scrollbar-color: var(--accent-color) rgba(0,0,0,0.1);
    padding-bottom: 0.5rem;

    /* Custom scrollbar for webkit browsers */
    &::-webkit-scrollbar {
      height: 6px;
    }

    &::-webkit-scrollbar-track {
      background: rgba(0,0,0,0.1);
      border-radius: 3px;
    }

    &::-webkit-scrollbar-thumb {
      background: var(--accent-color);
      border-radius: 3px;
    }

    &::-webkit-scrollbar-thumb:hover {
      background: var(--primary-color);
    }

    &:hover img:not(:hover) { opacity: var(--inactive); }

    & button {
      flex: 0 0 auto;
      width: 80px;
      aspect-ratio: 1;
      border: none;
      outline: none;
      background-color: transparent;
      cursor: pointer;
      border-radius: 8px;
      overflow: hidden;
      min-height: 80px;

      & img {
        width: inherit;
        height: 100%;
        object-fit: cover;
        opacity: var(--inactive);
        transition: opacity 0.3s, transform 0.2s;
        border-radius: 8px;

        &:hover { 
          opacity: var(--active);
          transform: scale(1.05);
        }
      }

      .active { 
        opacity: var(--active);
        box-shadow: 0 0 0 3px var(--accent-color);
        transform: scale(1.02);
      }
    }
  }
}

/* Footer Styles */
.site-footer {
  background: var(--footer-bg);
  color: var(--text-light);
  padding: 1.5rem;
  margin-top: auto;
}

.footer-content {
  max-width: 1200px;
  margin: 0 auto;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1rem;
  text-align: center;
}

.contact-icons {
  display: flex;
  gap: 1rem;
  justify-content: center;
}

.footer-copyright p {
  font-size: 0.9rem;
  opacity: 0.9;
}

.contact-icon {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  background: rgba(0, 0, 0, 0.6);
  border-radius: 50%;
  color: white;
  text-decoration: none;
  transition: all 0.3s ease;
  border: 2px solid rgba(255,255,255,0.4);
}

.contact-icon:hover {
  background: var(--accent-color);
  transform: translateY(-2px);
  box-shadow: 0 4px 15px rgba(52, 152, 219, 0.4);
  border-color: var(--accent-color);
}

.contact-icon .material-symbols-outlined {
  font-size: 20px;
}

/* Responsive Design */
@media (max-width: 1024px) {
  .lightbox {
    width: min(700px, 92vw);
    max-height: calc(100vh - 200px);
  }
  
  .wrapper {
    max-height: calc(100vh - 180px);
    padding-bottom: 1.5rem;
  }
  
  .category-nav {
    flex-wrap: wrap;
    justify-content: center;
  }
  
  .hero {
    min-height: 250px !important;
    max-height: calc(100vh - 300px) !important;
  }
}

@media (max-width: 768px) {
  .main-content {
    padding: 0.5rem 0;
  }

  .portfolio-section {
    padding: 0.5rem;
  }

  .header-image {
    margin-bottom: 0.75rem;
  }

  .logo-image {
    max-width: 200px;
  }

  .wrapper {
    max-height: calc(100vh - 150px);
    padding: 0.5rem;
    padding-bottom: 1.5rem;
    justify-content: center;
    align-items: flex-start;
  }

  .gallery-container {
    width: 100%;
    max-width: 100%;
    padding: 0;
    margin: 0 auto;
  }
  
  .lightbox {
    width: 100%;
    max-width: calc(100vw - 1rem);
    max-height: calc(100vh - 180px);
    padding: 1rem;
    margin: 0 auto;
    margin-bottom: 2rem;
  }
  
  .lightbox .hero {
    min-height: 200px;
  }
  
  .lightbox-nav button {
    min-height: 50px;
    width: 50px;
  }
  
  .lightbox .lightbox-nav {
    &::-webkit-scrollbar {
      height: 4px;
    }
  }
  
  .category-btn {
    padding: 10px 20px;
    font-size: 14px;
  }
  
  .fullscreen-image {
    max-width: 95vw;
    max-height: 85vh;
  }
  
  .nav-btn {
    width: 50px;
    height: 50px;
  }
  
  .prev-btn {
    left: 1rem;
  }
  
  .next-btn {
    right: 1rem;
  }
  
  .close-btn {
    top: 1rem;
    right: 1rem;
    width: 40px;
    height: 40px;
  }
}

/* Very small screens */
@media (max-width: 480px) {
  .header-image {
    margin-bottom: 0.5rem;
  }

  .logo-image {
    max-width: 180px;
  }

  .portfolio-section {
    padding: 0.25rem;
  }

  .wrapper {
    padding: 0.25rem;
    padding-bottom: 1rem;
    min-height: 45vh;
  }

  .gallery-container {
    padding: 0;
    width: 100%;
  }
  
  .lightbox {
    width: 100%;
    max-width: calc(100vw - 0.5rem);
    padding: 0.8rem;
    margin: 0 auto;
    margin-bottom: 1rem;
  }
  
  .gallery-container {
    gap: 1rem;
  }
  
  .category-nav {
    gap: 0.5rem;
  }
  
  .category-btn {
    padding: 8px 16px;
    font-size: 13px;
  }
  
  .lightbox .hero {
    min-height: 160px;
  }
  
  .site-footer {
    padding: 1rem;
  }
}

/* Extra narrow screens */
@media (max-width: 360px) {
  .portfolio-section {
    padding: 0.125rem;
  }

  .wrapper {
    padding: 0.125rem;
    padding-bottom: 0.5rem;
    min-height: 40vh;
  }

  .lightbox {
    width: 100%;
    max-width: calc(100vw - 0.25rem);
    padding: 0.5rem;
  }

  .category-nav {
    flex-wrap: wrap;
    justify-content: center;
    gap: 0.25rem;
  }

  .category-btn {
    padding: 6px 12px;
    font-size: 12px;
  }
}