/* ============================================
   Instagram Feed Widget - Custom Styles
   ============================================ */

/* Container */
.ig-feed-container {
  width: 100%;
}

.ig-feed-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 8px;
}

@media (min-width: 576px) {
  .ig-feed-grid {
    grid-template-columns: repeat(3, 1fr);
    gap: 10px;
  }
}

@media (min-width: 992px) {
  .ig-feed-grid {
    grid-template-columns: repeat(4, 1fr);
    gap: 12px;
  }
}

/* Single Item */
.ig-feed-item {
  position: relative;
  overflow: hidden;
  border-radius: 8px;
  aspect-ratio: 1;
  cursor: pointer;
  background: #f0f0f0;
}

.ig-feed-item img,
.ig-feed-item video {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.4s ease;
}

.ig-feed-item:hover img,
.ig-feed-item:hover video {
  transform: scale(1.08);
}

/* Overlay on hover */
.ig-feed-overlay {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.5);
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  transition: opacity 0.3s ease;
  padding: 15px;
}

.ig-feed-item:hover .ig-feed-overlay {
  opacity: 1;
}

.ig-feed-overlay-content {
  text-align: center;
  color: #fff;
}

.ig-feed-overlay-content .ig-caption {
  font-size: 13px;
  line-height: 1.4;
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
  margin-bottom: 8px;
}

.ig-feed-overlay-content .ig-meta {
  font-size: 12px;
  opacity: 0.8;
}

/* Media type badge */
.ig-media-badge {
  position: absolute;
  top: 8px;
  right: 8px;
  color: #fff;
  font-size: 18px;
  text-shadow: 0 1px 3px rgba(0,0,0,0.5);
  z-index: 2;
}

/* Loading skeleton */
.ig-skeleton {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 8px;
}

@media (min-width: 576px) {
  .ig-skeleton {
    grid-template-columns: repeat(3, 1fr);
  }
}

@media (min-width: 992px) {
  .ig-skeleton {
    grid-template-columns: repeat(4, 1fr);
  }
}

.ig-skeleton-item {
  aspect-ratio: 1;
  border-radius: 8px;
  background: linear-gradient(90deg, #f0f0f0 25%, #e0e0e0 50%, #f0f0f0 75%);
  background-size: 200% 100%;
  animation: ig-shimmer 1.5s ease-in-out infinite;
}

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

/* Lightbox */
.ig-lightbox {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 99999;
  background: rgba(0, 0, 0, 0.9);
  align-items: center;
  justify-content: center;
  padding: 20px;
}

.ig-lightbox.active {
  display: flex;
}

.ig-lightbox-content {
  max-width: 900px;
  width: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
}

.ig-lightbox-media {
  max-width: 100%;
  max-height: 70vh;
  border-radius: 8px;
  object-fit: contain;
}

.ig-lightbox-caption {
  color: #fff;
  margin-top: 15px;
  text-align: center;
  font-size: 14px;
  line-height: 1.5;
  max-height: 80px;
  overflow-y: auto;
  padding: 0 20px;
}

.ig-lightbox-close {
  position: absolute;
  top: 15px;
  right: 20px;
  color: #fff;
  font-size: 32px;
  cursor: pointer;
  background: none;
  border: none;
  z-index: 10;
  transition: transform 0.2s;
}

.ig-lightbox-close:hover {
  transform: scale(1.2);
}

.ig-lightbox-nav {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  color: #fff;
  font-size: 36px;
  cursor: pointer;
  background: rgba(255,255,255,0.15);
  border: none;
  padding: 10px 16px;
  border-radius: 50%;
  transition: background 0.2s;
}

.ig-lightbox-nav:hover {
  background: rgba(255,255,255,0.3);
}

.ig-lightbox-prev {
  left: 15px;
}

.ig-lightbox-next {
  right: 15px;
}

.ig-lightbox-link {
  display: inline-block;
  margin-top: 12px;
  color: #fff;
  background: #E1306C;
  padding: 8px 20px;
  border-radius: 20px;
  text-decoration: none;
  font-size: 13px;
  transition: background 0.2s;
}

.ig-lightbox-link:hover {
  background: #c2185b;
  color: #fff;
}

/* Empty state */
.ig-feed-empty {
  text-align: center;
  padding: 40px 20px;
  color: #888;
}

.ig-feed-empty i {
  font-size: 48px;
  margin-bottom: 15px;
  display: block;
  color: #E1306C;
}

/* Follow button */
.ig-follow-btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: linear-gradient(45deg, #f09433, #e6683c, #dc2743, #cc2366, #bc1888);
  color: #fff;
  padding: 10px 24px;
  border-radius: 25px;
  text-decoration: none;
  font-weight: 600;
  font-size: 14px;
  transition: transform 0.2s, box-shadow 0.2s;
}

.ig-follow-btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 15px rgba(225, 48, 108, 0.4);
  color: #fff;
}

/* Admin page - Connect button */
.ig-connect-btn {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  background: linear-gradient(45deg, #f09433, #e6683c, #dc2743, #cc2366, #bc1888);
  color: #fff;
  padding: 12px 30px;
  border-radius: 8px;
  text-decoration: none;
  font-weight: 600;
  font-size: 16px;
  border: none;
  cursor: pointer;
  transition: transform 0.2s, box-shadow 0.2s;
}

.ig-connect-btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(225, 48, 108, 0.4);
  color: #fff;
}

.ig-connect-btn i {
  font-size: 20px;
}

.ig-status-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 14px;
  border-radius: 20px;
  font-size: 13px;
  font-weight: 600;
}

.ig-status-connected {
  background: #d4edda;
  color: #155724;
}

.ig-status-disconnected {
  background: #f8d7da;
  color: #721c24;
}
