/**
 * Modal Styles for MLS Property History
 *
 * @package MlsHistory
 */

/* Modal Overlay */
#mlsh-modal-overlay {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.7);
  z-index: 999999;
  opacity: 0;
  transition: opacity 0.3s ease;
}

#mlsh-modal-overlay.mlsh-modal-active {
  display: flex;
  opacity: 1;
  align-items: center;
  justify-content: center;
}

/* Modal Container */
#mlsh-modal-root {
  background: #fff;
  border-radius: 8px;
  max-width: 90%;
  max-height: 90vh;
  width: 1000px;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.3);
  overflow: hidden;
  transform: scale(0.9);
  transition: transform 0.3s ease;
  display: flex;
  flex-direction: column;
}

#mlsh-modal-overlay.mlsh-modal-active #mlsh-modal-root {
  transform: scale(1);
}

/* Modal Header */
.mlsh-modal-header {
  padding: 20px 24px;
  border-bottom: 1px solid #e0e0e0;
  display: flex;
  justify-content: space-between;
  align-items: center;
  background: #f9f9f9;
}

.mlsh-modal-title {
  margin: 0;
  font-size: 20px;
  font-weight: 600;
  color: #333;
}

.mlsh-modal-close {
  background: none;
  border: none;
  font-size: 28px;
  line-height: 1;
  color: #666;
  cursor: pointer;
  padding: 0;
  width: 32px;
  height: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 4px;
  transition: background 0.2s ease, color 0.2s ease;
}

.mlsh-modal-close:hover {
  background: #e0e0e0;
  color: #333;
}

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

/* Loading State */
.mlsh-loading {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 60px 20px;
  color: #666;
}

.mlsh-loading::before {
  content: '';
  display: inline-block;
  width: 24px;
  height: 24px;
  border: 3px solid #f3f3f3;
  border-top-color: #3498db;
  border-radius: 50%;
  animation: mlsh-spin 1s linear infinite;
  margin-right: 12px;
}

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

/* Error State */
.mlsh-error {
  padding: 20px;
  background: #fee;
  border: 1px solid #fcc;
  border-radius: 4px;
  color: #c33;
  text-align: center;
}

/* No History State */
.mlsh-no-history {
  padding: 40px 20px;
  text-align: center;
  color: #666;
  font-size: 16px;
}

/* Modal Button Trigger */
.mlsh-history-button {
  display: inline-block;
  padding: 10px 20px;
  background: #3498db;
  color: #fff;
  border: none;
  border-radius: 4px;
  font-size: 14px;
  font-weight: 500;
  cursor: pointer;
  transition: background 0.2s ease;
  text-decoration: none;
}

.mlsh-history-button:hover {
  background: #2980b9;
  color: #fff;
}

.mlsh-history-button:focus {
  outline: 2px solid #3498db;
  outline-offset: 2px;
}

/* Responsive */
@media (max-width: 768px) {
  #mlsh-modal-root {
    max-width: 95%;
    max-height: 95vh;
    width: 100%;
  }

  .mlsh-modal-header {
    padding: 16px 20px;
  }

  .mlsh-modal-title {
    font-size: 18px;
  }

  .mlsh-modal-body {
    padding: 20px;
  }
}
