/* Image Detail Page - Modern Museum Style for CAIW */

/* Image Detail Layout */
.image-detail {
  display: grid;
  grid-template-columns: 1fr 450px;
  gap: 3rem;
  margin-top: 2rem;
  position: relative;
}

/* Image Section */
.image-section {
  position: sticky;
  top: 100px;
  height: fit-content;
}

.main-image-wrapper {
  background: var(--museum-ivory);
  border: 1px solid var(--border-light);
  border-radius: 12px;
  overflow: hidden;
  box-shadow: var(--shadow-lg);
  transition: all var(--transition-base);
  position: relative;
}

.main-image-wrapper:hover {
  box-shadow: var(--shadow-xl);
  transform: translateY(-4px);
}

.main-image {
  width: 100%;
  height: auto;
  display: block;
  transition: transform var(--transition-slow);
  cursor: zoom-in;
}

.main-image:hover {
  transform: scale(1.02);
}

/* Gallery for multiple images */
.gallery-item {
  display: none;
  position: relative;
  width: 100%;
  height: auto;
}

.gallery-item.active {
  display: block;
}

.gallery-item img {
  width: 100%;
  height: auto;
  display: block;
  cursor: zoom-in;
}

/* Gallery thumbnails */
.gallery-thumbnails {
  display: flex;
  gap: 12px;
  padding: 1.5rem;
  background: linear-gradient(to bottom, var(--header-cream), var(--museum-ivory));
  border-top: 1px solid var(--border-medium);
  overflow-x: auto;
  scrollbar-width: thin;
  scrollbar-color: var(--noble-gold) var(--museum-ivory);
  position: relative;
}

.gallery-thumbnails::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 2px;
  background: linear-gradient(90deg, var(--noble-gold) 0%, transparent 50%, var(--noble-gold) 100%);
  background-size: 200% 100%;
  animation: shimmer 8s linear infinite;
}

.gallery-thumbnails::-webkit-scrollbar {
  height: 8px;
}

.gallery-thumbnails::-webkit-scrollbar-track {
  background: var(--museum-ivory);
  border-radius: 4px;
}

.gallery-thumbnails::-webkit-scrollbar-thumb {
  background: var(--noble-gold);
  border-radius: 4px;
}

.gallery-thumbnail {
  flex-shrink: 0;
  width: 80px;
  height: 80px;
  border-radius: 8px;
  overflow: hidden;
  cursor: pointer;
  border: 2px solid transparent;
  transition: all var(--transition-fast);
  position: relative;
}

.gallery-thumbnail:hover {
  border-color: var(--noble-gold);
  transform: translateY(-4px);
  box-shadow: var(--shadow-md);
}

.gallery-thumbnail.active {
  border-color: var(--noble-gold);
  box-shadow: 0 0 0 4px rgba(212, 175, 55, 0.2);
}

.gallery-thumbnail img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform var(--transition-fast);
}

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

/* Gallery Navigation */
.gallery-navigation {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  width: 100%;
  display: flex;
  justify-content: space-between;
  padding: 0 1rem;
  pointer-events: none;
  z-index: 10;
}

.gallery-nav {
  position: absolute;
  bottom: 1rem;
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  align-items: center;
  gap: 1rem;
  background: rgba(0, 0, 0, 0.7);
  padding: 0.5rem 1rem;
  border-radius: 8px;
  backdrop-filter: blur(10px);
  z-index: 10;
}

.gallery-prev,
.gallery-next {
  background: var(--noble-gold);
  color: white;
  border: none;
  padding: 0.5rem 1rem;
  border-radius: 6px;
  font-size: 0.9rem;
  font-weight: 600;
  cursor: pointer;
  transition: all var(--transition-fast);
  display: flex;
  align-items: center;
  justify-content: center;
}

.gallery-prev:hover,
.gallery-next:hover {
  background: #c4a032;
  transform: translateY(-2px);
}

.gallery-prev:disabled,
.gallery-next:disabled {
  opacity: 0.3;
  cursor: not-allowed;
  background: #666;
}

.gallery-counter {
  color: white;
  font-size: 0.9rem;
  font-weight: 500;
  min-width: 60px;
  text-align: center;
}

.gallery-nav-btn {
  background: rgba(44, 44, 44, 0.8);
  color: white;
  border: none;
  width: 48px;
  height: 48px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all var(--transition-fast);
  pointer-events: all;
  backdrop-filter: blur(10px);
}

.gallery-nav-btn:hover {
  background: var(--noble-gold);
  transform: scale(1.1);
}

.gallery-nav-btn:disabled {
  opacity: 0.3;
  cursor: not-allowed;
}

.gallery-nav-btn:disabled:hover {
  background: rgba(44, 44, 44, 0.8);
  transform: none;
}

/* Info Section */
.info-section {
  background: var(--museum-ivory);
  border: 1px solid var(--border-light);
  border-radius: 12px;
  padding: 2.5rem;
  box-shadow: var(--shadow-sm);
  height: fit-content;
  position: sticky;
  top: 100px;
  width: 100%;
  max-width: 450px;
  overflow: hidden;
}

