/* ==========================================
   Gallery Page Specific Styles
   ========================================== */

/* Hero Section */
.gallery-hero {
  padding: 4rem 0;
  background: linear-gradient(135deg, #f0f9f4 0%, #ffffff 100%);
}

.gallery-hero-title {
  font-size: 3rem;
  margin-bottom: 1rem;
}

.gallery-hero-subtitle {
  font-size: 1.2rem;
  max-width: 800px;
  margin: 0 auto;
}

.gallery-section {
  margin-bottom: 4rem;
}

.gallery-section:last-child {
  margin-bottom: 0;
}

.gallery-section-header {
  margin-bottom: 2rem;
}

.gallery-section-title {
  font-size: 2rem;
}

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

/* Gallery Card */
.gallery-card {
  overflow: hidden;
  cursor: pointer;
  transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.gallery-card:hover {
  transform: translateY(-8px);
  box-shadow: 0 12px 32px rgba(0, 0, 0, 0.15);
}

.gallery-card-image {
  height: 250px;
  overflow: hidden;
  position: relative;
}

.gallery-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.3s ease;
}

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

.gallery-card-content {
  padding: 1.5rem;
}

.gallery-card-title {
  font-size: 1.2rem;
  color: #1a3d2b;
  margin-bottom: 0.5rem;
}

.gallery-card-description {
  font-size: 0.9rem;
  color: #666;
  line-height: 1.6;
}

/* Gallery Instruction */
.gallery-instruction {
  text-align: center;
  margin-top: 3rem;
  color: #666;
  font-style: italic;
  font-size: 0.95rem;
}

/* Section Header with Upload */
.section-header-with-upload {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 2rem;
}

.upload-btn-public {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.5rem 1rem;
  background: #198754;
  color: #fff;
  border-radius: 6px;
  text-decoration: none;
  font-size: 0.875rem;
  transition: all 0.2s;
}

.upload-btn-public:hover {
  background: #157347;
  color: #fff;
}

.gallery-section {
  margin-bottom: 4rem;
}

.section-divider {
  height: 1px;
  background: linear-gradient(to right, transparent, #dee2e6, transparent);
  margin: 3rem 0;
}

.gallery-manage-link {
  text-align: center;
  margin-top: 1.5rem;
}

.gallery-manage-link a {
  color: #6c757d;
  font-size: 0.875rem;
  text-decoration: none;
}

.gallery-creator-notice {
  background: #fff3cd;
  padding: 1rem;
  border-radius: 8px;
  margin-bottom: 2rem;
  text-align: center;
}

/* Instagram Notice */
.social-instagram-notice {
  background: linear-gradient(135deg, #fdf497 0%, #fdf497 5%, #fd5949 45%, #d6249f 60%, #285AEB 90%);
  padding: 1.5rem;
  border-radius: 12px;
  margin-bottom: 2rem;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 1rem;
  box-shadow: 0 4px 12px rgba(0,0,0,0.1);
}

.social-instagram-notice svg {
  flex-shrink: 0;
}

.social-instagram-notice p {
  margin: 0;
  color: #fff;
  font-size: 1rem;
  font-weight: 500;
  text-shadow: 0 1px 3px rgba(0,0,0,0.3);
}

.instagram-link {
  color: #fff;
  font-weight: 700;
  text-decoration: underline;
  transition: opacity 0.2s;
}

.instagram-link:hover {
  opacity: 0.9;
  color: #fff;
}

/* Instagram Post Cards */
.instagram-post-card {
  position: relative;
  cursor: pointer;
  text-decoration: none;
  color: inherit;
}

.instagram-post-card:hover .instagram-overlay {
  opacity: 1;
}

.instagram-overlay {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.7);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  opacity: 0;
  transition: opacity 0.3s;
  padding: 1rem;
}

.instagram-badge {
  background: #E4405F;
  color: #fff;
  padding: 0.5rem 1rem;
  border-radius: 20px;
  font-size: 0.875rem;
  font-weight: 600;
}

.instagram-caption {
  font-size: 0.875rem;
  line-height: 1.5;
}

/* Instagram Fallback (when API fails) */
.instagram-fallback {
  text-align: center;
  padding: 4rem 2rem;
  background: #f8f9fa;
  border-radius: 12px;
}

.instagram-fallback-icon {
  margin: 0 auto 1.5rem;
}

.instagram-fallback-title {
  color: #495057;
  margin-bottom: 1rem;
  font-size: 1.5rem;
}

.instagram-fallback-text {
  color: #6c757d;
  margin-bottom: 1.5rem;
  line-height: 1.8;
}

.instagram-fallback-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  margin-top: 1rem;
  background: linear-gradient(135deg, #f09433 0%,#e6683c 25%,#dc2743 50%,#cc2366 75%,#bc1888 100%);
  border: none;
}

.instagram-fallback-btn:hover {
  opacity: 0.9;
  transform: translateY(-2px);
}

/* CTA Section */
.gallery-cta-section {
  background: linear-gradient(135deg, #1e4d35 0%, #2c7a4b 100%);
  color: white;
  text-align: center;
}

.gallery-cta-title {
  font-size: 2.5rem;
  margin-bottom: 1.5rem;
  color: white;
}

.gallery-cta-description {
  font-size: 1.2rem;
  margin-bottom: 2.5rem;
  opacity: 0.95;
  max-width: 700px;
  margin-left: auto;
  margin-right: auto;
}

.gallery-cta-buttons {
  display: flex;
  gap: 1rem;
  justify-content: center;
  flex-wrap: wrap;
}

.gallery-cta-primary {
  background: #ffd166;
  color: #1a3d2b;
}

.gallery-cta-primary:hover {
  background: #ffbe3d;
  color: #1a3d2b;
}

.gallery-cta-secondary {
  background: transparent;
  border-color: white;
  color: white;
}

.gallery-cta-secondary:hover {
  background: rgba(255, 255, 255, 0.1);
  color: white;
}

/* Lightbox Overlay - Added by base.js */
.lightbox-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.95);
  display: none;
  align-items: center;
  justify-content: center;
  z-index: 9999;
  cursor: pointer;
  animation: fadeIn 0.3s ease;
}

.lightbox-overlay.active {
  display: flex;
}

.lightbox-image {
  max-width: 90%;
  max-height: 90%;
  object-fit: contain;
  border-radius: 8px;
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.5);
  animation: zoomIn 0.3s ease;
}

