/**
 * Advanced Search Modal Styles
 *
 * Modern, responsive modal for property feature filtering
 * Includes mobile-friendly layout and smooth animations
 */

/* Modal Overlay */
.propertysoft-modal-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.6);
  backdrop-filter: blur(3px);
  z-index: 999;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.3s ease, visibility 0.3s ease;
}

.propertysoft-modal-overlay.active {
  opacity: 1;
  visibility: visible;
}

/* Modal Container */
.propertysoft-modal {
  position: fixed;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%) scale(0.9);
  background: #fff;
  border-radius: 12px;
  box-shadow: 0 10px 40px rgba(0, 0, 0, 0.2);
  z-index: 1000;
  max-width: 900px;
  width: 90%;
  max-height: 85vh;
  display: flex;
  flex-direction: column;
  opacity: 0;
  visibility: hidden;
  transition: all 0.3s cubic-bezier(0.68, -0.55, 0.265, 1.55);
}

.propertysoft-modal.active {
  opacity: 1;
  visibility: visible;
  transform: translate(-50%, -50%) scale(1);
}

/* Modal Header */
.propertysoft-modal-header {
  padding: 24px;
  border-bottom: 1px solid #e5e7eb;
  display: flex;
  justify-content: space-between;
  align-items: center;
  background: var(--bde-brand-primary-color);
  border-radius: 12px 12px 0 0;
  color: #fff;
}

.propertysoft-modal-header h2 {
  margin: 0;
  font-size: 20px !important;
  font-weight: 600;
  color: white !important;
}

.propertysoft-modal-header h3 {
  font-size: 19px !important;
}

.propertysoft-modal-close {
  background: rgba(255, 255, 255, 0.2);
  border: none;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 24px;
  color: #fff;
  transition: background 0.2s ease;
  line-height: 1;
}

.propertysoft-modal-close:hover {
  background: rgba(255, 255, 255, 0.3);
}

/* Modal Body */
.propertysoft-modal-body {
  padding: 24px;
  overflow-y: auto;
  flex: 1;
}

.propertysoft-modal-body::-webkit-scrollbar {
  width: 8px;
}

.propertysoft-modal-body::-webkit-scrollbar-track {
  background: #f1f1f1;
  border-radius: 4px;
}

.propertysoft-modal-body::-webkit-scrollbar-thumb {
  background: #888;
  border-radius: 4px;
}

.propertysoft-modal-body::-webkit-scrollbar-thumb:hover {
  background: #555;
}

/* Feature Category */
.propertysoft-feature-category {
  margin-bottom: 24px;
  border: 1px solid #e5e7eb;
  border-radius: 8px;
  overflow: hidden;
  background: #fff;
  transition: box-shadow 0.2s ease;
}

.propertysoft-feature-category:hover {
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
}

.propertysoft-category-header {
  background: #f9fafb;
  padding: 16px 20px;
  cursor: pointer;
  display: flex;
  justify-content: space-between;
  align-items: center;
  transition: background 0.2s ease;
  user-select: none;
}

.propertysoft-category-header:hover {
  background: #f3f4f6;
}

.propertysoft-category-title {
  font-size: 19px !important;
  font-weight: 600;
  color: #1f2937;
  margin: 0;
}

