/* Modern Museum Style for CAIW - Creative AI Works */
/* Import Google Fonts */
@import url('https://fonts.googleapis.com/css2?family=Playfair+Display:ital,wght@0,400;0,700;0,900;1,400&family=Inter:wght@400;500;600;700&family=Cormorant+Garamond:ital,wght@0,400;0,500;0,600;1,400&display=swap');

/* Reset and base styles */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

:root {
  /* Museum color palette */
  --museum-cream: #faf8f5;
  --museum-ivory: #f5f5f0;
  --header-cream: #f2edd9;
  --text-primary: #2c2c2c;
  --text-secondary: #666666;
  --text-muted: #888888;
  --noble-gold: #d4af37;
  --deep-wine: #722f37;
  --border-light: #e8e6df;
  --border-medium: #d9d7ce;
  --shadow-sm: 0 1px 3px rgba(0, 0, 0, 0.05);
  --shadow-md: 0 4px 12px rgba(0, 0, 0, 0.08);
  --shadow-lg: 0 8px 24px rgba(0, 0, 0, 0.12);
  --shadow-xl: 0 16px 48px rgba(0, 0, 0, 0.15);
  --transition-fast: 0.2s ease;
  --transition-base: 0.3s ease;
  --transition-slow: 0.5s ease;
}

/* Typography system */
body {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  background: var(--museum-cream);
  color: var(--text-primary);
  line-height: 1.7;
  font-size: 16px;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

/* Museum-style background pattern */
body::before {
  content: '';
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background-image:
    radial-gradient(circle at 1px 1px, rgba(212, 175, 55, 0.03) 1px, transparent 0);
  background-size: 60px 60px;
  pointer-events: none;
  z-index: 0;
}

/* Container */
.container {
  max-width: 1400px;
  margin: 0 auto;
  padding: 0 2rem;
  position: relative;
  z-index: 1;
}

/* Typography */
h1, h2, h3, h4 {
  font-family: 'Playfair Display', Georgia, serif;
  font-weight: 700;
  color: var(--text-primary);
}

h1 {
  font-size: 3rem;
  font-weight: 800;
  line-height: 1.1;
  margin-bottom: 1rem;
}

h2 {
  font-size: 2.2rem;
  margin-bottom: 0.8rem;
}

h3 {
  font-size: 1.5rem;
  margin-bottom: 0.6rem;
}

h4 {
  font-size: 1.2rem;
  margin-bottom: 0.5rem;
}

/* Header Styles */
.header {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  background: var(--header-cream);
  border-bottom: 1px solid var(--border-medium);
  z-index: 1000;
  transition: box-shadow var(--transition-base);
}

.header.scrolled {
  box-shadow: var(--shadow-md);
}

.header-decoration {
  background: linear-gradient(90deg, var(--noble-gold) 0%, transparent 50%, var(--noble-gold) 100%);
  background-size: 200% 100%;
  animation: shimmer 8s linear infinite;
  height: 2px;
}

.golden-line {
  background: var(--noble-gold);
  height: 100%;
  width: 100%;
}

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

.header-content {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 1.2rem 2rem;
  max-width: 1400px;
  margin: 0 auto;
  gap: 2rem;
}

/* Logo */
.logo-link {
  display: flex;
  align-items: center;
  gap: 0.8rem;
  text-decoration: none;
  transition: all var(--transition-fast);
}

.logo-link:hover {
  transform: translateY(-2px);
}

.logo-image {
  height: 45px;
  width: auto;
  display: block;
  border-radius: 4px;
  box-shadow: var(--shadow-sm);
}

.logo-text {
  display: flex;
  flex-direction: column;
}

.logo-main {
  font-family: 'Playfair Display', Georgia, serif;
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--text-primary);
  line-height: 1;
  letter-spacing: 0.5px;
}

.logo-sub {
  font-size: 0.75rem;
  color: var(--text-secondary);
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 1px;
  margin-top: 2px;
}

/* Navigation */
.nav {
  display: flex;
  gap: 1.5rem;
}

.nav-link {
  text-decoration: none;
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 0.5rem 1rem;
  border-radius: 4px;
  transition: all var(--transition-fast);
  position: relative;
}

.nav-link:hover {
  background: rgba(212, 175, 55, 0.1);
  transform: translateY(-2px);
}

.nav-link.active {
  background: rgba(212, 175, 55, 0.15);
}

.nav-link.active::after {
  content: '';
  position: absolute;
  bottom: -8px;
  left: 50%;
  transform: translateX(-50%);
  width: 20px;
  height: 2px;
  background: var(--noble-gold);
}

.nav-text {
  font-family: 'Inter', sans-serif;
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--text-primary);
}

/* Search */
.search-container {
  flex: 1;
  max-width: 400px;
}

.search-wrapper {
  position: relative;
  display: flex;
  align-items: center;
  background: rgba(255, 255, 255, 0.8);
  border: 1px solid var(--border-medium);
  border-radius: 8px;
  overflow: hidden;
  transition: all var(--transition-base);
}