/* Artwork Header */
.artwork-header {
  margin-bottom: 2rem;
  padding-bottom: 1.5rem;
  border-bottom: 1px solid var(--border-light);
}

.image-title {
  font-family: 'Playfair Display', Georgia, serif;
  font-size: 2.5rem;
  font-weight: 700;
  color: var(--text-primary);
  line-height: 1.2;
  margin-bottom: 1rem;
}

.artwork-meta {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 1rem;
}

.creator-info {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
}

.creator-label {
  font-size: 0.85rem;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.5px;
  font-weight: 500;
}

.creator-name {
  font-size: 1.1rem;
  color: var(--text-primary);
  font-weight: 600;
}

.artwork-stats {
  display: flex;
  align-items: center;
  gap: 1rem;
}

.like-btn {
  background: transparent;
  border: 2px solid var(--noble-gold);
  color: var(--noble-gold);
  padding: 0.75rem 1.25rem;
  border-radius: 8px;
  display: flex;
  align-items: center;
  gap: 0.5rem;
  cursor: pointer;
  transition: all var(--transition-fast);
  font-size: 0.95rem;
  font-weight: 600;
}

.like-btn:hover {
  background: var(--noble-gold);
  color: white;
  transform: translateY(-2px);
  box-shadow: var(--shadow-md);
}

.like-btn.liked {
  background: var(--noble-gold);
  color: white;
}

/* Section Titles */
.section-title {
  font-family: 'Playfair Display', Georgia, serif;
  font-size: 1.3rem;
  font-weight: 600;
  color: var(--text-primary);
  margin-bottom: 1rem;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.section-description {
  color: var(--text-secondary);
  font-family: 'Cormorant Garamond', Georgia, serif;
  font-style: italic;
  font-size: 1rem;
  line-height: 1.8;
  margin-bottom: 1.5rem;
}

/* Tags */
.artwork-tags {
  margin-bottom: 2rem;
}

.tags {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  align-items: center;
}

.tag {
  background: rgba(212, 175, 55, 0.1);
  color: var(--noble-gold);
  padding: 0.5rem 1rem;
  border-radius: 20px;
  font-size: 0.85rem;
  font-weight: 500;
  border: 1px solid rgba(212, 175, 55, 0.2);
  transition: all var(--transition-fast);
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
  margin: 0.1rem;
  white-space: nowrap;
}

.tag:hover {
  background: var(--noble-gold);
  color: white;
  transform: translateY(-2px);
}

.tag-icon {
  font-weight: 700;
  opacity: 0.8;
}

.tag-text {
  font-weight: 500;
}

/* Prompts Section */
.prompts-section {
  margin-bottom: 2rem;
  padding: 1.5rem;
  background: linear-gradient(135deg, rgba(212, 175, 55, 0.05), rgba(212, 175, 55, 0.02));
  border: 1px solid rgba(212, 175, 55, 0.2);
  border-radius: 8px;
  width: 100%;
  max-width: 100%;
  overflow: hidden;
}

.prompt-list {
  display: flex;
  flex-direction: column;
  gap: 1rem;
  width: 100%;
}

.prompt-item {
  background: white;
  border: 1px solid var(--border-light);
  border-radius: 8px;
  padding: 1rem;
  position: relative;
  transition: all var(--transition-fast);
  max-width: 100%;
  overflow: hidden;
}

.prompt-item:hover {
  border-color: var(--noble-gold);
  box-shadow: var(--shadow-sm);
}

.prompt-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 0.75rem;
  white-space: nowrap;
}

.prompt-title {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--text-primary);
}

.prompt-number {
  background: var(--noble-gold);
  color: white;
  padding: 0.2rem 0.5rem;
  border-radius: 12px;
  font-size: 0.75rem;
  font-weight: 700;
}

.prompt-language {
  font-size: 1rem;
}

.prompt-title h3 {
  margin: 0;
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--text-primary);
}

.prompt-actions {
  display: flex;
  align-items: center;
  flex-shrink: 0;
}

.prompt-text {
  font-family: 'Inter', monospace;
  font-size: 0.9rem;
  color: var(--text-primary);
  line-height: 1.6;
  margin-bottom: 0.5rem;
  word-wrap: break-word;
  overflow-wrap: break-word;
  white-space: pre-wrap;
  word-break: break-word;
  hyphens: auto;
  max-width: 100%;
  max-height: 400px;
  overflow-y: auto;
  padding-right: 0.5rem;
  scrollbar-width: thin;
  scrollbar-color: var(--noble-gold) var(--museum-ivory);
}

.prompt-text::-webkit-scrollbar {
  width: 6px;
}

.prompt-text::-webkit-scrollbar-track {
  background: var(--museum-ivory);
  border-radius: 3px;
}

.prompt-text::-webkit-scrollbar-thumb {
  background: var(--noble-gold);
  border-radius: 3px;
}

.prompt-text::-webkit-scrollbar-thumb:hover {
  background: #c4a032;
}

