/* Custom styles for 9MEMES */
body {
  background-color: #f8f9fa;
}

.navbar-brand {
  font-size: 1.5rem;
  font-weight: bold;
}

/* GIF Grid Layout - 3 columns, 6 rows */
.gif-grid {
  display: grid !important;
  grid-template-columns: repeat(3, 1fr) !important;
  gap: 20px !important;
  margin-bottom: 30px !important;
  width: 100% !important;
}

/* More specific selector to override any conflicts */
.container .gif-grid {
  display: grid !important;
  grid-template-columns: repeat(3, 1fr) !important;
  gap: 20px !important;
}

section .gif-grid {
  display: grid !important;
  grid-template-columns: repeat(3, 1fr) !important;
  gap: 20px !important;
}

@media (max-width: 992px) {
  .gif-grid {
    grid-template-columns: repeat(2, 1fr) !important;
    gap: 15px !important;
  }
  .container .gif-grid {
    grid-template-columns: repeat(2, 1fr) !important;
  }
  section .gif-grid {
    grid-template-columns: repeat(2, 1fr) !important;
  }
}

@media (max-width: 576px) {
  .gif-grid {
    grid-template-columns: 1fr !important;
    gap: 10px !important;
  }
  .container .gif-grid {
    grid-template-columns: 1fr !important;
  }
  section .gif-grid {
    grid-template-columns: 1fr !important;
  }
}

.gif-card {
  position: relative !important;
  overflow: hidden !important;
  border-radius: 12px !important;
  transition: transform 0.3s ease !important;
  aspect-ratio: 4 / 3 !important; /* Bigger aspect ratio for larger images */
  background: #f0f0f0 !important;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1) !important;
  display: block !important;
  width: 100% !important;
}

.gif-card:hover {
  transform: translateY(-8px);
  box-shadow: 0 8px 25px rgba(0, 0, 0, 0.2);
}

.gif-image {
  width: 100%;
  height: 100%;
  object-fit: cover;
  border-radius: 12px;
}

.gif-overlay {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  background: linear-gradient(transparent, rgba(0, 0, 0, 0.8));
  color: white;
  padding: 15px 10px 10px;
  transform: translateY(100%);
  transition: transform 0.3s ease;
}

.gif-card:hover .gif-overlay {
  transform: translateY(0);
}

.gif-title {
  font-size: 0.8rem;
  margin-bottom: 5px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  line-height: 1.2;
}

.gif-views {
  font-size: 0.7rem;
  opacity: 0.9;
  display: flex;
  align-items: center;
  gap: 3px;
}

.gif-link {
  text-decoration: none;
  color: inherit;
  display: block;
  height: 100%;
}

.main-gif {
  max-width: 100%;
  max-height: 500px;
  border-radius: 8px;
}

.gif-stats {
  background: #f8f9fa;
  padding: 15px;
  border-radius: 8px;
}

.share-buttons .btn {
  margin-left: 5px;
}

.sidebar {
  background: white;
  border-radius: 8px;
  padding: 20px;
}

.social-links a {
  font-size: 1.5rem;
  text-decoration: none;
}

.social-links a:hover {
  opacity: 0.8;
}

/* Featured section styling */
.featured-section {
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  border-radius: 15px;
  padding: 30px;
  margin-bottom: 40px;
  color: white;
}

.featured-section h2 {
  color: white;
  text-align: center;
  margin-bottom: 30px;
  font-weight: bold;
}

/* Featured GIFs - Even bigger */
.featured-gif-card {
  position: relative;
  overflow: hidden;
  border-radius: 15px;
  transition: transform 0.3s ease;
  aspect-ratio: 3 / 2; /* Even bigger for featured */
  background: rgba(255, 255, 255, 0.1);
  border: 2px solid rgba(255, 255, 255, 0.2);
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.3);
}

.featured-gif-card:hover {
  transform: scale(1.05);
  border-color: rgba(255, 255, 255, 0.4);
  box-shadow: 0 8px 30px rgba(0, 0, 0, 0.4);
}

.featured-badge {
  position: absolute;
  top: 10px;
  left: 10px;
  background: #ffd700;
  color: #000;
  padding: 4px 8px;
  border-radius: 12px;
  font-size: 0.7rem;
  font-weight: bold;
  z-index: 2;
}

/* Featured grid - 3 columns for featured */
.featured-section .gif-grid {
  grid-template-columns: repeat(3, 1fr);
  gap: 25px;
}

@media (max-width: 992px) {
  .featured-section .gif-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (max-width: 576px) {
  .featured-section .gif-grid {
    grid-template-columns: 1fr;
  }
}

/* Admin styles */
.admin-sidebar {
  height: calc(100vh - 56px);
  overflow-y: auto;
}

.nav-link.active {
  background-color: #007bff;
  color: white !important;
  border-radius: 4px;
}

/* Loading animation */
.gif-image {
  background: linear-gradient(90deg, #f0f0f0 25%, #e0e0e0 50%, #f0f0f0 75%);
  background-size: 200% 100%;
  animation: loading 1.5s infinite;
}

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

.gif-image[src] {
  background: none;
  animation: none;
}

/* Responsive adjustments */
@media (max-width: 768px) {
  .featured-section {
    padding: 20px;
  }

  .gif-overlay {
    transform: translateY(0);
    background: rgba(0, 0, 0, 0.6);
  }

  .share-buttons .btn {
    margin: 2px;
    font-size: 0.8rem;
  }
}
