/* ====================================
   PREMIUM GALLERY UI - STYLES
   ==================================== */

/* ===== Root Variables ===== */
:root {
  --primary-color: #ff6f3c;
  --secondary-color: #ff9a3c;
  --success-color: #4CAF50;
  --danger-color: #f44336;
  --light-bg: #f8f9fa;
  --dark-text: #2c3e50;
  --text-muted: #95a5a6;
  --border-color: #ecf0f1;
  --shadow-sm: 0 2px 4px rgba(0, 0, 0, 0.08);
  --shadow-md: 0 4px 12px rgba(0, 0, 0, 0.12);
  --shadow-lg: 0 8px 24px rgba(0, 0, 0, 0.15);
  --transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

/* ===== Gallery Section ===== */
.w3l-homeblock1 {
  background: linear-gradient(135deg, #f5f7fa 0%, #c3cfe2 100%);
  position: relative;
  overflow: hidden;
}

.w3l-homeblock1::before {
  content: '';
  position: absolute;
  top: -50%;
  right: -10%;
  width: 400px;
  height: 400px;
  background: rgba(102, 126, 234, 0.05);
  border-radius: 50%;
  animation: float 6s ease-in-out infinite;
}

@keyframes float {
  0%, 100% { transform: translateY(0px); }
  50% { transform: translateY(20px); }
}

.w3l-homeblock1 .container {
  position: relative;
  z-index: 1;
}

/* ===== Gallery Title ===== */
.title-style {
  font-size: 3rem;
  font-weight: 800;
  background: linear-gradient(135deg, #ff6f3c 0%, #ff9a3c 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  margin-bottom: 20px;
  animation: slideInDown 0.6s ease;
}

.title-paw-style {
  display: flex;
  justify-content: center;
  gap: 15px;
  margin-bottom: 40px;
  animation: fadeIn 0.8s ease;
}

.title-paw-style i {
  font-size: 24px;
  color: #ff6f3c;
  opacity: 0.7;
  animation: bounce 2s infinite;
}

.title-paw-style .paw-2 {
  animation-delay: 0.2s;
  color: #ff9a3c;
}

.title-paw-style .paw-3 {
  animation-delay: 0.4s;
  color: #ff6f3c;
}

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

@keyframes fadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

@keyframes bounce {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-10px); }
}

/* ===== Gallery Filters Wrapper ===== */
.gallery-filters-wrapper {
  display: none; /* Hide filters - just upload and view */
}

.gallery-filters-scroll {
  overflow-x: auto;
  scroll-behavior: smooth;
  padding: 10px 20px;
  -webkit-overflow-scrolling: touch;
}

.gallery-filters-scroll::-webkit-scrollbar {
  height: 4px;
}

.gallery-filters-scroll::-webkit-scrollbar-track {
  background: #f1f1f1;
}

.gallery-filters-scroll::-webkit-scrollbar-thumb {
  background: #667eea;
  border-radius: 4px;
}

.gallery-filters {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  padding: 10px;
}

.filter-btn {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 10px 20px;
  border: 2px solid var(--border-color);
  border-radius: 50px;
  background: white;
  color: var(--dark-text);
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  transition: var(--transition);
  white-space: nowrap;
  flex-shrink: 0;
}

.filter-btn .filter-icon {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 20px;
  height: 20px;
}

.filter-btn:hover {
  border-color: var(--primary-color);
  color: var(--primary-color);
  transform: translateY(-2px);
  box-shadow: var(--shadow-md);
}

.filter-btn.active {
  background: linear-gradient(135deg, var(--primary-color) 0%, var(--secondary-color) 100%);
  color: white;
  border-color: transparent;
  box-shadow: 0 4px 15px rgba(102, 126, 234, 0.4);
}

/* ===== Gallery Stats ===== */
.gallery-stats {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: 20px;
  margin-bottom: 40px;
}

.stat-item {
  background: white;
  border-radius: 12px;
  padding: 20px;
  display: flex;
  align-items: center;
  gap: 15px;
  box-shadow: var(--shadow-sm);
  transition: var(--transition);
  border-left: 4px solid var(--primary-color);
}

.stat-item:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow-md);
}