.search-wrapper:focus-within {
  border-color: var(--noble-gold);
  box-shadow: 0 0 0 3px rgba(212, 175, 55, 0.1);
}

#searchInput {
  flex: 1;
  padding: 0.8rem 1rem;
  border: none;
  outline: none;
  background: transparent;
  font-size: 0.9rem;
  color: var(--text-primary);
}

#searchInput::placeholder {
  color: var(--text-muted);
}

.search-btn {
  padding: 0.8rem 1rem;
  background: var(--noble-gold);
  border: none;
  color: white;
  cursor: pointer;
  transition: background var(--transition-fast);
  display: flex;
  align-items: center;
  justify-content: center;
}

.search-btn:hover {
  background: #c4a032;
}

/* Main content */
.main {
  margin-top: 100px;
  padding: 2rem 0 4rem;
  min-height: calc(100vh - 300px);
}

/* Gallery Section */
.gallery-section {
  margin-bottom: 4rem;
}

.gallery-header {
  text-align: center;
  margin-bottom: 3rem;
}

.gallery-title {
  font-size: 3rem;
  font-weight: 800;
  color: var(--text-primary);
  margin-bottom: 1rem;
  font-family: 'Playfair Display', Georgia, serif;
}

.gallery-subtitle {
  font-size: 1.2rem;
  color: var(--text-secondary);
  max-width: 600px;
  margin: 0 auto 2rem;
  line-height: 1.8;
  font-family: 'Cormorant Garamond', Georgia, serif;
  font-style: italic;
}

.gallery-description {
  font-size: 1rem;
  color: var(--text-secondary);
  margin-bottom: 2rem;
  line-height: 1.7;
}

/* Golden accent text */
.golden-accent {
  color: var(--noble-gold);
  text-shadow: 0 1px 2px rgba(212, 175, 55, 0.2);
}

/* Image Grid */
.image-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 2rem;
  padding: 0 1rem;
}

.image-card {
  background: var(--museum-ivory);
  border: 1px solid var(--border-light);
  border-radius: 8px;
  overflow: hidden;
  transition: all var(--transition-base);
  cursor: pointer;
  position: relative;
  box-shadow: var(--shadow-sm);
  opacity: 0;
  transform: translateY(20px);
}

.image-card.fade-in {
  opacity: 1;
  transform: translateY(0);
}

.image-card:hover {
  transform: translateY(-8px);
  box-shadow: var(--shadow-lg);
  border-color: var(--noble-gold);
}

.image-card.fade-in:hover {
  transform: translateY(-8px);
}

.image-card:hover .image-overlay {
  opacity: 1;
}

.image-wrapper {
  position: relative;
  width: 100%;
  overflow: hidden;
}

.image-item {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform var(--transition-slow);
  aspect-ratio: 1;
}

/* Image placeholder */
.image-placeholder {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  background: var(--museum-ivory);
  transition: opacity var(--transition-base);
}

.image-placeholder svg {
  width: 48px;
  height: 48px;
  margin-bottom: 1rem;
}

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

.image-placeholder .loading-text {
  font-size: 0.9rem;
  color: var(--text-muted);
  margin-top: 0.5rem;
}

.image-card:hover .image-item {
  transform: scale(1.05);
}

.image-overlay {
  position: absolute;
  inset: 0;
  background: linear-gradient(
    to bottom,
    transparent 0%,
    transparent 50%,
    rgba(0, 0, 0, 0.7) 100%
  );
  opacity: 0;
  transition: opacity var(--transition-base);
  display: flex;
  align-items: flex-end;
  padding: 1rem;
}

.image-info {
  color: white;
  width: 100%;
}

.image-title {
  font-size: 1.1rem;
  font-weight: 600;
  margin-bottom: 0.5rem;
  line-height: 1.3;
}

.image-meta {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 0.85rem;
  opacity: 0.9;
}

.image-author {
  font-style: italic;
}

.image-likes {
  display: flex;
  align-items: center;
  gap: 0.3rem;
}

.image-likes .heart {
  font-size: 1rem;
}

/* Loading and No Results */
.loading {
  text-align: center;
  padding: 4rem 2rem;
}

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

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

.no-results {
  text-align: center;
  padding: 4rem 2rem;
  background: var(--museum-ivory);
  border: 1px solid var(--border-light);
  border-radius: 8px;
  max-width: 600px;
  margin: 0 auto;
}

.no-results h2 {
  color: var(--deep-wine);
  margin-bottom: 1rem;
}

.no-results p {
  color: var(--text-secondary);
  margin-bottom: 1.5rem;
}

/* Footer */
.footer {
  background: var(--museum-ivory);
  border-top: 1px solid var(--border-medium);
  margin-top: 4rem;
  position: relative;
  z-index: 1;
}

