/* =================================
   🌸 ENHANCED VIRTUOUS PHOTOS GALLERY CSS
   Modern, Responsive, Feature-Rich Design
   ================================= */

/* CSS Custom Properties */
:root {
  /* Color System */
  --primary-color: #d84315;
  --secondary-color: #ff6b35;
  --accent-color: #ff9a56;
  --success-color: #4caf50;
  --warning-color: #ff9800;
  --error-color: #f44336;
  
  /* Surface Colors */
  --surface-primary: #ffffff;
  --surface-secondary: #f8f9fa;
  --surface-elevated: #ffffff;
  --surface-overlay: rgba(0, 0, 0, 0.8);
  
  /* Text Colors */
  --text-primary: #2c3e50;
  --text-secondary: #6c757d;
  --text-muted: #adb5bd;
  --text-inverse: #ffffff;
  
  /* Border Colors */
  --border-light: #e9ecef;
  --border-medium: #dee2e6;
  --border-dark: #ced4da;
  
  /* Spacing Scale */
  --space-xs: 0.25rem;
  --space-sm: 0.5rem;
  --space-md: 1rem;
  --space-lg: 1.5rem;
  --space-xl: 2rem;
  --space-2xl: 3rem;
  
  /* Typography Scale */
  --text-xs: 0.75rem;
  --text-sm: 0.875rem;
  --text-base: 1rem;
  --text-lg: 1.125rem;
  --text-xl: 1.25rem;
  --text-2xl: 1.5rem;
  --text-3xl: 1.875rem;
  
  /* Border Radius */
  --radius-sm: 0.25rem;
  --radius-md: 0.5rem;
  --radius-lg: 0.75rem;
  --radius-xl: 1rem;
  --radius-full: 9999px;
  
  /* Shadows */
  --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
  --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
  --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.1);
  --shadow-xl: 0 20px 25px -5px rgba(0, 0, 0, 0.1);
  
  /* Transitions */
  --transition-fast: 150ms ease-in-out;
  --transition-normal: 250ms ease-in-out;
  --transition-slow: 350ms ease-in-out;
  
  /* Z-Index Scale */
  --z-dropdown: 10;
  --z-modal: 20;
  --z-overlay: 30;
  --z-tooltip: 40;
}

/* Reset and Base Styles */
* {
  box-sizing: border-box;
}

body {
  font-family: 'Noto Sans Devanagari', 'Segoe UI', system-ui, sans-serif;
  line-height: 1.6;
  color: var(--text-primary);
  background: linear-gradient(135deg, #f5f7fa 0%, #c3cfe2 100%);
  min-height: 100vh;
}

/* Main Container */
.photos-gallery-container {
  max-width: 1400px;
  margin: 0 auto;
  padding: var(--space-lg);
}

/* Header Section */
.gallery-header {
  text-align: center;
  margin-bottom: var(--space-2xl);
  padding: var(--space-xl);
  background: var(--surface-primary);
  border-radius: var(--radius-xl);
  box-shadow: var(--shadow-lg);
}

.gallery-title {
  font-size: var(--text-3xl);
  font-weight: 700;
  color: var(--primary-color);
  margin-bottom: var(--space-md);
  display: flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-md);
}

.gallery-title i {
  font-size: var(--text-2xl);
}

.gallery-subtitle {
  font-size: var(--text-lg);
  color: var(--text-secondary);
  margin: 0;
}

/* Controls Section */
.gallery-controls {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-lg);
  align-items: center;
  justify-content: space-between;
  margin-bottom: var(--space-xl);
  padding: var(--space-lg);
  background: var(--surface-primary);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-md);
}

/* Search Container */
.search-container {
  position: relative;
  flex: 1;
  min-width: 250px;
}

.search-icon {
  position: absolute;
  left: var(--space-md);
  top: 50%;
  transform: translateY(-50%);
  color: var(--text-muted);
  z-index: 1;
}

.search-input {
  width: 100%;
  padding: var(--space-md) var(--space-md) var(--space-md) 2.5rem;
  border: 2px solid var(--border-light);
  border-radius: var(--radius-lg);
  font-size: var(--text-base);
  transition: var(--transition-normal);
  background: var(--surface-secondary);
}

.search-input:focus {
  outline: none;
  border-color: var(--primary-color);
  box-shadow: 0 0 0 3px rgba(216, 67, 21, 0.1);
}