.propertysoft-category-toggle {
  position: relative;
  width: 16px;
  height: 16px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.propertysoft-category-toggle::before {
  content: "";
  width: 8px;
  height: 8px;
  border-right: 2px solid #6b7280;
  border-bottom: 2px solid #6b7280;
  transform: rotate(-45deg);
  transition: transform 0.3s ease, border-color 0.3s ease;
}

.propertysoft-feature-category.active .propertysoft-category-toggle::before {
  transform: rotate(135deg);
  border-color: #4c51bf;
}

.propertysoft-category-count {
  font-size: 13px;
  color: #6b7280;
  margin-left: 8px;
}

/* Feature List */
.propertysoft-feature-list {
    padding: 0;
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 12px;
    max-height: 0;
    overflow: hidden;
  opacity: 0;
  transform: translateY(-8px);
  pointer-events: none;
  transition: max-height 0.3s ease, opacity 0.25s ease, transform 0.25s ease;
}

.propertysoft-feature-category.active .propertysoft-feature-list {
    max-height: 1000px;
    padding: 20px;
    opacity: 1;
    transform: translateY(0);
    pointer-events: auto;
}

.propertysoft-feature-item {
  position: relative;
}

.propertysoft-feature-checkbox {
  position: absolute;
  opacity: 0;
  cursor: pointer;
}

.propertysoft-feature-label {
  display: flex;
  align-items: center;
  padding: 10px 12px;
  border: 2px solid #e5e7eb;
  border-radius: 6px;
  cursor: pointer;
  transition: all 0.2s ease;
  font-size: 14px;
  color: #374151;
  background: #fff;
}

.propertysoft-feature-label:hover {
  border-color: #cbd5e1;
  background: #f8fafc;
}

.propertysoft-feature-checkbox:checked + .propertysoft-feature-label {
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  border-color: #667eea;
  color: #fff;
  font-weight: 500;
}

.propertysoft-feature-label::before {
  content: "";
  width: 18px;
  height: 18px;
  border: 2px solid #d1d5db;
  border-radius: 4px;
  margin-right: 10px;
  flex-shrink: 0;
  transition: all 0.2s ease;
}

.propertysoft-feature-checkbox:checked + .propertysoft-feature-label::before {
  background: #fff;
  border-color: #fff;
  background-image: url('data:image/svg+xml,%3Csvg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 20 20" fill="%23667eea"%3E%3Cpath fill-rule="evenodd" d="M16.707 5.293a1 1 0 010 1.414l-8 8a1 1 0 01-1.414 0l-4-4a1 1 0 011.414-1.414L8 12.586l7.293-7.293a1 1 0 011.414 0z" clip-rule="evenodd"/%3E%3C/svg%3E');
  background-size: 14px;
  background-position: center;
  background-repeat: no-repeat;
}

/* Modal Footer */
.propertysoft-modal-footer {
    padding: 20px 24px;
    border-top: 1px solid #e5e7eb;
    display: flex;
    justify-content: flex-end;
    align-items: center;
    gap: 12px;
}

.propertysoft-btn {
    padding: 12px 24px;
  border: none;
  border-radius: 6px;
  font-size: 15px;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.2s ease;
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

.propertysoft-btn-primary {
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  color: #fff;
}

.propertysoft-btn-primary:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(102, 126, 234, 0.4);
}

.propertysoft-btn-clear {
  background: transparent;
  color: #ef4444;
  padding: 8px 16px;
}

.propertysoft-btn-clear:hover {
  background: #fef2f2;
}

/* Filter Chips */
.propertysoft-filter-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 16px;
}

.propertysoft-filter-chip {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 4px 8px !important;
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  color: #fff;
  border-radius: 20px;
  font-size: 11px !important;
  font-weight: 500;
}

.propertysoft-chip-remove {
  background: rgba(255, 255, 255, 0.2);
  border: none;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 14px;
  color: #fff;
  line-height: 1;
  transition: background 0.2s ease;
}

.propertysoft-chip-remove:hover {
  background: rgba(255, 255, 255, 0.3);
}

/* Mobile Responsive */
@media (max-width: 768px) {
  .propertysoft-modal {
    width: 95%;
    max-height: 90vh;
    border-radius: 8px;
  }

  .propertysoft-modal-header {
    padding: 16px;
    border-radius: 8px 8px 0 0;
  }

  .propertysoft-modal-header h2 {
    font-size: 20px;
  }

  .propertysoft-modal-body {
    padding: 16px;
  }

    .propertysoft-feature-list {
        grid-template-columns: 1fr;
    }

    .propertysoft-feature-category.active .propertysoft-feature-list {
        padding: 16px;
    }

    .propertysoft-modal-footer {
        flex-direction: column;
        padding: 16px;
        align-items: stretch;
    }

    .propertysoft-btn {
    width: 100%;
    justify-content: center;
  }

  .propertysoft-btn-clear {
    align-self: flex-start;
    padding: 0;
  }

  .propertysoft-filter-chips {
    width: 100%;
  }

  .propertysoft-filter-chip {
    font-size: 12px;
    padding: 6px 10px;
  }
}

@media (max-width: 480px) {
  .propertysoft-modal {
    width: 100%;
    height: 100%;
    max-height: 100vh;
    border-radius: 0;
    top: 0;
    left: 0;
    transform: translateY(100%);
  }

  .propertysoft-modal.active {
    transform: translateY(0);
  }

  .propertysoft-modal-header {
    border-radius: 0;
  }
}

/* Animation for chips appearing */
@keyframes chipSlideIn {
  from {
    opacity: 0;
    transform: translateX(-10px);
  }
  to {
    opacity: 1;
    transform: translateX(0);
  }
}

.propertysoft-filter-chip {
  animation: chipSlideIn 0.2s ease;
}