.prompt-copy,
.copy-btn {
  background: var(--noble-gold);
  color: white;
  border: none;
  padding: 0.4rem 0.8rem;
  border-radius: 6px;
  font-size: 0.8rem;
  cursor: pointer;
  transition: all var(--transition-fast);
  display: flex;
  align-items: center;
  gap: 0.4rem;
}

.prompt-copy:hover,
.copy-btn:hover {
  background: #c4a032;
  transform: translateY(-2px);
}

.prompt-copy.copied,
.copy-btn.copied {
  background: var(--deep-wine);
}

/* Share Section */
.share-section {
  margin-top: 2rem;
}

.share-buttons {
  display: flex;
  flex-wrap: wrap;
  gap: 1rem;
}

.share-btn {
  background: transparent;
  border: 2px solid var(--border-medium);
  color: var(--text-primary);
  padding: 0.75rem 1.25rem;
  border-radius: 8px;
  text-decoration: none;
  font-size: 0.9rem;
  font-weight: 500;
  cursor: pointer;
  transition: all var(--transition-fast);
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.share-btn:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-md);
}

.share-btn.twitter:hover {
  background: #1da1f2;
  border-color: #1da1f2;
  color: white;
}

.share-btn.facebook:hover {
  background: #1877f2;
  border-color: #1877f2;
  color: white;
}

.share-btn.pinterest:hover {
  background: #e60023;
  border-color: #e60023;
  color: white;
}

.share-btn.copy-link:hover {
  background: var(--text-primary);
  border-color: var(--text-primary);
  color: white;
}

.share-btn.copied {
  background: var(--deep-wine);
  border-color: var(--deep-wine);
  color: white;
}

/* Responsive Design */
@media (max-width: 1200px) {
  .image-detail {
    grid-template-columns: 1fr 380px;
    gap: 2rem;
  }

  .image-title {
    font-size: 2rem;
  }
}

@media (max-width: 768px) {
  .image-detail {
    grid-template-columns: 1fr;
    gap: 2rem;
  }

  .image-section {
    position: static;
  }

  .info-section {
    position: static;
    padding: 2rem 1.5rem;
  }

  .image-title {
    font-size: 1.8rem;
  }

  .artwork-meta {
    flex-direction: column;
    align-items: flex-start;
    gap: 1rem;
  }

  .like-btn {
    align-self: flex-start;
  }

  .gallery-thumbnails {
    padding: 1rem;
    gap: 8px;
    padding-bottom: 4rem;
  }

  .gallery-thumbnail {
    width: 60px;
    height: 60px;
  }

  .gallery-nav {
    bottom: 1rem;
    padding: 0.4rem 0.8rem;
    gap: 0.75rem;
  }

  .gallery-prev,
  .gallery-next {
    padding: 0.4rem 0.8rem;
    font-size: 0.8rem;
  }

  .gallery-counter {
    font-size: 0.8rem;
  }

  .share-buttons {
    gap: 0.75rem;
  }

  .share-btn {
    padding: 0.6rem 1rem;
    font-size: 0.85rem;
  }
}

@media (max-width: 480px) {
  .image-title {
    font-size: 1.5rem;
  }

  .info-section {
    padding: 1.5rem 1rem;
  }

  .gallery-navigation {
    padding: 0 0.5rem;
  }

  .gallery-nav-btn {
    width: 40px;
    height: 40px;
  }

  /* .gallery-nav {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    transform: none;
    border-radius: 1rem 1rem 0 0;
    padding: 0.75rem;
  }

  .gallery-thumbnails {
    padding-bottom: 1rem;
  } */

  .share-buttons {
    flex-direction: column;
  }

  .share-btn {
    justify-content: center;
  }
}

/* Animations */
@keyframes shimmer {
  0% { background-position: -200% 0; }
  100% { background-position: 200% 0; }
}

/* Loading state */
.image-loading {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 400px;
  background: var(--museum-ivory);
  border-radius: 12px;
}

.image-loading .spinner {
  width: 48px;
  height: 48px;
  border: 3px solid var(--border-light);
  border-top-color: var(--noble-gold);
  border-radius: 50%;
  animation: spin 1s linear infinite;
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

/* Additional styles for consistency */
.section-title {
  font-family: 'Playfair Display', Georgia, serif;
  font-size: 1.3rem;
  font-weight: 600;
  color: var(--text-primary);
  margin-bottom: 1rem;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.section-description {
  color: var(--text-secondary);
  font-family: 'Cormorant Garamond', Georgia, serif;
  font-style: italic;
  font-size: 1rem;
  line-height: 1.8;
  margin-bottom: 1.5rem;
}

/* Mobile optimizations */
@media (max-width: 480px) {
  .artwork-header {
    padding: 1.5rem 1rem;
  }

  .image-title {
    font-size: 1.5rem;
  }

  .section-title {
    font-size: 1.1rem;
  }

  .section-description {
    font-size: 0.9rem;
  }

  .share-buttons {
    flex-direction: column;
  }

  .share-btn {
    width: 100%;
    justify-content: center;
  }
}