.clear-search-btn {
  position: absolute;
  right: var(--space-md);
  top: 50%;
  transform: translateY(-50%);
  background: none;
  border: none;
  color: var(--text-muted);
  cursor: pointer;
  padding: var(--space-xs);
  border-radius: var(--radius-sm);
  transition: var(--transition-fast);
}

.clear-search-btn:hover {
  color: var(--text-primary);
  background: var(--border-light);
}

/* Category Filter */
.category-filter {
  display: flex;
  align-items: center;
  gap: var(--space-sm);
}

.filter-label {
  font-weight: 600;
  color: var(--text-primary);
  display: flex;
  align-items: center;
  gap: var(--space-xs);
}

.category-select {
  padding: var(--space-md);
  border: 2px solid var(--border-light);
  border-radius: var(--radius-lg);
  font-size: var(--text-base);
  background: var(--surface-secondary);
  cursor: pointer;
  transition: var(--transition-normal);
}

.category-select:focus {
  outline: none;
  border-color: var(--primary-color);
  box-shadow: 0 0 0 3px rgba(216, 67, 21, 0.1);
}

/* View Mode Toggle */
.view-mode-toggle {
  display: flex;
  gap: var(--space-xs);
  background: var(--surface-secondary);
  padding: var(--space-xs);
  border-radius: var(--radius-lg);
}

.view-btn {
  padding: var(--space-md);
  border: none;
  background: transparent;
  color: var(--text-muted);
  cursor: pointer;
  border-radius: var(--radius-md);
  transition: var(--transition-fast);
  display: flex;
  align-items: center;
  justify-content: center;
}

.view-btn:hover {
  color: var(--text-primary);
  background: var(--border-light);
}

.view-btn.active {
  color: var(--primary-color);
  background: var(--surface-primary);
  box-shadow: var(--shadow-sm);
}

/* Loading Indicator */
.loading-indicator {
  text-align: center;
  padding: var(--space-2xl);
  color: var(--text-secondary);
}

.spinner {
  width: 40px;
  height: 40px;
  border: 4px solid var(--border-light);
  border-top: 4px solid var(--primary-color);
  border-radius: 50%;
  animation: spin 1s linear infinite;
  margin: 0 auto var(--space-md);
}

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

/* Error Message */
.error-message {
  text-align: center;
  padding: var(--space-2xl);
  background: var(--surface-primary);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-md);
  color: var(--error-color);
}

.error-message i {
  font-size: var(--text-2xl);
  margin-bottom: var(--space-md);
}

.retry-btn {
  margin-top: var(--space-md);
  padding: var(--space-md) var(--space-lg);
  background: var(--primary-color);
  color: var(--text-inverse);
  border: none;
  border-radius: var(--radius-lg);
  cursor: pointer;
  font-weight: 600;
  transition: var(--transition-normal);
}

.retry-btn:hover {
  background: var(--secondary-color);
  transform: translateY(-2px);
}

/* Photos Grid */
.photos-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: var(--space-lg);
  margin-bottom: var(--space-xl);
}

.photos-grid.list-view {
  display: flex;
  flex-direction: column;
  gap: var(--space-md);
}

/* Photo Card */
.photo-card {
  background: var(--surface-primary);
  border-radius: var(--radius-lg);
  overflow: hidden;
  box-shadow: var(--shadow-md);
  transition: var(--transition-normal);
  cursor: pointer;
}

.photo-card:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow-xl);
}

.photo-image-container {
  position: relative;
  aspect-ratio: 4/3;
  overflow: hidden;
}

.photo-image {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: var(--transition-slow);
}

.photo-overlay {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.7);
  display: flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-md);
  opacity: 0;
  transition: var(--transition-normal);
}

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

.overlay-btn {
  padding: var(--space-md);
  background: var(--surface-primary);
  border: none;
  border-radius: var(--radius-full);
  color: var(--text-primary);
  cursor: pointer;
  transition: var(--transition-fast);
  display: flex;
  align-items: center;
  justify-content: center;
}

.overlay-btn:hover {
  background: var(--primary-color);
  color: var(--text-inverse);
  transform: scale(1.1);
}

.photo-loading {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--surface-secondary);
}

.photo-info {
  padding: var(--space-lg);
}

.photo-title {
  font-size: var(--text-lg);
  font-weight: 600;
  color: var(--text-primary);
  margin-bottom: var(--space-sm);
  line-height: 1.4;
}

