/* Gallery Page Styles */

/* Modal Base Styles */
.hidden {
  display: none !important;
}

.image-modal {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  z-index: 1000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
}

.modal-backdrop {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.85);
  backdrop-filter: blur(5px);
}

.modal-content {
  position: relative;
  background: linear-gradient(135deg, #0f1420 0%, #1e2332 100%);
  border-radius: 20px;
  padding: 30px;
  border: 1px solid rgba(255, 255, 255, 0.1);
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.5);
  z-index: 1001;
  animation: modalFadeIn 0.3s ease;
  max-width: 900px;
  width: 95%;
  max-height: 90vh;
  overflow-y: auto;
}

@keyframes modalFadeIn {
  from {
    opacity: 0;
    transform: translateY(-20px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes slideUp {
  from {
    transform: translateY(100%);
    opacity: 0;
  }
  to {
    transform: translateY(0);
    opacity: 1;
  }
}

@keyframes slideDown {
  from {
    transform: translateY(0);
    opacity: 1;
  }
  to {
    transform: translateY(100%);
    opacity: 0;
  }
}

/* Gallery Hero */
.gallery-hero {
  padding: 160px 0 60px;
  background: linear-gradient(135deg, rgba(15, 20, 32, 0.9) 0%, rgba(30, 35, 50, 0.9) 100%);
  text-align: center;
  position: relative;
  overflow: hidden;
}

.gallery-hero::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: 
    radial-gradient(circle at 20% 50%, rgba(124, 92, 255, 0.15) 0%, transparent 50%),
    radial-gradient(circle at 80% 20%, rgba(1, 209, 251, 0.1) 0%, transparent 50%);
  z-index: 0;
}

.gallery-hero-content {
  position: relative;
  z-index: 1;
  max-width: 800px;
  margin: 0 auto;
}

.gallery-title {
  font-size: 3.5rem;
  margin-bottom: 20px;
  background: linear-gradient(135deg, #ffffff 0%, #a0a0c0 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.gallery-subtitle {
  font-size: 1.25rem;
  color: #a0a0c0;
  margin-bottom: 40px;
  line-height: 1.6;
  max-width: 600px;
  margin-left: auto;
  margin-right: auto;
}

.gallery-stats {
  display: flex;
  justify-content: center;
  gap: 60px;
  margin-top: 40px;
  flex-wrap: wrap;
}

.gallery-stat {
  text-align: center;
}

.gallery-stat .stat-number {
  font-size: 2.5rem;
  font-weight: 700;
  background: linear-gradient(135deg, #7c5cff, #01d1fb);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  display: block;
  line-height: 1;
}

.gallery-stat .stat-label {
  color: #a0a0c0;
  font-size: 0.9rem;
  margin-top: 8px;
  opacity: 0.9;
}

/* Gallery Filters */
.gallery-filters {
  padding: 40px 0;
  background: rgba(20, 25, 40, 0.6);
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.filter-controls {
  display: flex;
  flex-wrap: wrap;
  gap: 40px;
  align-items: center;
  justify-content: center;
}

.filter-group {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.filter-group h3 {
  font-size: 1rem;
  color: #a0a0c0;
  font-weight: 500;
  margin: 0;
}

.filter-buttons {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}

.filter-btn {
  padding: 8px 16px;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 20px;
  color: #a0a0c0;
  font-size: 0.9rem;
  cursor: pointer;
  transition: all 0.3s;
}

.filter-btn:hover {
  background: rgba(255, 255, 255, 0.1);
  color: #fff;
}

.filter-btn.active {
  background: rgba(124, 92, 255, 0.2);
  border-color: #7c5cff;
  color: #7c5cff;
}

.sort-select {
  padding: 8px 16px;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 8px;
  color: #a0a0c0;
  font-size: 0.9rem;
  cursor: pointer;
  min-width: 180px;
}

.sort-select:focus {
  outline: none;
  border-color: #7c5cff;
}

/* Gallery Grid */
.gallery-grid-section {
  padding: 60px 0;
  min-height: 500px;
}

.gallery-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 30px;
  margin-bottom: 40px;
}

.gallery-item {
  background: rgba(20, 25, 40, 0.6);
  border-radius: 15px;
  overflow: hidden;
  transition: transform 0.3s, box-shadow 0.3s;
  cursor: pointer;
  position: relative;
}

.gallery-item:hover {
  transform: translateY(-5px);
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3);
}

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

.gallery-image {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.5s;
}

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

.comparison-overlay {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: linear-gradient(to right, transparent 50%, rgba(0, 0, 0, 0.7) 50%);
  pointer-events: none;
}

.image-labels {
  position: absolute;
  top: 15px;
  left: 15px;
  right: 15px;
  display: flex;
  justify-content: space-between;
}

.image-label {
  padding: 5px 12px;
  background: rgba(0, 0, 0, 0.7);
  border-radius: 15px;
  font-size: 0.8rem;
  font-weight: 600;
  color: white;
}

.gallery-item-content {
  padding: 20px;
}

.gallery-item-title {
  font-size: 1.1rem;
  margin-bottom: 10px;
  color: white;
}

.gallery-item-meta {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 15px;
}

.style-badge {
  padding: 4px 10px;
  background: rgba(124, 92, 255, 0.2);
  border-radius: 12px;
  font-size: 0.8rem;
  color: #7c5cff;
}

.quality-badge {
  padding: 4px 10px;
  background: rgba(1, 209, 251, 0.2);
  border-radius: 12px;
  font-size: 0.8rem;
  color: #01d1fb;
}

.gallery-item-stats {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding-top: 15px;
  border-top: 1px solid rgba(255, 255, 255, 0.1);
}

.stat-item {
  display: flex;
  align-items: center;
  gap: 5px;
  font-size: 0.85rem;
  color: #a0a0c0;
}

.stat-item svg {
  width: 16px;
  height: 16px;
}

/* Loading Spinner */
.loading-spinner {
  text-align: center;
  padding: 60px 0;
}

.spinner {
  width: 50px;
  height: 50px;
  border: 3px solid rgba(124, 92, 255, 0.2);
  border-top: 3px solid #7c5cff;
  border-radius: 50%;
  animation: spin 1s linear infinite;
  margin: 0 auto 20px;
}

@keyframes spin {
  0% { transform: rotate(0deg); }
  100% { transform: rotate(360deg); }
}

.loading-spinner p {
  color: #a0a0c0;
  font-size: 1rem;
}

/* Load More */
.load-more-container {
  text-align: center;
  margin-top: 40px;
}

.load-more-container .btn {
  padding: 12px 40px;
  font-size: 1rem;
}

/* No Results */
.no-results {
  text-align: center;
  padding: 60px 20px;
}

.no-results svg {
  margin-bottom: 20px;
  color: #7c5cff;
}

.no-results h3 {
  font-size: 1.5rem;
  margin-bottom: 10px;
  color: white;
}

.no-results p {
  color: #a0a0c0;
  font-size: 1rem;
}

/* Upload CTA */
.upload-cta {
  padding: 80px 0;
  background: linear-gradient(135deg, rgba(124, 92, 255, 0.1) 0%, rgba(1, 209, 251, 0.1) 100%);
  margin: 60px 0;
}

.upload-cta-content {
  text-align: center;
  max-width: 600px;
  margin: 0 auto;
}

.upload-cta h2 {
  font-size: 2.5rem;
  margin-bottom: 20px;
  background: linear-gradient(135deg, #ffffff 0%, #a0a0c0 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.upload-cta p {
  font-size: 1.2rem;
  color: #a0a0c0;
  margin-bottom: 30px;
  line-height: 1.6;
}

.cta-buttons {
  display: flex;
  gap: 20px;
  justify-content: center;
  flex-wrap: wrap;
}

.cta-buttons .btn {
  min-width: 200px;
}

/* Gallery FAQ */
.gallery-faq {
  padding: 80px 0;
}

/* Comparison Slider - Оригинальный красивый стиль */
.comparison-slider {
  position: relative;
  width: 100%;
  height: 500px;
  max-height: 70vh;
  overflow: hidden;
  border-radius: 12px;
  background: #000;
}

.comparison-before,
.comparison-after {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  overflow: hidden;
}

.comparison-before {
  z-index: 2;
  clip-path: polygon(0 0, 50% 0, 50% 100%, 0 100%);
}

.comparison-before img,
.comparison-after img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  object-position: center;
  background: #f8f9fa;
}

.comparison-label {
  position: absolute;
  bottom: 20px;
  padding: 8px 16px;
  background: rgba(0, 0, 0, 0.7);
  color: white;
  border-radius: 20px;
  font-size: 14px;
  font-weight: 600;
  z-index: 3;
}

.comparison-before .comparison-label {
  left: 20px;
}

.comparison-after .comparison-label {
  right: 20px;
}

.slider-handle {
  position: absolute;
  top: 0;
  left: 50%;
  transform: translateX(-50%);
  width: 40px;
  height: 100%;
  background: rgba(124, 92, 255, 0.2);
  border: 2px solid #7c5cff;
  border-radius: 4px;
  cursor: col-resize;
  z-index: 3;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s ease;
}

.slider-handle:hover {
  background: rgba(124, 92, 255, 0.3);
  border-color: #8a6dff;
}

.slider-handle:active,
.slider-handle.dragging {
  background: rgba(124, 92, 255, 0.4);
  border-color: #9a7eff;
  cursor: grabbing;
}

.slider-handle svg {
  color: #7c5cff;
  transition: color 0.2s ease;
}

.slider-handle:hover svg {
  color: #8a6dff;
}

.slider-handle:active svg,
.slider-handle.dragging svg {
  color: #9a7eff;
}

/* Modal Styles */
.modal-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  margin-bottom: 20px;
}

.modal-title {
  flex: 1;
}

.modal-title h3 {
  font-size: 1.5rem;
  margin-bottom: 8px;
  color: white;
}

.image-meta {
  display: flex;
  gap: 15px;
  flex-wrap: wrap;
}

.image-meta span {
  padding: 4px 10px;
  border-radius: 12px;
  font-size: 0.8rem;
  font-weight: 500;
}

.image-style {
  background: rgba(124, 92, 255, 0.2);
  color: #7c5cff;
}

.image-quality {
  background: rgba(1, 209, 251, 0.2);
  color: #01d1fb;
}

.image-date {
  background: rgba(255, 255, 255, 0.1);
  color: #a0a0c0;
}

.modal-close {
  background: none;
  border: none;
  font-size: 2rem;
  color: #a0a0c0;
  cursor: pointer;
  line-height: 1;
  padding: 0;
  width: 30px;
  height: 30px;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: color 0.3s;
}

.modal-close:hover {
  color: white;
}

.modal-image-container {
  margin-bottom: 30px;
}

.modal-slider {
  height: 500px;
  border-radius: 15px;
}

.modal-actions {
  background: rgba(20, 25, 40, 0.6);
  border-radius: 15px;
  padding: 25px;
}

.action-buttons {
  display: flex;
  gap: 15px;
  margin-bottom: 25px;
  flex-wrap: wrap;
}

.action-buttons .btn {
  flex: 1;
  min-width: 150px;
}

.image-info {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 15px;
}

.info-row {
  display: flex;
  justify-content: space-between;
  padding: 10px 0;
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.info-row:last-child {
  border-bottom: none;
}

.info-label {
  color: #a0a0c0;
  font-size: 0.9rem;
}

.info-value {
  color: white;
  font-size: 0.9rem;
  font-weight: 500;
}

/* Toast */
.toast {
  position: fixed;
  bottom: 20px;
  left: 50%;
  transform: translateX(-50%);
  background: rgba(20, 25, 40, 0.95);
  color: white;
  padding: 12px 24px;
  border-radius: 10px;
  z-index: 10000;
  animation: slideUp 0.3s ease;
  border: 1px solid rgba(124, 92, 255, 0.3);
  backdrop-filter: blur(10px);
}

/* Error Message */
.error-message {
  text-align: center;
  padding: 60px 20px;
  grid-column: 1 / -1;
}

.error-message svg {
  margin-bottom: 20px;
}

.error-message h3 {
  font-size: 1.5rem;
  margin-bottom: 10px;
  color: white;
}

.error-message p {
  color: #a0a0c0;
  font-size: 1rem;
  margin-bottom: 20px;
}

/* Like button animation */
#likeBtn.liked svg {
  animation: likePulse 0.6s ease;
  fill: #ff4757;
  stroke: #ff4757;
}

@keyframes likePulse {
  0% {
    transform: scale(1);
  }
  50% {
    transform: scale(1.3);
  }
  100% {
    transform: scale(1);
  }
}

/* Responsive */
@media (max-width: 1024px) {
  .gallery-grid {
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  }
  
  .modal-slider {
    height: 400px;
  }
}

@media (max-width: 768px) {
  .gallery-hero {
    padding: 140px 0 40px;
  }
  
  .gallery-title {
    font-size: 2.5rem;
  }
  
  .gallery-subtitle {
    font-size: 1.1rem;
  }
  
  .gallery-stats {
    gap: 30px;
  }
  
  .filter-controls {
    flex-direction: column;
    align-items: stretch;
    gap: 30px;
  }
  
  .filter-group {
    align-items: stretch;
  }
  
  .filter-buttons {
    justify-content: center;
  }
  
  .sort-select {
    width: 100%;
  }
  
  .cta-buttons {
    flex-direction: column;
    align-items: center;
  }
  
  .cta-buttons .btn {
    width: 100%;
    max-width: 300px;
  }
  
  .modal-slider {
    height: 300px;
  }
  
  .action-buttons {
    flex-direction: column;
  }
  
  .action-buttons .btn {
    width: 100%;
  }
}

@media (max-width: 480px) {
  .gallery-title {
    font-size: 2rem;
  }
  
  .gallery-grid {
    grid-template-columns: 1fr;
    gap: 20px;
  }
  
  .gallery-stats {
    flex-direction: column;
    gap: 20px;
  }
  
  .upload-cta h2 {
    font-size: 2rem;
  }
  
  .modal-slider {
    height: 250px;
  }
}
/* Убедитесь, что эти стили есть для clip-path */
.comparison-before {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    overflow: hidden;
    z-index: 2;
    clip-path: polygon(0 0, 50% 0, 50% 100%, 0 100%);
}

.comparison-before img {
    width: 100%;
    height: 100%;
    object-fit: contain;
    object-position: center;
    background: #f8f9fa;
}

.comparison-after {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    overflow: hidden;
    z-index: 1;
}

.comparison-after img {
    width: 100%;
    height: 100%;
    object-fit: contain;
    object-position: center;
    background: #f8f9fa;
}

/* Стиль для dragging состояния */
.slider-handle.dragging {
    background: rgba(124, 92, 255, 0.4);
    border-color: #9a7eff;
    cursor: grabbing;
}