/**
 * NCKF Listing Widgets - Premium Styles
 * 
 * Styles for custom Elementor widgets on single listing pages
 */

/* ==========================================================================
   Gallery Widget
   ========================================================================== */

.nckf-gallery {
  margin-bottom: 3rem;
}

/* Main Slider */
.nckf-gallery-main {
  position: relative;
  border-radius: 12px;
  overflow: hidden;
  background: #f5f5f5;
  aspect-ratio: 16 / 9;
}

.nckf-gallery-main img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.nckf-gallery-main .swiper-button-prev,
.nckf-gallery-main .swiper-button-next {
  width: 48px;
  height: 48px;
  background: rgba(255, 255, 255, 0.95);
  border-radius: 50%;
  box-shadow: 0 2px 12px rgba(0, 0, 0, 0.15);
  transition: all 0.3s ease;
}

.nckf-gallery-main .swiper-button-prev:hover,
.nckf-gallery-main .swiper-button-next:hover {
  background: #fff;
  transform: scale(1.1);
}

.nckf-gallery-main .swiper-button-prev::after,
.nckf-gallery-main .swiper-button-next::after {
  font-size: 18px;
  color: #333;
  font-weight: bold;
}

.nckf-gallery-main .swiper-pagination {
  bottom: 20px;
  left: 20px;
  width: auto;
  background: rgba(0, 0, 0, 0.6);
  padding: 8px 16px;
  border-radius: 20px;
  color: #fff;
  font-size: 14px;
  font-weight: 500;
}

/* Thumbnails */
.nckf-gallery-thumbs {
  margin-top: 16px;
  padding: 0 4px;
}

.nckf-gallery-thumbs .swiper-slide {
  opacity: 0.5;
  cursor: pointer;
  transition: opacity 0.3s ease;
  border-radius: 8px;
  overflow: hidden;
}

.nckf-gallery-thumbs .swiper-slide:hover {
  opacity: 0.8;
}

.nckf-gallery-thumbs .swiper-slide-thumb-active {
  opacity: 1;
  box-shadow: 0 0 0 3px #668aec;
}

.nckf-gallery-thumbs img {
  width: 100%;
  height: 60px;
  object-fit: cover;
  display: block;
}

/* Grid Layout */
.nckf-gallery-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
  gap: 16px;
}

.nckf-gallery-grid-item {
  position: relative;
  aspect-ratio: 4 / 3;
  border-radius: 12px;
  overflow: hidden;
  cursor: pointer;
  transition: transform 0.3s ease;
}

.nckf-gallery-grid-item:hover {
  transform: scale(1.02);
}

.nckf-gallery-grid-item img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.nckf-no-gallery {
  padding: 3rem;
  text-align: center;
  color: #999;
  background: #f9f9f9;
  border-radius: 12px;
}

/* ==========================================================================
   Property Details Widget
   ========================================================================== */

.nckf-details {
  background: #fff;
  border-radius: 12px;
  padding: 2rem;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.06);
}

.nckf-details-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 1.5rem;
}

.nckf-detail-item {
  display: flex;
  align-items: flex-start;
  gap: 1rem;
  padding: 1rem;
  background: #f8f9fa;
  border-radius: 8px;
  transition: all 0.3s ease;
}

.nckf-detail-item:hover {
  background: #f0f2f5;
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
}

