/* Modal Overlay Styles */
.modal-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  background-color: rgba(0, 0, 0, 0.5);
  z-index: 9999;
  display: flex;
  align-items: center;
  justify-content: center;
  backdrop-filter: blur(2px);
  animation: fadeIn 0.3s ease-in-out;
  overflow: hidden;
}

@keyframes fadeIn {
  from {
    opacity: 0;
  }
  to {
    opacity: 1;
  }
}

/* Modal Container */
.modal-container {
  background: #ffffff;
  border-radius: 12px;
  box-shadow: 0 20px 40px rgba(0, 0, 0, 0.2);
  max-width: 600px;
  width: 90%;
  max-width: min(600px, 90vw);
  max-height: 90vh;
  overflow-y: auto;
  animation: slideIn 0.3s ease-out;
  position: relative;
  padding: 0;
  margin: 20px;
}

@keyframes slideIn {
  from {
    transform: translateY(-50px);
    opacity: 0;
  }
  to {
    transform: translateY(0);
    opacity: 1;
  }
}

/* Modal Header - Hidden, we'll use contact form container header instead */
.modal-header {
  display: none;
}

.modal-title {
  display: none;
}

.modal-close {
  position: absolute;
  top: 15px;
  right: 15px;
  background: rgba(0, 0, 0, 0.1);
  border: none;
  font-size: 1.5rem;
  color: #666;
  cursor: pointer;
  padding: 5px;
  width: 25px;
  height: 25px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  transition: all 0.2s ease;
  z-index: 10;
}

.modal-close:hover {
  background-color: rgba(0, 0, 0, 0.2);
  color: #333;
}

/* Modal Body */
.modal-body {
  padding: 0;
}

/* Form Styles (reusing existing contact form styles) */
.modal-body .contact-form-container {
  max-width: none;
  margin: 0;
  padding: 30px;
  background: #ffffff;
  border-radius: 12px;
}

/* Contact Us heading styles */
.modal-body .contact-title {
  font-size: 1.8rem;
  font-weight: 600;
  color: #ff3821;
  text-align: center;
  margin: 0 0 25px 0;
  padding-bottom: 15px;
  border-bottom: 2px solid #ff3821;
  width: 100%;
}

.modal-body .contact-form {
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.modal-body .form-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 20px;
}

.modal-body .form-group {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.modal-body .form-group label {
  font-weight: 500;
  color: #374151;
  font-size: 0.9rem;
}

.modal-body .form-group input,
.modal-body .form-group select,
.modal-body .form-group textarea {
  padding: 12px 16px;
  border: 2px solid #e5e7eb;
  border-radius: 8px;
  font-size: 1rem;
  transition: all 0.2s ease;
  background-color: #ffffff;
}

.modal-body .form-group input:focus,
.modal-body .form-group select:focus,
.modal-body .form-group textarea:focus {
  outline: none;
  border-color: #ff3821;
  box-shadow: 0 0 0 3px rgba(255, 56, 33, 0.1);
}

.modal-body .form-group textarea {
  resize: vertical;
  min-height: 100px;
}

/* Submit Button - Using website color theme */
.modal-body .submit-btn {
  background: #ff3821;
  color: white;
  border: none;
  padding: 14px 28px;
  border-radius: 8px;
  font-size: 1rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.3s ease;
  position: relative;
  overflow: hidden;
  align-self: flex-start;
  min-width: 120px;
}

.modal-body .submit-btn:hover {
  background: #e62e1a;
  transform: translateY(-2px);
  box-shadow: 0 8px 25px rgba(255, 56, 33, 0.3);
}

.modal-body .submit-btn:active {
  transform: translateY(0);
  background: #cc2615;
}

.modal-body .btn-loading {
  display: none;
}

.modal-body .submit-btn.loading .btn-text {
  display: none;
}

.modal-body .submit-btn.loading .btn-loading {
  display: inline;
}

/* Form Message */
.modal-body .form-message {
  padding: 12px 16px;
  border-radius: 8px;
  margin-top: 15px;
  font-weight: 500;
}

.modal-body .form-message.success {
  background-color: #d1fae5;
  color: #065f46;
  border: 1px solid #a7f3d0;
}

.modal-body .form-message.error {
  background-color: #fee2e2;
  color: #991b1b;
  border: 1px solid #fca5a5;
}

/* Prevent horizontal scroll issues */
body.modal-open {
  overflow: hidden !important;
  width: 100% !important;
  position: relative !important;
}

/* Responsive Design */
@media (max-width: 768px) {
  .modal-container {
    width: 95%;
    margin: 10px;
    max-width: calc(100vw - 20px);
  }

  .modal-header {
    padding: 15px 20px;
  }

  .modal-title {
    font-size: 1.25rem;
  }

  .modal-body {
    padding: 20px;
  }

  .modal-body .form-row {
    grid-template-columns: 1fr;
    gap: 15px;
  }

  .modal-body .submit-btn {
    width: 100%;
    align-self: stretch;
  }
}

@media (max-width: 480px) {
  .modal-container {
    width: 100%;
    height: 100%;
    border-radius: 0;
    max-height: 100vh;
  }

  .modal-header {
    border-radius: 0;
  }
}

/* Animation for modal close */
.modal-overlay.closing {
  animation: fadeOut 0.3s ease-in-out forwards;
}

.modal-overlay.closing .modal-container {
  animation: slideOut 0.3s ease-in-out forwards;
}

@keyframes fadeOut {
  from {
    opacity: 1;
  }
  to {
    opacity: 0;
  }
}

@keyframes slideOut {
  from {
    transform: translateY(0);
    opacity: 1;
  }
  to {
    transform: translateY(-50px);
    opacity: 0;
  }
}