.stat-icon {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 50px;
  height: 50px;
  background: linear-gradient(135deg, rgba(255, 111, 60, 0.1) 0%, rgba(255, 154, 60, 0.1) 100%);
  border-radius: 12px;
  font-size: 24px;
  color: var(--primary-color);
}

.stat-content {
  display: flex;
  flex-direction: column;
  gap: 5px;
}

.stat-label {
  font-size: 12px;
  color: var(--text-muted);
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.stat-value {
  font-size: 24px;
  font-weight: 800;
  color: var(--dark-text);
}

/* ===== Gallery Container ===== */
.gallery-container {
  margin-bottom: 40px;
  content-visibility: auto; /* Performance boost */
}

/* ===== Gallery Grid ===== */
.gallery-grid {
  list-style: none;
  padding: 0;
  margin: 0;
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 25px;
  animation: fadeIn 0.6s ease;
  contain: layout style paint; /* Performance optimization */
}

/* ===== Gallery Item ===== */
.gallery-item {
  position: relative;
  border-radius: 16px;
  overflow: hidden;
  background: white;
  box-shadow: var(--shadow-md);
  transition: var(--transition);
  transform-origin: center;
  cursor: pointer;
  will-change: transform;
  backface-visibility: hidden;
  transform: translateZ(0); /* Hardware acceleration */
}

.gallery-item:hover {
  transform: translateY(-8px);
  box-shadow: 0 12px 32px rgba(102, 126, 234, 0.3);
}

.gallery-item-image-wrapper {
  position: relative;
  width: 100%;
  padding-top: 75%; /* 4:3 aspect ratio for uniform display */
  overflow: hidden;
  background: linear-gradient(135deg, #f5f7fa 0%, #c3cfe2 100%);
}

.gallery-item-image {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center;
  transition: var(--transition);
  will-change: transform;
  image-rendering: -webkit-optimize-contrast;
  image-rendering: crisp-edges;
}

.gallery-item:hover .gallery-item-image {
  transform: scale(1.05); /* Reduced from 1.08 for smoother performance */
}

.gallery-item-overlay {
  display: none !important; /* Hide overlay completely - just images */
}

.overlay-btn {
  display: none !important;
}

/* ===== Gallery Item Content ===== */
.gallery-item-content {
  display: none; /* Hide title, description, and category */
}

.gallery-item-category {
  display: none;
}

.gallery-item-title {
  display: none;
}

.gallery-item-description {
  display: none;
}

/* ===== Pagination Container ===== */
.pagination-container {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 8px;
  margin-top: 50px;
  margin-bottom: 40px;
  flex-wrap: wrap;
  padding: 20px;
  background: white;
  border-radius: 12px;
  box-shadow: var(--shadow-sm);
}

/* ===== Pagination Button ===== */
.pagination-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  min-width: 40px;
  height: 40px;
  padding: 0 10px;
  border: 2px solid var(--border-color);
  border-radius: 8px;
  background: white;
  color: var(--dark-text);
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  transition: var(--transition);
}

.pagination-btn:hover:not(:disabled) {
  border-color: var(--primary-color);
  color: var(--primary-color);
  transform: translateY(-2px);
  box-shadow: var(--shadow-md);
}

.pagination-btn.active {
  background: linear-gradient(135deg, var(--primary-color) 0%, var(--secondary-color) 100%);
  color: white;
  border-color: transparent;
  box-shadow: 0 4px 12px rgba(255, 111, 60, 0.4);
}

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

.pagination-info {
  color: var(--text-muted);
  font-size: 13px;
  font-weight: 600;
  padding: 0 10px;
  margin: 0 10px;
  border-left: 2px solid var(--border-color);
  border-right: 2px solid var(--border-color);
}

/* ===== No Images Message ===== */
.no-images-message {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 400px;
}

.no-images-content {
  text-align: center;
  padding: 60px 30px;
}

.no-images-content i {
  font-size: 80px;
  color: var(--primary-color);
  opacity: 0.2;
  margin-bottom: 20px;
  display: block;
}

.no-images-content h3 {
  font-size: 28px;
  color: var(--dark-text);
  margin-bottom: 10px;
  font-weight: 700;
}

.no-images-content p {
  font-size: 16px;
  color: var(--text-muted);
  margin-bottom: 30px;
}

.no-images-content .btn {
  display: inline-block;
}

/* ===== Modal Styling for Image View ===== */
.image-modal {
  display: none;
  position: fixed;
  z-index: 1000;
  left: 0;
  top: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.8);
  animation: fadeIn 0.3s ease;
}

