/**
 * PAINTINGS BACKGROUNDS STYLING
 * Beautiful card and UI components for paintings system
 */

/* Painting Info Card */
.painting-card {
  position: fixed;
  bottom: 20px;
  right: 20px;
  background: rgba(255, 255, 255, 0.95);
  backdrop-filter: blur(10px);
  border-radius: 12px;
  padding: 16px 20px;
  max-width: 320px;
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.15);
  font-family: 'Inter', sans-serif;
  z-index: 100;
  border: 1px solid rgba(0, 0, 0, 0.05);
  animation: slideInRight 0.3s ease-out;
}

@keyframes slideInRight {
  from {
    opacity: 0;
    transform: translateX(20px);
  }
  to {
    opacity: 1;
    transform: translateX(0);
  }
}

.painting-title {
  font-weight: 700;
  font-size: 1rem;
  color: #2a2a2a;
  margin: 0 0 6px 0;
  line-height: 1.3;
}

.painting-artist {
  font-weight: 600;
  font-size: 0.9rem;
  color: #a28462;
  margin: 0 0 12px 0;
}

.painting-details {
  display: flex;
  gap: 8px;
  margin-bottom: 12px;
  flex-wrap: wrap;
  font-size: 0.8rem;
}

.painting-period {
  color: #fff;
  background: #a28462;
  padding: 3px 8px;
  border-radius: 4px;
  font-weight: 500;
}

.painting-year {
  color: #fff;
  background: #5d422a;
  padding: 3px 8px;
  border-radius: 4px;
  font-weight: 500;
}

.painting-source {
  font-size: 0.75rem;
  color: #999;
  font-style: italic;
  margin: 0;
}

/* Paintings Gallery/Selector */
.paintings-gallery {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
  gap: 12px;
  padding: 20px;
}

.painting-thumbnail {
  aspect-ratio: 4/3;
  border-radius: 8px;
  overflow: hidden;
  cursor: pointer;
  border: 3px solid transparent;
  transition: all 0.3s ease;
  background: #f0f0f0;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.painting-thumbnail:hover {
  transform: translateY(-4px);
  box-shadow: 0 8px 16px rgba(0, 0, 0, 0.15);
  border-color: #a28462;
}

.painting-thumbnail.active {
  border-color: #fcbf49;
  box-shadow: 0 0 0 2px #fcbf49;
}

.painting-thumbnail img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

/* Paintings Controls */
.paintings-controls {
  display: flex;
  gap: 12px;
  align-items: center;
  justify-content: center;
  padding: 16px;
  flex-wrap: wrap;
}

.paintings-btn {
  padding: 8px 16px;
  border: none;
  border-radius: 6px;
  background: #a28462;
  color: white;
  font-weight: 600;
  font-size: 0.9rem;
  cursor: pointer;
  transition: all 0.3s ease;
  display: flex;
  align-items: center;
  gap: 6px;
  font-family: 'Inter', sans-serif;
}

