/**
 * 7Rural - Custom Styles
 * Overrides and enhancements on top of Tailwind CDN
 */

/* Smooth scroll */
html {
  scroll-behavior: smooth;
}

/* Custom scrollbar */
::-webkit-scrollbar {
  width: 8px;
  height: 8px;
}

::-webkit-scrollbar-track {
  background: #f1f1f1;
  border-radius: 4px;
}

::-webkit-scrollbar-thumb {
  background: #1E3A2F;
  border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
  background: #142820;
}

/* Hero background gradient + subtle pattern */
.hero-bg {
  background: linear-gradient(135deg, #1E3A2F 0%, #142820 50%, #1E3A2F 100%);
  background-size: 400% 400%;
  animation: hero-gradient 15s ease infinite;
}

@keyframes hero-gradient {
  0%, 100% { background-position: 0% 50%; }
  50% { background-position: 100% 50%; }
}

/* Farm card hover effects */
.farm-card {
  transition: box-shadow 0.3s ease, transform 0.3s ease;
}

.farm-card:hover {
  box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 10px 10px -5px rgba(0, 0, 0, 0.04);
}

.farm-card .farm-card-img {
  transition: transform 0.7s ease;
}

.farm-card:hover .farm-card-img {
  transform: scale(1.08);
}

/* Loading skeleton shimmer */
.skeleton-card.shimmer {
  position: relative;
  overflow: hidden;
}

.skeleton-card.shimmer::after {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(
    90deg,
    transparent 0%,
    rgba(255, 255, 255, 0.4) 50%,
    transparent 100%
  );
  animation: shimmer 1.5s infinite;
}

@keyframes shimmer {
  0% { transform: translateX(-100%); }
  100% { transform: translateX(100%); }
}

/* Badge colors */
.badge-destaque {
  background-color: #f97316;
  color: white;
}

.badge-nova {
  background-color: #2E7D32;
  color: white;
}

.badge-oportunidade {
  background-color: #2563eb;
  color: white;
}

/* WhatsApp floating button pulse */
.whatsapp-pulse {
  animation: whatsapp-pulse 2s ease-in-out infinite;
}

@keyframes whatsapp-pulse {
  0%, 100% {
    box-shadow: 0 0 0 0 rgba(37, 211, 102, 0.5);
  }
  50% {
    box-shadow: 0 0 0 12px rgba(37, 211, 102, 0);
  }
}

/* Fade-in for scroll reveal */
.fade-in {
  opacity: 0;
  transform: translateY(20px);
  transition: opacity 0.6s ease, transform 0.6s ease;
}

.fade-in.fade-in-visible {
  opacity: 1;
  transform: translateY(0);
}

/* Ensure images don't exceed containers */
.farm-card img,
.farm-card .farm-card-img {
  max-width: 100%;
  height: 100%;
  object-fit: cover;
}

/* Custom radio buttons */
.radio-custom {
  width: 16px;
  height: 16px;
  border-radius: 50%;
  border: 1px solid #d1d5db;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  transition: border-color 0.2s;
}

.radio-custom.active {
  border-color: #2E7D32;
}

.radio-custom.active::after {
  content: '';
  width: 8px;
  height: 8px;
  background: #2E7D32;
  border-radius: 50%;
}

/* Category buttons */
.cat-btn.active {
  background-color: #1E3A2F;
  color: white;
  box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
  transform: scale(1.05);
}

.cat-btn:not(.active) {
  background-color: white;
  color: #6b7280;
  border: 1px solid #e5e7eb;
}

.cat-btn:not(.active):hover {
  border-color: #1E3A2F;
  color: #1E3A2F;
}

/* Lightbox */
#lightbox-img.zoomed {
  transform: scale(2);
  cursor: zoom-out;
}
#lightbox-img-container {
  cursor: zoom-in;
}
#lightbox-img-container.zoomed {
  cursor: zoom-out;
}
#lightbox-thumbs button {
  flex-shrink: 0;
  width: 60px;
  height: 40px;
  border-radius: 6px;
  overflow: hidden;
  border: 2px solid transparent;
  opacity: 0.6;
  transition: all 0.2s;
}
#lightbox-thumbs button.active {
  border-color: white;
  opacity: 1;
}
#lightbox-thumbs button:hover {
  opacity: 0.9;
}

/* Responsive adjustments */
@media (max-width: 768px) {
  .hero-bg {
    min-height: 600px !important;
  }
}