.photo-description {
  font-size: var(--text-sm);
  color: var(--text-secondary);
  margin-bottom: var(--space-md);
  line-height: 1.5;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.photo-meta {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: var(--text-xs);
  color: var(--text-muted);
}

.photo-category {
  background: var(--primary-color);
  color: var(--text-inverse);
  padding: var(--space-xs) var(--space-sm);
  border-radius: var(--radius-sm);
  font-weight: 500;
}

/* List View Styles */
.photo-list-item {
  display: flex;
  align-items: center;
  gap: var(--space-lg);
  background: var(--surface-primary);
  border-radius: var(--radius-lg);
  padding: var(--space-lg);
  box-shadow: var(--shadow-md);
  transition: var(--transition-normal);
}

.photo-list-item:hover {
  transform: translateX(4px);
  box-shadow: var(--shadow-lg);
}

.list-image-container {
  width: 120px;
  height: 80px;
  border-radius: var(--radius-md);
  overflow: hidden;
  flex-shrink: 0;
}

.list-image {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.list-info {
  flex: 1;
}

.list-title {
  font-size: var(--text-lg);
  font-weight: 600;
  color: var(--text-primary);
  margin-bottom: var(--space-xs);
}

.list-description {
  font-size: var(--text-sm);
  color: var(--text-secondary);
  margin-bottom: var(--space-sm);
  line-height: 1.4;
}

.list-meta {
  display: flex;
  gap: var(--space-md);
  font-size: var(--text-xs);
  color: var(--text-muted);
}

.list-actions {
  display: flex;
  gap: var(--space-sm);
}

.list-action-btn {
  padding: var(--space-sm);
  background: var(--surface-secondary);
  border: none;
  border-radius: var(--radius-md);
  color: var(--text-muted);
  cursor: pointer;
  transition: var(--transition-fast);
}

.list-action-btn:hover {
  background: var(--primary-color);
  color: var(--text-inverse);
}

/* Slideshow Modal */
.slideshow-modal {
  position: fixed;
  inset: 0;
  background: var(--surface-overlay);
  z-index: var(--z-modal);
  display: flex;
  align-items: center;
  justify-content: center;
  backdrop-filter: blur(10px);
}

.slideshow-container {
  position: relative;
  width: 90vw;
  max-width: 1200px;
  height: 90vh;
  background: var(--surface-primary);
  border-radius: var(--radius-xl);
  overflow: hidden;
  box-shadow: var(--shadow-xl);
}

.close-btn {
  position: absolute;
  top: var(--space-lg);
  right: var(--space-lg);
  z-index: var(--z-tooltip);
  padding: var(--space-md);
  background: rgba(0, 0, 0, 0.5);
  border: none;
  border-radius: var(--radius-full);
  color: var(--text-inverse);
  cursor: pointer;
  transition: var(--transition-fast);
}

.close-btn:hover {
  background: rgba(0, 0, 0, 0.8);
  transform: scale(1.1);
}

.nav-btn {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  z-index: var(--z-tooltip);
  padding: var(--space-lg);
  background: rgba(0, 0, 0, 0.5);
  border: none;
  border-radius: var(--radius-full);
  color: var(--text-inverse);
  cursor: pointer;
  transition: var(--transition-fast);
}

.prev-btn {
  left: var(--space-lg);
}

.next-btn {
  right: var(--space-lg);
}

.nav-btn:hover {
  background: rgba(0, 0, 0, 0.8);
  transform: translateY(-50%) scale(1.1);
}

.slide-image-container {
  position: relative;
  width: 100%;
  height: 70%;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--surface-secondary);
}

.slide-image {
  max-width: 100%;
  max-height: 100%;
  object-fit: contain;
  border-radius: var(--radius-md);
}

.image-loading {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
}

.slide-info {
  padding: var(--space-xl);
  text-align: center;
}

.slide-title {
  font-size: var(--text-2xl);
  font-weight: 700;
  color: var(--text-primary);
  margin-bottom: var(--space-md);
}

.slide-description {
  font-size: var(--text-lg);
  color: var(--text-secondary);
  margin-bottom: var(--space-lg);
  line-height: 1.6;
}

.slide-meta {
  display: flex;
  justify-content: center;
  gap: var(--space-lg);
  font-size: var(--text-sm);
  color: var(--text-muted);
}

.slide-category {
  background: var(--primary-color);
  color: var(--text-inverse);
  padding: var(--space-xs) var(--space-sm);
  border-radius: var(--radius-sm);
  font-weight: 500;
}

.slideshow-controls {
  position: absolute;
  bottom: var(--space-lg);
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  gap: var(--space-md);
}

.control-btn {
  padding: var(--space-md);
  background: rgba(0, 0, 0, 0.5);
  border: none;
  border-radius: var(--radius-full);
  color: var(--text-inverse);
  cursor: pointer;
  transition: var(--transition-fast);
}

.control-btn:hover {
  background: rgba(0, 0, 0, 0.8);
  transform: scale(1.1);
}

.slideshow-progress {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  height: 4px;
  background: var(--border-light);
}

.progress-bar {
  width: 100%;
  height: 100%;
  background: var(--border-light);
}

.progress-fill {
  height: 100%;
  background: linear-gradient(90deg, var(--primary-color), var(--secondary-color));
  width: 0%;
  transition: width 0.1s linear;
}

/* Pagination */
.pagination {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: var(--space-md);
  margin-top: var(--space-xl);
}

.page-btn {
  padding: var(--space-md) var(--space-lg);
  background: var(--surface-primary);
  border: 2px solid var(--border-light);
  border-radius: var(--radius-lg);
  color: var(--text-primary);
  cursor: pointer;
  transition: var(--transition-normal);
  display: flex;
  align-items: center;
  gap: var(--space-sm);
}

.page-btn:hover:not(:disabled) {
  background: var(--primary-color);
  color: var(--text-inverse);
  border-color: var(--primary-color);
}

.page-btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

.page-numbers {
  display: flex;
  gap: var(--space-xs);
}

.page-number-btn {
  padding: var(--space-md);
  background: var(--surface-secondary);
  border: none;
  border-radius: var(--radius-md);
  color: var(--text-primary);
  cursor: pointer;
  transition: var(--transition-fast);
  min-width: 40px;
}

.page-number-btn:hover {
  background: var(--primary-color);
  color: var(--text-inverse);
}

.page-number-btn.active {
  background: var(--primary-color);
  color: var(--text-inverse);
}

/* Stats Section */
.stats-section {
  display: flex;
  justify-content: center;
  gap: var(--space-2xl);
  margin-top: var(--space-xl);
  padding: var(--space-xl);
  background: var(--surface-primary);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-md);
}

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