.paintings-btn:hover {
  background: #8a6d4f;
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

.paintings-btn:active {
  transform: translateY(0);
}

.paintings-btn.secondary {
  background: #e8dcc8;
  color: #5d422a;
}

.paintings-btn.secondary:hover {
  background: #d4bfa8;
}

/* Paintings Filter */
.paintings-filters {
  display: flex;
  gap: 12px;
  padding: 16px;
  flex-wrap: wrap;
  border-top: 1px solid #eee;
}

.filter-label {
  font-weight: 600;
  color: #5d422a;
  font-size: 0.9rem;
}

.filter-select {
  padding: 8px 12px;
  border: 1px solid #ddd;
  border-radius: 6px;
  background: white;
  color: #2a2a2a;
  font-family: 'Inter', sans-serif;
  cursor: pointer;
  transition: border-color 0.3s ease;
}

.filter-select:hover,
.filter-select:focus {
  border-color: #a28462;
  outline: none;
}

/* Paintings Info Panel */
.paintings-info {
  padding: 20px;
  background: #fef7e8;
  border-radius: 8px;
  margin: 16px 0;
}

.paintings-info-header {
  font-weight: 700;
  font-size: 1.1rem;
  color: #5d422a;
  margin-bottom: 12px;
}

.paintings-info-content {
  font-size: 0.95rem;
  line-height: 1.6;
  color: #2a2a2a;
}

.paintings-info-item {
  margin-bottom: 8px;
  display: flex;
  gap: 8px;
}

.paintings-info-label {
  font-weight: 600;
  color: #a28462;
  min-width: 100px;
}

.paintings-info-value {
  color: #2a2a2a;
  flex: 1;
}

/* Paintings Navigation */
.paintings-nav {
  display: flex;
  gap: 8px;
  justify-content: center;
  padding: 16px;
}

.paintings-nav-btn {
  width: 40px;
  height: 40px;
  border: none;
  border-radius: 50%;
  background: #a28462;
  color: white;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.3s ease;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.2rem;
}

.paintings-nav-btn:hover {
  background: #8a6d4f;
  transform: scale(1.1);
}

.paintings-nav-btn:active {
  transform: scale(0.95);
}

.paintings-counter {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 0 12px;
  font-weight: 600;
  color: #5d422a;
}

/* Paintings Modal */
.paintings-modal {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.7);
  z-index: 1000;
  align-items: center;
  justify-content: center;
  padding: 20px;
}

.paintings-modal.active {
  display: flex;
}

.paintings-modal-content {
  background: white;
  border-radius: 12px;
  max-width: 600px;
  width: 100%;
  max-height: 90vh;
  overflow-y: auto;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
}

.paintings-modal-close {
  position: absolute;
  top: 16px;
  right: 16px;
  background: #f0f0f0;
  border: none;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  cursor: pointer;
  font-size: 1.5rem;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.3s ease;
}

.paintings-modal-close:hover {
  background: #a28462;
  color: white;
}

/* Responsive */
@media (max-width: 768px) {
  .painting-card {
    bottom: 16px;
    right: 16px;
    max-width: 280px;
    padding: 12px 16px;
  }

  .paintings-gallery {
    grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
    gap: 10px;
    padding: 16px;
  }

  .paintings-controls {
    flex-direction: column;
    gap: 10px;
  }

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

  .paintings-filters {
    flex-direction: column;
    gap: 10px;
  }

  .paintings-nav {
    gap: 6px;
  }

  .paintings-nav-btn {
    width: 36px;
    height: 36px;
    font-size: 1rem;
  }
}

@media (max-width: 480px) {
  .painting-card {
    max-width: calc(100vw - 40px);
  }

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

  .painting-title {
    font-size: 0.9rem;
  }

  .painting-artist {
    font-size: 0.8rem;
  }

  .painting-details {
    font-size: 0.7rem;
  }
}

/* Dark mode support (if needed) */
@media (prefers-color-scheme: dark) {
  .painting-card {
    background: rgba(45, 45, 45, 0.95);
    color: #e0e0e0;
  }

  .painting-title {
    color: #f0f0f0;
  }

  .painting-artist {
    color: #b8a08a;
  }

  .painting-source {
    color: #888;
  }

  .filter-select {
    background: #2a2a2a;
    color: #e0e0e0;
    border-color: #444;
  }
}

/* Fix for body background transitions - prevent flicker */
body {
  transition: background-image 1s ease-in-out, opacity 1s ease-in-out !important;
  background-attachment: fixed !important;
}

/* Ensure smooth transitions when paintings are applied */
body.paintings-active {
  background-color: transparent !important;
  background-image: none !important;
}

/* Scrap card styling when paintings are active */
body.paintings-active .scrap-card {
  background: rgba(255, 255, 255, 0.98);
}

/* Smooth painting transitions */
.painting-transition {
  animation: paintingFade 0.8s ease-in-out;
}

@keyframes paintingFade {
  0% {
    opacity: 0.9;
  }
  50% {
    opacity: 0.5;
  }
  100% {
    opacity: 1;
  }
}
