/* Festival Gallery Styles */

/* Password Screen */
.password-container {
  max-width: 400px;
  margin: 4rem auto;
  text-align: center;
  padding: 3rem 2rem;
  background: #fff;
  border-radius: 1rem;
  box-shadow: 0 10px 30px rgba(0, 0, 0, .08);
}

.password-container .title {
  margin-bottom: 1rem;
}

.password-container p {
  margin-bottom: 2rem;
  color: var(--text-color);
}

#password-form {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

#password-input {
  width: 100%;
  padding: 1rem;
  border: 2px solid #e4e4e4;
  border-radius: .75rem;
  font: 400 1rem var(--body-font);
  transition: border-color .2s;
}

#password-input:focus {
  outline: none;
  border-color: var(--base-color);
}

.error-message {
  color: #d32f2f;
  font-size: .9rem;
  margin-top: .5rem;
  min-height: 1.5rem;
}

/* Temporary Warning Banner */
.temp-warning-banner {
  background: linear-gradient(135deg, #ff9800, #f57c00);
  color: #fff;
  padding: 1.5rem;
  text-align: center;
  margin-bottom: 2rem;
  box-shadow: 0 4px 12px rgba(255, 152, 0, .3);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: .5rem;
}

.temp-warning-banner span:first-child {
  font-size: 2rem;
}

.temp-warning-banner strong {
  font-size: 1.1rem;
  font-weight: 700;
}

.temp-warning-banner span {
  font-size: .95rem;
  opacity: .95;
}

/* Gallery Header */
.gallery-header {
  margin-bottom: 2rem;
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
}

.gallery-header .title {
  text-align: center;
}

.gallery-controls {
  display: flex;
  flex-wrap: wrap;
  gap: 1rem;
  justify-content: center;
  align-items: center;
}

.button-secondary {
  background: #fff;
  color: var(--base-color);
  border: 2px solid var(--base-color);
  height: 3.5rem;
  display: inline-flex;
  align-items: center;
  gap: .5rem;
  padding: 0 2rem;
  border-radius: .75rem;
  font: 600 1rem var(--body-font);
  cursor: pointer;
  transition: all .2s ease;
}

.button-secondary:hover {
  background: var(--base-color-second);
  transform: translateY(-1px);
}

.button:disabled,
.button-secondary:disabled {
  opacity: .5;
  cursor: not-allowed;
  transform: none;
}

/* Gallery Grid */
.gallery-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 1.5rem;
  margin-bottom: 2rem;
}

.gallery-item {
  position: relative;
  aspect-ratio: 1;
  border-radius: .75rem;
  overflow: hidden;
  cursor: pointer;
  box-shadow: 0 4px 12px rgba(0, 0, 0, .1);
  transition: transform .2s ease, box-shadow .2s ease;
  background: #f5f5f5;
}

.gallery-item:hover {
  transform: translateY(-4px);
  box-shadow: 0 8px 20px rgba(0, 0, 0, .15);
}

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

.gallery-item.selected {
  border: 4px solid var(--base-color);
  box-shadow: 0 0 0 4px var(--base-color-second);
}

.gallery-item .checkbox {
  position: absolute;
  top: .75rem;
  left: .75rem;
  width: 28px;
  height: 28px;
  background: rgba(255, 255, 255, .9);
  border: 2px solid var(--base-color);
  border-radius: 4px;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  transition: opacity .2s;
  z-index: 10;
}

.gallery-item:hover .checkbox,
.gallery-item.selected .checkbox {
  opacity: 1;
}

.gallery-item.selected .checkbox {
  background: var(--base-color);
  color: #fff;
}

.gallery-item .download-overlay {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  background: linear-gradient(to top, rgba(0, 0, 0, .7), transparent);
  padding: 1rem;
  display: flex;
  justify-content: center;
  opacity: 0;
  transition: opacity .2s;
}

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

.gallery-item .download-btn {
  background: var(--base-color);
  color: #fff;
  border: none;
  padding: .5rem 1rem;
  border-radius: .5rem;
  font: 600 .9rem var(--body-font);
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: .5rem;
  transition: background .2s;
}

.gallery-item .download-btn:hover {
  background: var(--base-color-alt);
}

/* Loading and No Images */
.loading,
.no-images {
  text-align: center;
  padding: 4rem 2rem;
  color: var(--text-color);
}

.loading p,
.no-images p {
  font-size: 1.1rem;
}

/* Image Modal */
.image-modal {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, .95);
  z-index: 1000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 2rem;
  animation: fadeIn .2s;
}

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

.modal-content {
  position: relative;
  max-width: 90vw;
  max-height: 90vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1.5rem;
}

.modal-close {
  position: absolute;
  top: -3rem;
  right: 0;
  background: rgba(255, 255, 255, .2);
  color: #fff;
  border: none;
  width: 44px;
  height: 44px;
  border-radius: 50%;
  font-size: 1.5rem;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background .2s;
  z-index: 10;
}

.modal-close:hover {
  background: rgba(255, 255, 255, .3);
}

.modal-content img {
  max-width: 100%;
  max-height: 80vh;
  object-fit: contain;
  border-radius: .5rem;
  box-shadow: 0 10px 40px rgba(0, 0, 0, .5);
}

.modal-controls {
  display: flex;
  gap: 1rem;
}

/* Responsive */
@media (max-width: 768px) {
  .gallery-grid {
    grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
    gap: 1rem;
  }

  .gallery-controls {
    flex-direction: column;
  }

  .gallery-controls .button,
  .gallery-controls .button-secondary {
    width: 100%;
    justify-content: center;
  }

  .temp-warning-banner {
    padding: 1rem;
    font-size: .9rem;
  }

  .temp-warning-banner i {
    font-size: 1.5rem;
  }

  .modal-content {
    max-width: 95vw;
    padding: 1rem;
  }

  .modal-close {
    top: -2.5rem;
    width: 40px;
    height: 40px;
  }
}

