/**
 * Instagram Feed Styles
 * Modern, responsive design for Instagram feed
 */

/* Section */
.instagram-feed-section {
  background-color: #f8f9fa;
  padding: 3rem 0;
  position: relative;
  overflow: hidden;
}

.instagram-feed-section::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 4px;
}

/* Section Info - specific to Instagram feed */
.instagram-feed-section .section-info {
  text-align: center;
  margin-bottom: 2rem;
}

/* Container */
.instagram-feed-container {
  margin: 0 auto;
  padding: 2rem 0;
  position: relative;
  overflow: hidden;
  border-radius: 12px;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.05);
  background-color: white;
}

/* Header */
.instagram-feed-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 2rem;
  padding: 0 1.5rem 1.5rem;
  border-bottom: 1px solid #f0f0f0;
}

.instagram-feed-title {
  display: flex;
  align-items: center;
  font-size: 1.75rem;
  font-weight: 700;
  color: #2C5F43;
  letter-spacing: -0.5px;
}

.instagram-feed-title i {
  margin-right: 0.75rem;
  font-size: 2rem;
  background: -webkit-linear-gradient(45deg, #f09433 0%, #e6683c 25%, #dc2743 50%, #cc2366 75%, #bc1888 100%);
  background-clip: text;
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  filter: drop-shadow(0 2px 4px rgba(0,0,0,0.1));
}

.instagram-follow-link {
  display: flex;
  align-items: center;
  font-size: 1.1rem;
  font-weight: 600;
  color: #2C5F43;
  text-decoration: none;
  transition: all 0.3s ease;
  padding: 8px 16px;
  border-radius: 30px;
  background-color: #f8f9fa;
  box-shadow: 0 2px 8px rgba(0,0,0,0.05);
}

.instagram-follow-link:hover {
  background-color: #f0f0f0;
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(0,0,0,0.08);
}

.instagram-profile-image {
  width: 60px;
  height: 60px;
  border-radius: 50%;
  margin-right: 12px;
  object-fit: cover;
  border: 3px solid white;
  box-shadow: 0 3px 10px rgba(0,0,0,0.1);
  background: white;
}

.instagram-username {
  display: inline-block;
  vertical-align: middle;
}

/* Feed Wrapper */
.instagram-feed-wrapper {
  display: grid;
  gap: 1.25rem;
  width: 100%;
  padding: 0 1.5rem;
}

/* Grid Layout */
.instagram-feed-wrapper.layout-grid {
  grid-template-columns: repeat(3, 1fr);
}

/* Post */
.instagram-post {
  position: relative;
  overflow: hidden;
  border-radius: 12px;
  box-shadow: 0 8px 20px rgba(0, 0, 0, 0.07);
  transition: all 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
  background-color: white;
  aspect-ratio: 1/1;
}

.instagram-post:hover {
  transform: translateY(-8px) scale(1.02);
  box-shadow: 0 15px 30px rgba(0, 0, 0, 0.12);
  z-index: 1;
}

/* Post Link */
.instagram-post-link {
  display: block;
  width: 100%;
  height: 100%;
  text-decoration: none;
  color: inherit;
}

/* Image Container */
.instagram-image-container {
  position: relative;
  width: 100%;
  height: 100%;
  overflow: hidden;
}

.instagram-image {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.7s ease;
  filter: brightness(0.95);
}

.instagram-post:hover .instagram-image {
  transform: scale(1.08);
  filter: brightness(1.05);
}

/* Overlay */
.instagram-overlay {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: linear-gradient(to top, rgba(0, 0, 0, 0.6) 0%, rgba(0, 0, 0, 0) 60%);
  opacity: 0;
  display: flex;
  justify-content: center;
  align-items: center;
  transition: all 0.4s ease;
}

.instagram-overlay::before {
  content: '';
  position: absolute;
  top: 10px;
  right: 10px;
  width: 30px;
  height: 30px;
  background: rgba(255, 255, 255, 0.2);
  backdrop-filter: blur(4px);
  border-radius: 50%;
  display: flex;
  justify-content: center;
  align-items: center;
  transform: translateY(-10px);
  opacity: 0;
  transition: all 0.3s ease 0.1s;
}

.instagram-overlay i {
  font-size: 2rem;
  color: white;
  text-shadow: 0 2px 4px rgba(0, 0, 0, 0.3);
  transform: scale(0.8);
  transition: transform 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

.instagram-overlay .ioy-favicon-overlay {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: white;
  padding: 3px;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.3);
  transform: scale(0.8);
  transition: transform 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

.instagram-post:hover .instagram-overlay {
  opacity: 1;
}

.instagram-post:hover .instagram-overlay i,
.instagram-post:hover .instagram-overlay .ioy-favicon-overlay {
  transform: scale(1);
}

.instagram-post:hover .instagram-overlay::before {
  transform: translateY(0);
  opacity: 1;
}

/* Caption */
.instagram-caption {
  padding: 0.75rem;
  font-size: 0.875rem;
  color: #4a5568;
  line-height: 1.4;
}

/* View More */
.instagram-view-more {
  text-align: center;
  margin-top: 2.5rem;
  margin-bottom: 1rem;
}

.instagram-view-more-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0.875rem 2rem;
  background: linear-gradient(135deg, #2C5F43 0%, #55AF47 100%);
  color: white;
  font-weight: 600;
  font-size: 1.1rem;
  border-radius: 50px;
  text-decoration: none;
  transition: all 0.3s ease;
  box-shadow: 0 8px 20px rgba(44, 95, 67, 0.25);
  position: relative;
  overflow: hidden;
}

.instagram-view-more-link::before {
  content: '';
  position: absolute;
  top: 0;
  left: -100%;
  width: 100%;
  height: 100%;
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.2), transparent);
  transition: all 0.6s ease;
}

