/* modals.css - Updated to match website styles */

#smartfence-embed-root .modal-overlay {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background-color: rgba(0, 0, 0, 0.5);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1000;
  backdrop-filter: blur(4px);
  opacity: 0;
  visibility: hidden;
  transition: all 0.3s ease;
}

/* FIXED: Use .active class instead of .show */
#smartfence-embed-root .modal-overlay.active {
  opacity: 1;
  visibility: visible;
}

#smartfence-embed-root .modal-container {
  background-color: var(--bg-primary);
  border-radius: var(--border-radius-lg);
  box-shadow: var(--shadow-lg);
  max-width: 500px; /* Increased from 400px */
  width: 90%;
  margin: 1rem;
  transform: scale(0.9);
  transition: transform 0.3s ease;
  border: 2px solid var(--border-color); /* Match website border style */
}

/* FIXED: Use .active class */
#smartfence-embed-root .modal-overlay.active .modal-container {
  transform: scale(1);
}

#smartfence-embed-root .modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 1.5rem;
  border-bottom: 2px solid var(--border-color); /* Thicker border to match */
  background: linear-gradient(135deg, var(--bg-secondary), var(--bg-tertiary)); /* Subtle gradient */
}

#smartfence-embed-root .modal-header h3 {
  font-size: 1.25rem;
  font-weight: 600;
  color: var(--text-primary);
  margin: 0;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

/* Add icon to modal header */
#smartfence-embed-root .modal-header h3::before {
  content: '\f086'; /* FontAwesome comment icon */
  font-family: 'Font Awesome 6 Free';
  font-weight: 900;
  color: var(--primary-color);
  font-size: 1.125rem;
}

#smartfence-embed-root .modal-close {
  background: var(--bg-tertiary);
  border: 2px solid var(--border-color);
  font-size: 1.125rem;
  color: var(--text-secondary);
  cursor: pointer;
  padding: 0.5rem;
  border-radius: var(--border-radius-sm);
  transition: var(--transition);
  display: flex;
  align-items: center;
  justify-content: center;
  width: 2.5rem;
  height: 2.5rem;
  font-weight: 600;
}

#smartfence-embed-root .modal-close:hover {
  color: var(--danger-color);
  background-color: #fef2f2;
  border-color: var(--danger-color);
  transform: scale(1.05);
}

#smartfence-embed-root .modal-content {
  padding: 2rem 1.5rem; /* Increased padding */
  text-align: center;
}

#smartfence-embed-root .modal-icon {
  font-size: 3.5rem; /* Larger icon */
  color: var(--primary-color);
  margin-bottom: 1.5rem;
  background: linear-gradient(135deg, var(--primary-color), var(--primary-dark));
  background-clip: text;
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  filter: drop-shadow(0 2px 4px rgba(0,0,0,0.1));
}

#smartfence-embed-root .modal-content p {
  color: var(--text-primary);
  font-size: 1.125rem; /* Larger text */
  line-height: 1.6;
  margin-bottom: 1rem;
  font-weight: 500;
}

#smartfence-embed-root .modal-content p:last-child {
  margin-bottom: 0;
}

#smartfence-embed-root .modal-warning {
  color: var(--warning-color);
  font-size: 0.9375rem;
  font-weight: 600;
  background-color: #fef3cd;
  border: 1px solid #fde68a;
  border-radius: var(--border-radius-sm);
  padding: 0.75rem;
  margin-top: 1rem;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

#smartfence-embed-root .modal-warning::before {
  content: '\f071'; /* FontAwesome warning icon */
  font-family: 'Font Awesome 6 Free';
  font-weight: 900;
  color: var(--warning-color);
}

#smartfence-embed-root .modal-actions {
  display: flex;
  gap: 1rem;
  padding: 1.5rem;
  border-top: 2px solid var(--border-color);
  justify-content: flex-end;
  background-color: var(--bg-secondary);
}

#smartfence-embed-root .modal-actions .btn {
  min-width: 140px; /* Wider buttons */
  font-weight: 600;
  padding: 0.875rem 1.5rem;
  border-radius: var(--border-radius);
  transition: var(--transition);
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
}

/* Enhanced button styles for modal */
#smartfence-embed-root .modal-actions .btn-secondary {
  background-color: var(--bg-primary);
  border: 2px solid var(--border-color);
}

#smartfence-embed-root .modal-actions .btn-secondary:hover {
  background-color: var(--bg-tertiary);
  color: var(--text-primary);
  border-color: var(--text-light);
  transform: translateY(-1px);
  box-shadow: var(--shadow-sm);
}

#smartfence-embed-root .modal-actions .btn-primary {
  background: linear-gradient(135deg, var(--primary-color), var(--primary-dark));
  color: white;
  border: 2px solid var(--primary-color);
}

#smartfence-embed-root .modal-actions .btn-primary:hover {
  background: linear-gradient(135deg, var(--primary-dark), var(--primary-color));
  transform: translateY(-1px);
  box-shadow: var(--shadow-md);
}

/* Mobile modal adjustments */
@media (max-width: 768px) {
  #smartfence-embed-root .modal-container {
    max-width: 95%;
    margin: 0.5rem;
  }
  
  .modal-header,
  #smartfence-embed-root .modal-content {
    padding: 1.25rem;
  }
  
  #smartfence-embed-root .modal-actions {
    padding: 1.25rem;
    flex-direction: column;
  }
  
  #smartfence-embed-root .modal-actions .btn {
    width: 100%;
    min-width: auto;
  }
  
  #smartfence-embed-root .modal-content p {
    font-size: 1rem;
  }
  
  #smartfence-embed-root .modal-icon {
    font-size: 3rem;
  }
}