/* Page-Specific Styles */

/* Home Page - Carousel */
.carousel-container {
  position: relative;
  max-width: 800px;
  margin: 2rem auto;
  border-radius: 8px;
  overflow: visible; /* allow prev/next buttons to sit outside the image */
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

.carousel {
  position: relative;
  width: 100%;
  height: 400px;
  background-color: #f0f0f0;
  overflow: hidden;
}

body.dark-mode .carousel {
  background-color: #333;
}

.carousel-item {
  display: none;
  width: 100%;
  height: 100%;
  position: absolute;
  top: 0;
  left: 0;
  align-items: center;
  justify-content: center;
}

.carousel-item.active {
  display: flex;
  animation: fadeIn 0.5s;
}

.carousel-item img {
  width: 100%;
  height: 100%;
  object-fit: contain;
}

.carousel-empty,
.gallery-empty {
  display: grid;
  place-items: center;
  min-height: 240px;
  color: var(--text-secondary);
  font-size: 1.05rem;
}

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

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

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

.carousel-dot.active {
  background-color: white;
}

.carousel-button,
.modal-nav-button {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  width: 3.5rem;
  height: 3.5rem;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(135deg, rgba(108, 99, 255, 0.96) 0%, rgba(255, 0, 110, 0.96) 100%);
  color: #fff;
  border: 1px solid rgba(255, 255, 255, 0.28);
  font-size: 2rem;
  padding: 0;
  cursor: pointer;
  border-radius: 999px;
  box-shadow: 0 12px 28px rgba(0, 0, 0, 0.28);
  backdrop-filter: blur(10px);
  transition: transform 0.2s ease, box-shadow 0.2s ease, filter 0.2s ease;
  z-index: 10;
}

.carousel-button:hover,
.modal-nav-button:hover {
  filter: brightness(1.08);
  box-shadow: 0 16px 34px rgba(0, 0, 0, 0.35);
  transform: translateY(-50%) scale(1.05);
}

.carousel-prev {
  left: -4.75rem; /* move further left outside the card */
}

.carousel-next {
  right: -4.75rem; /* move further right outside the card */
}

.carousel-counter {
  position: absolute;
  left: 50%;
  bottom: 1rem;
  transform: translateX(-50%);
  padding: 0.4rem 0.8rem;
  border-radius: 999px;
  background: rgba(15, 15, 18, 0.55);
  color: #fff;
  font-size: 0.85rem;
  letter-spacing: 0.06em;
  backdrop-filter: blur(10px);
  z-index: 10;
}

/* Gallery Page */
.gallery-container {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 1.5rem;
  padding: 2rem 0;
}

.gallery-load-more-wrap {
  padding-bottom: 1rem;
}

.gallery-load-more[hidden] {
  display: none !important;
}

.gallery-item {
  position: relative;
  cursor: pointer;
  border-radius: 8px;
  overflow: hidden;
  box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
  transition: transform 0.25s ease, box-shadow 0.25s ease;
  will-change: transform;
}

.gallery-item:hover {
  transform: scale(1.05);
  box-shadow: 0 8px 16px rgba(0, 0, 0, 0.2);
}

.gallery-item img {
  width: 100%;
  height: 250px;
  object-fit: cover;
  display: block;
}

.gallery-item:focus-visible,
.carousel-button:focus-visible,
.modal-nav-button:focus-visible,
.modal-close:focus-visible {
  outline: 3px solid rgba(255, 255, 255, 0.85);
  outline-offset: 3px;
}

.gallery-overlay {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background-color: rgba(108, 99, 255, 0.8);
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  transition: opacity 0.3s ease;
  color: white;
  font-size: 18px;
}

.gallery-item:hover .gallery-overlay {
  opacity: 1;
}

/* Image Modal */
.image-modal {
  display: none;
  position: fixed;
  z-index: 1000;
  left: 0;
  top: 0;
  width: 100%;
  height: 100%;
  background-color: rgba(0, 0, 0, 0.8);
  overflow: auto;
}

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

.modal-content {
  position: relative;
  max-width: 90%;
  max-height: 90vh;
  border-radius: 8px;
  overflow: hidden;
}

.modal-content img {
  display: block;
  width: auto;
  height: auto;
  max-width: calc(100vw - 160px);
  max-height: calc(100vh - 160px);
  object-fit: contain;
}

.modal-close {
  position: absolute;
  top: 20px;
  right: 30px;
  color: white;
  font-size: 40px;
  cursor: pointer;
  background: none;
  border: none;
  transition: color 0.3s;
}

.modal-close:hover {
  color: #ff006e;
}

.modal-nav-button {
  font-size: 2rem;
}

.modal-prev {
  left: 1rem;
}

.modal-next {
  right: 1rem;
}

/* About Page */
.about-section {
  margin-bottom: 3rem;
}

.about-section h2 {
  margin-bottom: 1rem;
  border-bottom: 3px solid #6c63ff;
  padding-bottom: 0.5rem;
}

.about-text {
  font-size: 1.1rem;
  line-height: 1.8;
}

.about-footer {
  text-align: center;
  margin-top: 3rem;
  padding-top: 2rem;
  border-top: 2px solid #ddd;
  color: var(--text-secondary);
  font-size: 0.95rem;
}

body.dark-mode .about-footer {
  border-top-color: #444;
  color: #aaa;
}

/* Members Page */
.members-container {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 2rem;
  padding: 2rem 0;
}

.member-card {
  background-color: #f8f9fa;
  border-radius: 8px;
  padding: 1.5rem;
  box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
  transition: transform 0.3s ease, box-shadow 0.3s ease;
  border-left: 4px solid #6c63ff;
  display: flex;
  align-items: center;
  gap: 1.5rem;
}

body.dark-mode .member-card {
  background-color: #2a2a2a;
  box-shadow: 0 4px 8px rgba(0, 0, 0, 0.3);
}

.member-card:hover {
  transform: translateY(-5px);
  box-shadow: 0 8px 16px rgba(0, 0, 0, 0.2);
}

.member-info {
  flex: 1;
}

.member-title {
  color: #6c63ff;
  font-size: 1.1rem;
  font-weight: bold;
  margin-bottom: 0.5rem;
}

.member-name {
  font-size: 1.3rem;
  font-weight: bold;
  color: var(--text-primary);
}

.member-pfp {
  flex-shrink: 0;
  width: 120px;
  height: 120px;
  border-radius: 8px;
  background-color: rgba(108, 99, 255, 0.1);
  background-size: cover;
  background-position: center;
  border: 2px solid #6c63ff;
  overflow: hidden;
}

body.dark-mode .member-pfp {
  background-color: rgba(108, 99, 255, 0.15);
}

/* Music Page */
.music-container {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 2rem;
  padding: 2rem 0;
}

.music-card {
  background-color: #f8f9fa;
  border-radius: 8px;
  padding: 1.5rem;
  box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
  transition: transform 0.3s ease, box-shadow 0.3s ease;
  border-left: 4px solid #6c63ff;
  display: flex;
  align-items: center;
  gap: 1.5rem;
  text-decoration: none;
  color: inherit;
}

body.dark-mode .music-card {
  background-color: #2a2a2a;
  box-shadow: 0 4px 8px rgba(0, 0, 0, 0.3);
}

.music-card:hover {
  transform: translateY(-5px);
  box-shadow: 0 8px 16px rgba(0, 0, 0, 0.2);
  text-decoration: none;
  color: inherit;
}

.music-card--youtube {
  border-left-color: #ff0000;
}

.music-card--youtube .music-platform-icon {
  color: #ff0000;
}

.music-card--youtube .music-platform {
  color: #ff0000;
}

.music-card--spotify {
  border-left-color: #1db954;
}

.music-card--spotify .music-platform-icon {
  color: #1db954;
}

.music-card--spotify .music-platform {
  color: #1db954;
}

.music-card--soundcloud {
  border-left-color: #ff5500;
}

.music-card--soundcloud .music-platform-icon {
  color: #ff5500;
}

.music-card--soundcloud .music-platform {
  color: #ff5500;
}

.music-platform-icon {
  flex-shrink: 0;
  width: 64px;
  height: 64px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.music-platform-icon svg {
  width: 100%;
  height: 100%;
}

.music-info {
  flex: 1;
  min-width: 0;
}

.music-platform {
  font-size: 0.9rem;
  font-weight: bold;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin-bottom: 0.25rem;
}

.music-name {
  font-size: 1.3rem;
  font-weight: bold;
  color: var(--text-primary);
  margin-bottom: 0.25rem;
}

.music-handle {
  font-size: 0.95rem;
  color: var(--text-secondary, #666);
  word-break: break-all;
}

body.dark-mode .music-handle {
  color: #aaa;
}

.music-pfp {
  width: 80px;
  height: 80px;
  margin-left: auto;
  border-radius: 50%;
  object-fit: cover;
  flex-shrink: 0;
}

/* Settings Page */
.settings-container {
  max-width: 500px;
  margin: 2rem auto;
}

.settings-group {
  background-color: var(--bg-secondary);
  border-radius: 8px;
  padding: 2rem;
  margin-bottom: 2rem;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
  border: 1px solid var(--border-color);
}

body.dark-mode .settings-group {
  background-color: var(--bg-secondary);
}

/* Improve readability for muted/smaller text inside settings groups in dark mode */
body.dark-mode .settings-group small,
body.dark-mode .settings-group .text-muted,
body.dark-mode .settings-group p {
  color: var(--text-secondary) !important;
  opacity: 1 !important;
}

/* Make warning reset box text more readable in dark mode */
.settings-group.bg-warning {
  color: var(--text-primary);
}
.settings-group.bg-warning .text-muted,
.settings-group.bg-warning small {
  color: rgba(255, 238, 170, 0.9);
}

.settings-group h3 {
  margin-top: 0;
}

.theme-options {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.theme-option {
  display: flex;
  align-items: center;
}

.theme-option input[type="radio"] {
  margin-right: 0.5rem;
  width: 20px;
  height: 20px;
  cursor: pointer;
}

.theme-option label {
  cursor: pointer;
  flex: 1;
  font-size: 1rem;
}

.theme-preview {
  width: 40px;
  height: 40px;
  border-radius: 4px;
  margin-left: auto;
}

.theme-preview.light {
  background-color: #ffffff;
  border: 2px solid #ddd;
}

.theme-preview.dark {
  background-color: #1a1a1a;
  border: 2px solid #555;
}

.theme-preview.device {
  background: linear-gradient(135deg, #ffffff 50%, #1a1a1a 50%);
  border: 2px solid #999;
}

/* Responsive */
@media (max-width: 768px) {
  .carousel {
    height: 250px;
  }

  .gallery-container {
    grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
  }

  .members-container {
    grid-template-columns: 1fr;
  }

  .member-card {
    flex-direction: column;
    text-align: center;
  }

  .member-pfp {
    width: 100px;
    height: 100px;
  }

  .music-container {
    grid-template-columns: 1fr;
  }

  .music-card {
    flex-direction: column;
    text-align: center;
  }

  .music-pfp {
    margin-left: 0;
    width: 100px;
    height: 100px;
  }

  .carousel-button {
    width: 2.75rem;
    height: 2.75rem;
    font-size: 1.6rem;
  }

  .carousel-counter {
    bottom: 0.75rem;
    font-size: 0.75rem;
  }

  .modal-content {
    max-width: 95%;
    height: auto;
    display: grid;
    grid-template-columns: 1fr 1fr;
    grid-template-rows: auto auto auto;
    gap: 1rem;
    align-items: center;
    justify-items: center;
  }

  .modal-close {
    grid-column: 2;
    grid-row: 1;
    justify-self: end;
    position: absolute;
    top: 10px;
    right: 10px;
  }

  .modal-content img {
    grid-column: 1 / -1;
    grid-row: 2;
    max-width: 90vw;
    max-height: calc(100vh - 200px);
  }

  .modal-prev {
    grid-column: 1;
    grid-row: 3;
    position: static;
    transform: none;
    left: auto;
    bottom: auto;
  }

  .modal-next {
    grid-column: 2;
    grid-row: 3;
    position: static;
    transform: none;
    right: auto;
    bottom: auto;
  }

  /* Override hover behavior - just scale, no vertical movement on small screens */
  .modal-nav-button:hover {
    filter: brightness(1.08);
    box-shadow: 0 16px 34px rgba(0, 0, 0, 0.35);
    transform: scale(1.05);
  }

  /* On small screens keep carousel buttons inside the image to avoid overflow */
  .carousel-prev {
    left: 0.5rem;
  }

  .carousel-next {
    right: 0.5rem;
  }
}