.nckf-detail-icon {
  flex-shrink: 0;
  width: 40px;
  height: 40px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(135deg, #668aec 0%, #5578e0 100%);
  color: #fff;
  border-radius: 8px;
  font-size: 18px;
}

.nckf-detail-content {
  flex: 1;
  min-width: 0;
}

.nckf-detail-label {
  font-size: 13px;
  color: #666;
  margin-bottom: 4px;
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.nckf-detail-value {
  font-size: 16px;
  color: #222;
  font-weight: 600;
  word-wrap: break-word;
}

/* ==========================================================================
   Location Map Widget
   ========================================================================== */

.nckf-listing-map {
  border-radius: 12px;
  overflow: hidden;
  box-shadow: 0 2px 12px rgba(0, 0, 0, 0.1);
}

.nckf-listing-map .mapboxgl-popup-content {
  padding: 12px 16px;
  border-radius: 8px;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.2);
}

.nckf-listing-map .mapboxgl-popup-content strong {
  display: block;
  color: #222;
  font-size: 14px;
  font-weight: 600;
}

.nckf-listing-map .mapboxgl-ctrl-group {
  border-radius: 8px;
  overflow: hidden;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
}

/* ==========================================================================
   Agent Contact Widget
   ========================================================================== */

.nckf-agent-contact {
  background: linear-gradient(135deg, #f8f9fa 0%, #e9ecef 100%);
  border-radius: 12px;
  padding: 2rem;
  box-shadow: 0 2px 12px rgba(0, 0, 0, 0.08);
}

.nckf-agent-info {
  display: flex;
  gap: 1.5rem;
  align-items: flex-start;
  margin-bottom: 2rem;
  padding-bottom: 2rem;
  border-bottom: 1px solid rgba(0, 0, 0, 0.1);
}

.nckf-agent-photo {
  flex-shrink: 0;
}

.nckf-agent-photo img {
  width: 120px;
  height: 120px;
  border-radius: 50%;
  object-fit: cover;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.15);
  border: 4px solid #fff;
}

.nckf-agent-details {
  flex: 1;
}

.nckf-agent-name {
  margin: 0 0 0.5rem 0;
  font-size: 24px;
  font-weight: 700;
  color: #222;
}

.nckf-agent-title {
  margin: 0 0 0.25rem 0;
  font-size: 16px;
  color: #668aec;
  font-weight: 500;
}

.nckf-agent-agency {
  margin: 0 0 1rem 0;
  font-size: 14px;
  color: #666;
}

.nckf-agent-contact-info {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.nckf-contact-link {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  color: #444;
  text-decoration: none;
  font-size: 15px;
  transition: color 0.3s ease;
}

.nckf-contact-link:hover {
  color: #668aec;
}

.nckf-contact-link i {
  width: 20px;
  text-align: center;
  color: #668aec;
}

/* Contact Form */
.nckf-agent-form h4 {
  margin: 0 0 1.5rem 0;
  font-size: 18px;
  font-weight: 600;
  color: #222;
}

.nckf-contact-form {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.nckf-contact-form input,
.nckf-contact-form textarea {
  width: 100%;
  padding: 12px 16px;
  border: 1px solid #ddd;
  border-radius: 8px;
  font-size: 15px;
  font-family: inherit;
  background: #fff;
  transition: all 0.3s ease;
}

.nckf-contact-form input:focus,
.nckf-contact-form textarea:focus {
  outline: none;
  border-color: #668aec;
  box-shadow: 0 0 0 3px rgba(102, 138, 236, 0.1);
}

.nckf-contact-form textarea {
  resize: vertical;
  min-height: 100px;
}

.nckf-submit-btn {
  padding: 14px 32px;
  background: linear-gradient(135deg, #668aec 0%, #5578e0 100%);
  color: #fff;
  border: none;
  border-radius: 8px;
  font-size: 16px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.3s ease;
  box-shadow: 0 4px 12px rgba(102, 138, 236, 0.3);
}

.nckf-submit-btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(102, 138, 236, 0.4);
}

.nckf-submit-btn:active {
  transform: translateY(0);
}

/* ==========================================================================
   Similar Listings Widget
   ========================================================================== */

.nckf-similar-listings {
  margin: 3rem 0;
}

.nckf-similar-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 2rem;
}

.nckf-similar-card {
  background: #fff;
  border-radius: 12px;
  overflow: hidden;
  box-shadow: 0 2px 12px rgba(0, 0, 0, 0.08);
  transition: all 0.3s ease;
}

.nckf-similar-card:hover {
  transform: translateY(-4px);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.12);
}

.nckf-similar-link {
  display: block;
  text-decoration: none;
  color: inherit;
}

.nckf-similar-thumb {
  position: relative;
  aspect-ratio: 4 / 3;
  overflow: hidden;
  background: #f5f5f5;
}

.nckf-similar-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.5s ease;
}

.nckf-similar-card:hover .nckf-similar-thumb img {
  transform: scale(1.05);
}

.nckf-similar-content {
  padding: 1.5rem;
}

.nckf-similar-title {
  margin: 0 0 0.75rem 0;
  font-size: 18px;
  font-weight: 600;
  color: #222;
  line-height: 1.4;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.nckf-similar-price {
  font-size: 20px;
  font-weight: 700;
  color: #668aec;
  margin-bottom: 0.5rem;
}

.nckf-similar-surface {
  font-size: 14px;
  color: #666;
  font-weight: 500;
}

/* ==========================================================================
   Responsive
   ========================================================================== */

@media (max-width: 768px) {
  .nckf-details-grid {
    grid-template-columns: 1fr;
  }

  .nckf-agent-info {
    flex-direction: column;
    align-items: center;
    text-align: center;
  }

  .nckf-agent-contact-info {
    align-items: center;
  }

  .nckf-similar-grid {
    grid-template-columns: 1fr;
  }

  .nckf-gallery-grid {
    grid-template-columns: 1fr;
  }

  .nckf-gallery-thumbs img {
    height: 50px;
  }

  .nckf-details,
  .nckf-agent-contact {
    padding: 1.5rem;
  }
}

@media (max-width: 480px) {
  .nckf-agent-photo img {
    width: 100px;
    height: 100px;
  }

  .nckf-agent-name {
    font-size: 20px;
  }

  .nckf-similar-price {
    font-size: 18px;
  }

  .nckf-gallery-main .swiper-button-prev,
  .nckf-gallery-main .swiper-button-next {
    width: 40px;
    height: 40px;
  }

  .nckf-gallery-main .swiper-button-prev::after,
  .nckf-gallery-main .swiper-button-next::after {
    font-size: 16px;
  }
}

/* ==========================================================================
   Animations
   ========================================================================== */

@keyframes fadeInUp {
  from {
    opacity: 0;
    transform: translateY(20px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.nckf-similar-card,
.nckf-detail-item {
  animation: fadeInUp 0.6s ease forwards;
}

.nckf-similar-card:nth-child(1) { animation-delay: 0.1s; }
.nckf-similar-card:nth-child(2) { animation-delay: 0.2s; }
.nckf-similar-card:nth-child(3) { animation-delay: 0.3s; }

/* ==========================================================================
   Print Styles
   ========================================================================== */

@media print {
  .nckf-gallery-main .swiper-button-prev,
  .nckf-gallery-main .swiper-button-next,
  .nckf-gallery-main .swiper-pagination,
  .nckf-gallery-thumbs,
  .nckf-agent-form,
  .nckf-similar-listings {
    display: none !important;
  }

  .nckf-details,
  .nckf-agent-contact {
    box-shadow: none;
    border: 1px solid #ddd;
  }
}