.stat-item i {
  font-size: var(--text-2xl);
  color: var(--primary-color);
  margin-bottom: var(--space-sm);
}

.stat-value {
  display: block;
  font-size: var(--text-2xl);
  font-weight: 700;
  color: var(--text-primary);
  margin-bottom: var(--space-xs);
}

.stat-label {
  font-size: var(--text-sm);
  color: var(--text-secondary);
}

/* Responsive Design */
@media (max-width: 768px) {
  .photos-gallery-container {
    padding: var(--space-md);
  }
  
  .gallery-controls {
    flex-direction: column;
    align-items: stretch;
    gap: var(--space-md);
  }
  
  .search-container {
    min-width: auto;
  }
  
  .photos-grid {
    grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
    gap: var(--space-md);
  }
  
  .slideshow-container {
    width: 95vw;
    height: 95vh;
  }
  
  .slide-info {
    padding: var(--space-lg);
  }
  
  .slide-title {
    font-size: var(--text-xl);
  }
  
  .slide-description {
    font-size: var(--text-base);
  }
  
  .stats-section {
    flex-direction: column;
    gap: var(--space-lg);
  }
}

@media (max-width: 480px) {
  .photos-grid {
    grid-template-columns: 1fr;
  }
  
  .photo-list-item {
    flex-direction: column;
    text-align: center;
  }
  
  .list-image-container {
    width: 100%;
    height: 200px;
  }
  
  .list-actions {
    justify-content: center;
  }
}

/* Dark Mode Support */
@media (prefers-color-scheme: dark) {
  :root {
    --surface-primary: #1a1a1a;
    --surface-secondary: #2d2d2d;
    --surface-elevated: #3a3a3a;
    --text-primary: #ffffff;
    --text-secondary: #b3b3b3;
    --text-muted: #808080;
    --border-light: #404040;
    --border-medium: #4d4d4d;
    --border-dark: #5a5a5a;
  }
  
  body {
    background: linear-gradient(135deg, #1a1a1a 0%, #2d2d2d 100%);
  }
}

/* Print Styles */
@media print {
  .gallery-controls,
  .slideshow-modal,
  .pagination,
  .stats-section {
    display: none !important;
  }
  
  .photos-grid {
    display: block;
  }
  
  .photo-card {
    break-inside: avoid;
    margin-bottom: var(--space-lg);
  }
}