/* 
 * COMPONENT STYLES
 * Reusable components: buttons, theme switcher, etc.
 */

/* Button styles */
.btn {
  padding: .8rem 1.4rem;
  border-radius: 999px;
  font-weight: 600;
  display: inline-block;
  margin: .5rem;
  border: none;
  cursor: pointer;
  transition: all .3s ease;
  position: relative;
  overflow: hidden;
}

.btn.primary {
  background: linear-gradient(135deg, var(--brand), var(--brand-2));
  color: #fff;
}

.btn.ghost {
  border: 1px solid #333;
  background: transparent;
  color: #fff;
}

.btn::before {
  content: "";
  position: absolute;
  top: 0;
  left: -100%;
  width: 100%;
  height: 100%;
  background: rgba(255, 255, 255, .2);
  transition: all .4s ease;
}

.btn:hover::before {
  left: 100%;
}

.btn:hover {
  transform: translateY(-3px);
  box-shadow: 0 6px 20px rgba(0, 0, 0, .4);
}

/* Theme switcher */
.theme-switcher {
  position: relative;
}

.theme-switcher button {
  background: none;
  border: none;
  color: inherit;
  font-size: .8rem;
  cursor: pointer;
  padding: .3rem .7rem;
  border-radius: 999px;
  transition: background .3s ease, color .3s ease;
}

.theme-switcher button:hover {
  background: rgba(255, 255, 255, .1);
  color: var(--brand-2);
}

.theme-menu {
  position: absolute;
  top: 120%;
  right: 0;
  display: none;
  flex-direction: column;
  gap: .2rem;
  background: rgba(0, 0, 0, .85);
  backdrop-filter: blur(10px);
  border-radius: 12px;
  padding: .4rem;
  z-index: 50;
}

.theme-menu.show {
  display: flex;
}

/* ========== GALLERY ========== */

.gallery {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 1.5rem;
  margin-top: 2rem;
}

.gallery-item {
  position: relative;
  border-radius: var(--radius);
  overflow: hidden;
  cursor: pointer;
  transition: transform .3s ease, box-shadow .3s ease;
  aspect-ratio: 1/1;
  background: #000;
}

.gallery-item:hover {
  transform: translateY(-5px);
  box-shadow: 0 15px 40px rgba(0, 0, 0, .7);
}

.gallery-item img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  transition: transform .5s ease;
}

.gallery-item:hover img {
  transform: scale(1.1);
}

.gallery-item-overlay {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  background: linear-gradient(to top, rgba(0, 0, 0, .9), transparent);
  padding: 1.5rem 1rem;
  transform: translateY(100%);
  transition: transform .3s ease;
}

.gallery-item:hover .gallery-item-overlay {
  transform: translateY(0);
}

.gallery-item-title {
  font-weight: 600;
  font-size: 1rem;
  color: #fff;
  margin-bottom: .3rem;
}

/* ========== LIGHTBOX ========== */

.lightbox {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, .95);
  display: none;
  align-items: center;
  justify-content: center;
  z-index: 1000;
  animation: fadeIn .3s ease;
}

.lightbox.active {
  display: flex;
}

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

.lightbox-content {
  max-width: 90%;
  max-height: 90%;
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
}

.lightbox-content img {
  max-width: 100%;
  max-height: 85vh;
  border-radius: 8px;
  box-shadow: 0 20px 60px rgba(0, 0, 0, .8);
}

.gallery-item-credit {
  font-size: .75rem;
  opacity: .8;
}

.gallery-item-credit a {
  color: var(--brand-2);
  text-decoration: underline;
}

.lightbox-credit {
  font-size: .8rem;
  opacity: .75;
  margin-top: .25rem;
}

.lightbox-credit a {
  color: var(--brand-2);
  text-decoration: underline;
}

.lightbox-close {
  position: fixed;
  top: 20px;
  right: 20px;
  background: rgba(255, 255, 255, .1);
  border: none;
  color: #fff;
  font-size: 2rem;
  width: 50px;
  height: 50px;
  border-radius: 50%;
  cursor: pointer;
  transition: all .3s ease;
  backdrop-filter: blur(10px);
  display: flex;
  align-items: center;
  justify-content: center;
}

.lightbox-close:hover {
  background: rgba(255, 255, 255, .2);
  transform: rotate(90deg);
}

.lightbox-nav {
  position: fixed;
  top: 50%;
  transform: translateY(-50%);
  background: rgba(255, 255, 255, .1);
  border: none;
  color: #fff;
  font-size: 2rem;
  width: 50px;
  height: 50px;
  border-radius: 50%;
  cursor: pointer;
  transition: all .3s ease;
  backdrop-filter: blur(10px);
  display: flex;
  align-items: center;
  justify-content: center;
}

.lightbox-nav:hover {
  background: rgba(255, 255, 255, .2);
}

.lightbox-prev {
  left: 20px;
}

.lightbox-next {
  right: 20px;
}

.lightbox-caption {
  margin-top: 1rem;
  background: rgba(0, 0, 0, .7);
  padding: .8rem 1.5rem;
  border-radius: 999px;
  color: #fff;
  font-weight: 600;
  backdrop-filter: blur(10px);
  text-align: center;
}

.lightbox-counter {
  font-size: .85rem;
  color: #999;
  margin-top: .5rem;
}

@media (max-width: 768px) {
  .lightbox-content img {
    max-height: 75vh;
  }

  .lightbox-nav {
    top: auto;
    bottom: 24px;
    transform: none;
  }

  .lightbox-prev {
    left: 24px;
  }

  .lightbox-next {
    right: 24px;
  }
}