.image-modal-content {
  position: relative;
  background: white;
  margin: 5% auto;
  padding: 0;
  width: 90%;
  max-width: 800px;
  border-radius: 12px;
  overflow: hidden;
  animation: slideIn 0.3s ease;
}

.image-modal-close {
  position: absolute;
  top: 15px;
  right: 15px;
  background: rgba(0, 0, 0, 0.7);
  color: white;
  border: none;
  border-radius: 50%;
  width: 40px;
  height: 40px;
  font-size: 28px;
  cursor: pointer;
  transition: var(--transition);
  z-index: 10;
  display: flex;
  align-items: center;
  justify-content: center;
}

.image-modal-close:hover {
  background: rgba(0, 0, 0, 0.9);
}

.image-modal-image {
  width: 100%;
  height: auto;
  display: block;
}

.image-modal-info {
  display: none; /* Hide info section - no titles/descriptions */
}

.image-modal-title {
  display: none;
}

.image-modal-description {
  display: none;
}

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

/* ===== Responsive Design ===== */

/* Tablet (1024px and below) */
@media (max-width: 1024px) {
  .title-style {
    font-size: 2.5rem;
  }

  .gallery-grid {
    grid-template-columns: repeat(3, 1fr); /* Fixed 3 columns for consistent sizing */
    gap: 20px;
  }

  .gallery-item-image-wrapper {
    padding-top: 75%; /* Maintain 4:3 ratio */
  }

  .gallery-stats {
    grid-template-columns: repeat(2, 1fr);
  }

  .gallery-item {
    border-radius: 12px; /* Slightly smaller radius on tablet */
  }
}

/* Large Mobile (768px and below) */
@media (max-width: 768px) {
  .w3l-homeblock1 {
    padding: 30px 0 !important;
  }

  .title-style {
    font-size: 2rem;
    margin-bottom: 15px;
  }

  .gallery-filters-wrapper {
    margin-bottom: 30px;
    padding: 15px 0;
  }

  .gallery-filters {
    padding: 8px;
    gap: 8px;
  }

  .filter-btn {
    padding: 8px 16px;
    font-size: 13px;
  }

  .filter-btn .filter-icon {
    width: 18px;
    height: 18px;
    font-size: 14px;
  }

  .gallery-grid {
    grid-template-columns: 1fr; /* Single column - linear layout */
    gap: 15px;
  }

  .gallery-item-image-wrapper {
    padding-top: 75%; /* Consistent 4:3 ratio */
  }

  .gallery-stats {
    grid-template-columns: 1fr;
    gap: 15px;
  }

  .stat-item {
    padding: 15px;
  }

  .pagination-container {
    padding: 15px;
  }

  .pagination-info {
    display: none;
  }

  .image-modal-content {
    width: 95%;
    margin: 20% auto;
  }
}