.lightbox-close {
  position: absolute;
  top: 20px;
  right: 30px;
  font-size: 3rem;
  color: white;
  font-weight: 300;
  cursor: pointer;
  transition: transform 0.3s ease;
  line-height: 1;
  user-select: none;
}

.lightbox-close:hover {
  transform: scale(1.2) rotate(90deg);
}

.lightbox-caption {
  position: absolute;
  bottom: 30px;
  left: 50%;
  transform: translateX(-50%);
  background: rgba(0, 0, 0, 0.8);
  color: white;
  padding: 1rem 2rem;
  border-radius: 8px;
  font-size: 1.1rem;
  text-align: center;
  max-width: 80%;
}

/* Lightbox Animations */
@keyframes fadeIn {
  from {
    opacity: 0;
  }
  to {
    opacity: 1;
  }
}

@keyframes zoomIn {
  from {
    transform: scale(0.8);
    opacity: 0;
  }
  to {
    transform: scale(1);
    opacity: 1;
  }
}

/* Responsive Design */
@media (max-width: 768px) {
  .gallery-hero-title {
    font-size: 2.5rem;
  }

  .gallery-hero-subtitle {
    font-size: 1.1rem;
  }

  .gallery-section-title {
    font-size: 1.75rem;
  }

  .gallery-grid {
    grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
    gap: 1.25rem;
  }

  .gallery-card-image {
    height: 200px;
  }

  .gallery-cta-title {
    font-size: 2rem;
  }

  .gallery-cta-description {
    font-size: 1.1rem;
  }

  .lightbox-close {
    top: 10px;
    right: 20px;
    font-size: 2.5rem;
  }

  .lightbox-caption {
    bottom: 20px;
    font-size: 1rem;
    padding: 0.75rem 1.5rem;
  }
}

@media (max-width: 576px) {
  .gallery-hero {
    padding: 3rem 0;
  }

  .gallery-hero-title {
    font-size: 2rem;
  }

  .gallery-hero-subtitle {
    font-size: 1rem;
  }

  .gallery-section-title {
    font-size: 1.5rem;
  }

  .gallery-grid {
    grid-template-columns: 1fr;
    gap: 1rem;
  }

  .gallery-card-image {
    height: 250px;
  }

  .gallery-instruction {
    font-size: 0.9rem;
    margin-top: 2rem;
  }

  .gallery-cta-title {
    font-size: 1.75rem;
  }

  .gallery-cta-description {
    font-size: 1rem;
  }

  .gallery-cta-buttons {
    flex-direction: column;
  }

  .gallery-cta-buttons .btn-primary,
  .gallery-cta-buttons .btn-secondary {
    width: 100%;
  }

  .lightbox-image {
    max-width: 95%;
    max-height: 80%;
  }

  .lightbox-close {
    top: 5px;
    right: 10px;
    font-size: 2rem;
  }

  .lightbox-caption {
    bottom: 10px;
    font-size: 0.9rem;
    padding: 0.5rem 1rem;
    max-width: 90%;
  }
}

/* Print Styles */
@media print {
  .gallery-cta-section,
  .lightbox-overlay {
    display: none !important;
  }

  .gallery-card {
    break-inside: avoid;
    page-break-inside: avoid;
  }
}