.footer-decoration {
  background: linear-gradient(90deg, var(--noble-gold) 0%, transparent 50%, var(--noble-gold) 100%);
  background-size: 200% 100%;
  animation: shimmer 8s linear infinite;
  height: 2px;
  margin-bottom: 2rem;
}

.footer-content {
  display: grid;
  grid-template-columns: 1fr 2fr;
  gap: 3rem;
  margin-bottom: 2rem;
}

.footer-brand {
  text-align: center;
}

.footer-name {
  font-family: 'Playfair Display', Georgia, serif;
  font-size: 2rem;
  color: var(--noble-gold);
  margin-bottom: 0.5rem;
}

.footer-tagline {
  font-family: 'Cormorant Garamond', Georgia, serif;
  font-style: italic;
  font-size: 1.1rem;
  color: var(--text-secondary);
}

.footer-nav {
  display: flex;
  gap: 3rem;
}

.footer-nav-section {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.footer-nav-section h4 {
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--text-primary);
  margin-bottom: 0.8rem;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.footer-nav-section a {
  text-decoration: none;
  color: var(--text-secondary);
  font-size: 0.9rem;
  transition: color var(--transition-fast);
}

.footer-nav-section a:hover {
  color: var(--noble-gold);
}

.footer-bottom {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding-top: 2rem;
  border-top: 1px solid var(--border-light);
}

.footer-copyright,
.footer-motto {
  font-size: 0.85rem;
  color: var(--text-muted);
}

/* Responsive Design */
@media (max-width: 768px) {
  .header-content {
    flex-wrap: wrap;
    gap: 1rem;
    padding: 1rem;
  }

  .main {
    margin-top: 9rem;
  }

  .logo {
    order: 1;
  }

  .nav {
    order: 3;
    flex-basis: 100%;
    justify-content: center;
    gap: 1rem;
  }

  .search-container {
    order: 2;
    max-width: 300px;
  }

  .nav-link {
    padding: 0.4rem 0.8rem;
  }

  .nav-text {
    font-size: 0.85rem;
  }

  h1 {
    font-size: 2rem;
  }

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

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

  .footer-content {
    grid-template-columns: 1fr;
    gap: 2rem;
    text-align: center;
  }

  .footer-nav {
    justify-content: center;
    gap: 2rem;
  }

  .footer-bottom {
    flex-direction: column;
    gap: 1rem;
    text-align: center;
  }
}

@media (max-width: 480px) {
  .container {
    padding: 0 1rem;
  }

  .logo-text {
    display: none;
  }

  .main {
    margin-top: 9rem;
  }

  .nav {
    gap: 0.5rem;
  }

  .nav-link {
    padding: 0.4rem;
  }

  .search-container {
    max-width: 100%;
  }

  #searchInput {
    padding: 0.6rem 0.8rem;
  }

  .image-grid {
    grid-template-columns: 1fr;
  }

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

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

/* Search Results Page */
.search-results-section {
  margin-bottom: 3rem;
}

.search-header {
  text-align: center;
  margin-bottom: 2.5rem;
}

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

.search-query-display {
  font-size: 1.1rem;
  color: var(--text-secondary);
  font-family: 'Cormorant Garamond', Georgia, serif;
  font-style: italic;
}

.loading-more {
  text-align: center;
  padding: 2rem;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1rem;
}

.no-results-content {
  max-width: 600px;
  margin: 0 auto;
  text-align: center;
  padding: 3rem 2rem;
  background: var(--museum-ivory);
  border: 1px solid var(--border-light);
  border-radius: 12px;
  box-shadow: var(--shadow-md);
}

.no-results-icon {
  margin-bottom: 1.5rem;
  opacity: 0.6;
}

.no-results-content h2 {
  color: var(--deep-wine);
  font-size: 1.8rem;
  margin-bottom: 1rem;
}

.no-results-content p {
  color: var(--text-secondary);
  font-size: 1rem;
  line-height: 1.7;
  margin-bottom: 2rem;
}

.search-suggestions {
  margin-bottom: 2.5rem;
}

.browse-gallery {
  padding-top: 2rem;
  border-top: 1px solid var(--border-light);
}

.browse-gallery p {
  margin-bottom: 1.5rem;
}

.explore-btn {
  display: inline-block;
  background: var(--noble-gold);
  color: white;
  padding: 0.8rem 2rem;
  border-radius: 8px;
  text-decoration: none;
  font-weight: 600;
  transition: all var(--transition-fast);
}

.explore-btn:hover {
  background: #c4a032;
  transform: translateY(-2px);
  box-shadow: var(--shadow-md);
}

/* Utility classes */
.text-center {
  text-align: center;
}

.mb-1 { margin-bottom: 0.5rem; }
.mb-2 { margin-bottom: 1rem; }
.mb-3 { margin-bottom: 1.5rem; }
.mb-4 { margin-bottom: 2rem; }

.mt-1 { margin-top: 0.5rem; }
.mt-2 { margin-top: 1rem; }
.mt-3 { margin-top: 1.5rem; }
.mt-4 { margin-top: 2rem; }