.instagram-view-more-link i {
  margin-left: 0.75rem;
  transition: transform 0.3s ease;
}

.instagram-view-more-link:hover {
  background: linear-gradient(135deg, #55AF47 0%, #2C5F43 100%);
  transform: translateY(-3px);
  box-shadow: 0 12px 25px rgba(44, 95, 67, 0.35);
}

.instagram-view-more-link:hover::before {
  left: 100%;
}

.instagram-view-more-link:hover i {
  transform: translateX(4px);
}

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

.instagram-feed-loader {
  text-align: center;
  position: relative;
}

.loader-spinner {
  display: inline-block;
  width: 60px;
  height: 60px;
  border: 3px solid rgba(44, 95, 67, 0.1);
  border-radius: 50%;
  border-top-color: #2C5F43;
  animation: spin 1s cubic-bezier(0.5, 0, 0.5, 1) infinite;
  box-shadow: 0 0 20px rgba(44, 95, 67, 0.1);
}

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

/* Error State */
.instagram-feed-error {
  text-align: center;
  padding: 3rem 2rem;
  background-color: #fff8f8;
  border-radius: 12px;
  box-shadow: 0 5px 15px rgba(229, 62, 62, 0.1);
}

.instagram-feed-error p {
  margin-bottom: 1.5rem;
  color: #e53e3e;
  font-size: 1.1rem;
  font-weight: 500;
}

.instagram-feed-error a {
  display: inline-flex;
  align-items: center;
  padding: 0.75rem 1.5rem;
  background-color: #2C5F43;
  color: white;
  font-weight: 600;
  border-radius: 50px;
  text-decoration: none;
  transition: all 0.3s ease;
  box-shadow: 0 4px 10px rgba(44, 95, 67, 0.2);
}

.instagram-feed-error a:hover {
  background-color: #55AF47;
  transform: translateY(-2px);
  box-shadow: 0 6px 15px rgba(44, 95, 67, 0.3);
}

/* Fallback */
.instagram-image-container.fallback {
  background: linear-gradient(135deg, #f6f8fb, #edf2f7);
  display: flex;
  justify-content: center;
  align-items: center;
  position: relative;
  overflow: hidden;
}

.instagram-image-container.fallback::before {
  content: '';
  position: absolute;
  width: 200%;
  height: 200%;
  background: linear-gradient(
    45deg,
    rgba(240, 148, 51, 0.05) 0%,
    rgba(230, 104, 60, 0.05) 25%,
    rgba(220, 39, 67, 0.05) 50%,
    rgba(204, 35, 102, 0.05) 75%,
    rgba(188, 24, 136, 0.05) 100%
  );
  animation: gradient-shift 8s ease infinite;
}

.instagram-image-container.fallback .ioy-favicon-placeholder {
  width: 60px;
  height: 60px;
  position: relative;
  z-index: 1;
  filter: drop-shadow(0 2px 4px rgba(0,0,0,0.1));
  border-radius: 50%;
  background: white;
  padding: 5px;
  box-shadow: 0 3px 10px rgba(0,0,0,0.1);
}

@keyframes gradient-shift {
  0% {
    transform: translate(-50%, -50%) rotate(0deg);
  }
  50% {
    transform: translate(-50%, -50%) rotate(180deg);
  }
  100% {
    transform: translate(-50%, -50%) rotate(360deg);
  }
}

/* Responsive */
@media (max-width: 1200px) {
  .instagram-feed-wrapper.layout-grid {
    grid-template-columns: repeat(3, 1fr);
    gap: 1rem;
  }
  
  .instagram-feed-section {
    padding: 2.5rem 0;
  }
  
  .instagram-feed-container {
    padding: 1.5rem 0;
  }
}

@media (max-width: 992px) {
  .instagram-feed-wrapper {
    padding: 0 1rem;
  }
  
  .instagram-feed-title {
    font-size: 1.5rem;
  }
  
  .instagram-feed-title i {
    font-size: 1.75rem;
  }
  
  .instagram-profile-image {
    width: 50px;
    height: 50px;
  }
  
  .instagram-view-more-link {
    padding: 0.75rem 1.75rem;
    font-size: 1rem;
  }
}

@media (max-width: 768px) {
  .instagram-feed-wrapper.layout-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 0.875rem;
  }
  
  .instagram-feed-section {
    padding: 2rem 0;
  }
  
  .instagram-feed-header {
    padding: 0 1rem 1.25rem;
    margin-bottom: 1.5rem;
  }
  
  .instagram-feed-title {
    font-size: 1.35rem;
  }
  
  .instagram-feed-title i {
    font-size: 1.5rem;
    margin-right: 0.5rem;
  }
  
  .instagram-follow-link {
    font-size: 0.95rem;
    padding: 6px 12px;
  }
  
  .instagram-profile-image {
    width: 45px;
    height: 45px;
    margin-right: 8px;
  }
  
  .instagram-view-more {
    margin-top: 2rem;
  }
}

@media (max-width: 576px) {
  .instagram-feed-wrapper.layout-grid {
    grid-template-columns: repeat(1, 1fr);
    max-width: 350px;
    margin: 0 auto;
  }
  
  .instagram-feed-header {
    flex-direction: column;
    align-items: center;
    text-align: center;
    gap: 1rem;
    padding: 0 1rem 1.25rem;
  }
  
  .instagram-feed-title {
    justify-content: center;
  }
  
  .instagram-follow-link {
    margin: 0 auto;
  }
  
  .instagram-post {
    max-width: 100%;
    margin: 0 auto;
  }
  
  .instagram-feed-section::before {
    height: 3px;
  }
}