/* Mobile (480px and below) */
@media (max-width: 480px) {
  .w3l-homeblock1 .container {
    padding: 15px !important;
  }

  .title-style {
    font-size: 1.5rem;
    margin-bottom: 10px;
  }

  .title-paw-style {
    gap: 10px;
    margin-bottom: 25px;
  }

  .title-paw-style i {
    font-size: 18px;
  }

  .gallery-filters-wrapper {
    border-radius: 12px;
    padding: 12px 0;
    margin-bottom: 25px;
  }

  .gallery-filters-scroll {
    padding: 8px 12px;
  }

  .gallery-filters {
    padding: 6px;
    gap: 6px;
  }

  .filter-btn {
    padding: 7px 14px;
    font-size: 12px;
    gap: 6px;
  }

  .filter-btn .filter-icon {
    display: none;
  }

  .gallery-grid {
    grid-template-columns: 1fr; /* Single column - linear layout */
    gap: 12px;
  }

  .gallery-item-image-wrapper {
    padding-top: 75%; /* Maintain consistent ratio */
  }

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

  .gallery-item-category {
    font-size: 10px;
    padding: 5px 10px;
    margin-bottom: 8px;
  }

  .gallery-item-title {
    font-size: 14px;
    margin-bottom: 6px;
  }

  .gallery-item-description {
    font-size: 12px;
    -webkit-line-clamp: 1;
  }

  .overlay-btn {
    width: 40px;
    height: 40px;
    font-size: 18px;
  }

  .pagination-container {
    gap: 6px;
    padding: 12px;
    margin-top: 30px;
  }

  .pagination-btn {
    min-width: 36px;
    height: 36px;
    font-size: 12px;
    padding: 0 8px;
  }

  .no-images-content {
    padding: 40px 20px;
  }

  .no-images-content i {
    font-size: 60px;
  }

  .no-images-content h3 {
    font-size: 22px;
  }

  .no-images-content p {
    font-size: 14px;
  }

  .image-modal-content {
    width: 98%;
    margin: 30% auto;
  }

  .image-modal-close {
    width: 36px;
    height: 36px;
    font-size: 24px;
  }

  .image-modal-info {
    padding: 20px;
  }

  .image-modal-title {
    font-size: 20px;
  }

  .image-modal-description {
    font-size: 13px;
  }
}

/* Extra Small (320px and below) */
@media (max-width: 320px) {
  .title-style {
    font-size: 1.25rem;
  }

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

  .filter-btn {
    padding: 6px 12px;
    font-size: 11px;
  }
}

/* ===== Loading State ===== */
.gallery-loading {
  display: flex;
  justify-content: center;
  align-items: center;
  min-height: 300px;
}

.gallery-loader {
  display: inline-block;
  width: 40px;
  height: 40px;
  border: 4px solid var(--light-bg);
  border-top-color: var(--primary-color);
  border-radius: 50%;
  animation: spin 1s linear infinite;
}

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

/* ===== Animations ===== */
.gallery-item {
  animation: fadeInScale 0.4s ease forwards; /* Faster animation from 0.5s */
  opacity: 0;
}

@keyframes fadeInScale {
  from {
    opacity: 0;
    transform: scale(0.95); /* Reduced from 0.9 for subtler effect */
  }
  to {
    opacity: 1;
    transform: scale(1);
  }
}

/* Stagger animation for grid items - faster transitions */
.gallery-item:nth-child(1) { animation-delay: 0.05s; }
.gallery-item:nth-child(2) { animation-delay: 0.1s; }
.gallery-item:nth-child(3) { animation-delay: 0.15s; }
.gallery-item:nth-child(4) { animation-delay: 0.2s; }
.gallery-item:nth-child(5) { animation-delay: 0.25s; }
.gallery-item:nth-child(6) { animation-delay: 0.3s; }
.gallery-item:nth-child(7) { animation-delay: 0.35s; }
.gallery-item:nth-child(8) { animation-delay: 0.4s; }
.gallery-item:nth-child(9) { animation-delay: 0.45s; }
.gallery-item:nth-child(10) { animation-delay: 0.5s; }
.gallery-item:nth-child(11) { animation-delay: 0.55s; }
.gallery-item:nth-child(12) { animation-delay: 0.6s; }
