/* ========================================
   CONTACT MODAL
   ======================================== */

.modal-contact {
  display: none;
  position: fixed;
  z-index: 10000;
  left: 0;
  top: 0;
  width: 100%;
  height: 100%;
  overflow: auto;
  background-color: rgba(0, 0, 0, 0.7);
  backdrop-filter: blur(5px);
  animation: fadeIn 0.3s ease;
}

.modal-contact.show {
  display: flex;
  align-items: center;
  justify-content: center;
}

.modal-contact-content {
  background: #fff;
  margin: 2rem;
  padding: 0;
  border-radius: 16px;
  max-width: 600px;
  width: 100%;
  max-height: 90vh;
  overflow-y: auto;
  box-shadow: 0 10px 40px rgba(0, 0, 0, 0.2);
  animation: slideIn 0.3s ease;
}

@keyframes fadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

@keyframes slideIn {
  from {
    transform: translateY(-50px);
    opacity: 0;
  }
  to {
    transform: translateY(0);
    opacity: 1;
  }
}

.modal-contact-header {
  padding: 2rem;
  border-bottom: 1px solid rgba(0, 0, 0, 0.1);
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.modal-contact-header h3 {
  margin: 0;
  color: #1f2937;
  font-size: 1.5rem;
  font-weight: 700;
}

.modal-contact-close {
  background: none;
  border: none;
  font-size: 2rem;
  color: #1f2937;
  cursor: pointer;
  width: 40px;
  height: 40px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  transition: all 0.2s ease;
}

.modal-contact-close:hover {
  background: rgba(0, 0, 0, 0.05);
}

.modal-contact-body {
  padding: 2rem;
}

.modal-contact-body .form-group {
  margin-bottom: 1rem;
}

.modal-contact-body .form-group label {
  display: block;
  margin-bottom: 0.5rem;
  font-weight: 500;
  color: #374151;
}

.modal-contact-body .form-control {
  width: 100%;
  padding: 0.75rem;
  border: 1px solid #d1d5db;
  border-radius: 8px;
  font-size: 1rem;
  transition: all 0.2s ease;
}

.modal-contact-body .form-control:focus {
  outline: none;
  border-color: #3b82f6;
  box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.1);
}

.modal-contact-body .form-control.error,
.modal-contact-body .form-control.is-invalid {
  border: 1px solid red !important;
}

.modal-contact-body label.error {
  color: red;
  font-size: 10px;
  font-weight: normal;
  margin-top: 4px;
  display: block;
}

.modal-contact-body select.form-control {
  appearance: none;
  -webkit-appearance: none;
  -moz-appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath fill='%23374151' d='M6 9L1 4h10z'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 0.75rem center;
  background-size: 12px;
  padding-right: 2.5rem;
}

.modal-contact-body select.form-control option {
  padding: 8px 12px;
  color: #374151;
  background: #fff;
}

.modal-contact-body .btn-primary {
  background: linear-gradient(135deg, #3b82f6 0%, #2563eb 100%);
  border: none;
  color: white;
  padding: 0.875rem 1.5rem;
  border-radius: 8px;
  font-weight: 600;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  transition: all 0.2s ease;
}

.modal-contact-body .btn-primary:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(37, 99, 235, 0.4);
}

.modal-contact-body .submitting {
  text-align: center;
  color: #6b7280;
  font-style: italic;
}

@media (max-width: 768px) {
  .modal-contact-content {
    margin: 1rem;
    max-height: 95vh;
  }

  .modal-contact-header,
  .modal-contact-body {
    padding: 1.5rem;
  }

  .modal-contact-header h3 {
    font-size: 1.25rem;
  }
}

/* ========================================
   STICKY POPOVER WIDGET
   ======================================== */

.sticky-popover {
  position: fixed;
  right: 20px;
  top: calc(33.33vh + 70px);
  width: 100%;
  max-width: 30rem;
  min-height: 80px;
  max-height: calc(100vh - 33.33vh - 90px);
  z-index: 98;
  opacity: 0;
  transform: scale(0);
  transform-origin: right top;
  transition: all 0.3s cubic-bezier(0, 1.2, 1, 1);
  pointer-events: none;
}

.sticky-popover--opened {
  opacity: 1;
  transform: scale(1);
  pointer-events: all;
}

.sticky-popover-content {
  background: #fff;
  border-radius: 16px;
  box-shadow: 0 5px 40px rgba(0, 0, 0, 0.16);
  padding: 2rem;
  position: relative;
}

.sticky-popover-close {
  position: absolute;
  top: 1rem;
  right: 1rem;
  width: 32px;
  height: 32px;
  border: none;
  background: rgba(0, 0, 0, 0.05);
  border-radius: 50%;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s ease;
  color: #1f2937;
}

.sticky-popover-close:hover {
  background: rgba(0, 0, 0, 0.1);
  transform: rotate(90deg);
}

.sticky-popover-title {
  font-size: 1.5rem;
  font-weight: 700;
  color: #1f2937;
  margin-bottom: 0.5rem;
}

.sticky-popover-subtitle {
  color: #6b7280;
  margin-bottom: 1.5rem;
  font-size: 0.95rem;
}

.sticky-popover-buttons {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.sticky-popover-button {
  display: flex;
  align-items: center;
  gap: 1rem;
  padding: 1rem 1.25rem;
  border: none;
  border-radius: 12px;
  cursor: pointer;
  text-decoration: none;
  transition: all 0.2s ease;
  min-height: 56px;
  position: relative;
  overflow: hidden;
}

.sticky-popover-button::before {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(135deg, rgba(59, 130, 246, 0.05), rgba(37, 99, 235, 0.05));
  opacity: 0;
  transition: opacity 0.2s ease;
}

.sticky-popover-button:hover::before {
  opacity: 1;
}

.sticky-popover-button i {
  font-size: 1.5rem;
  width: 32px;
  height: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  z-index: 1;
}

.button-content {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 0.25rem;
  z-index: 1;
  text-align: left;
}

.button-title {
  font-weight: 600;
  color: #1f2937;
  font-size: 1rem;
}

.button-subtitle {
  font-size: 0.875rem;
  color: #6b7280;
}

.email-button {
  background: linear-gradient(135deg, #eff6ff, #dbeafe);
  border: 1px solid #bfdbfe;
}

.email-button i {
  color: #3b82f6;
}

.email-button:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(59, 130, 246, 0.2);
}

.phone-button {
  background: linear-gradient(135deg, #f0fdf4, #dcfce7);
  border: 1px solid #bbf7d0;
}

.phone-button i {
  color: #22c55e;
}

.phone-button:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(34, 197, 94, 0.2);
}

/* Sticky Popover Trigger Button */
.sticky-popover-trigger {
  position: fixed;
  right: 20px;
  top: 33.33vh;
  width: auto;
  height: 56px;
  padding: 0 1.5rem;
  border-radius: 28px;
  background: linear-gradient(135deg, #3b82f6 0%, #2563eb 100%);
  color: #fff;
  border: none;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.75rem;
  font-size: 1rem;
  font-weight: 600;
  cursor: pointer;
  box-shadow: 0 4px 20px rgba(59, 130, 246, 0.4);
  z-index: 99;
  transition: all 0.3s ease;
  font-family: inherit;
}

.sticky-popover-trigger:hover {
  transform: translateY(-3px);
  box-shadow: 0 8px 30px rgba(59, 130, 246, 0.5);
}

.sticky-popover-trigger i {
  font-size: 1.25rem;
}

.trigger-text {
  font-weight: 600;
}

/* Animation pulse pour le trigger */
.sticky-popover-trigger::before {
  content: '';
  position: absolute;
  inset: -4px;
  border-radius: 32px;
  background: linear-gradient(135deg, #3b82f6 0%, #2563eb 100%);
  opacity: 0;
  animation: pulse-trigger 2s infinite;
  z-index: -1;
}

@keyframes pulse-trigger {
  0%, 100% {
    transform: scale(1);
    opacity: 0;
  }
  50% {
    transform: scale(1.15);
    opacity: 0.3;
  }
}

/* Responsive Mobile */
@media (max-width: 768px) {
  .sticky-popover {
    right: 10px;
    left: 10px;
    max-width: calc(100% - 20px);
    top: calc(33.33vh + 70px);
    max-height: calc(100vh - 33.33vh - 90px);
  }

  .sticky-popover-content {
    padding: 1.25rem;
  }

  .sticky-popover-title {
    font-size: 1.25rem;
  }

  .sticky-popover-trigger {
    width: 56px;
    height: 56px;
    padding: 0;
    border-radius: 50%;
    right: 10px;
    top: 33.33vh;
  }

  .trigger-text {
    display: none;
  }

  .sticky-popover-button {
    padding: 0.875rem 1rem;
  }

  .button-title {
    font-size: 0.95rem;
  }

  .button-subtitle {
    font-size: 0.8rem;
  }

  .modal-contact-content {
    margin: 0.5rem;
    max-height: 95vh;
    max-width: calc(100% - 1rem);
  }

  .modal-contact-body .col-md-6 {
    width: 100% !important;
  }
}

/* Utility classes for Bootstrap grid in modal */
.modal-contact-body .row {
  display: flex;
  flex-wrap: wrap;
  margin-right: -0.5rem;
  margin-left: -0.5rem;
}

.modal-contact-body .col-12,
.modal-contact-body .col-md-6 {
  position: relative;
  width: 100%;
  padding-right: 0.5rem;
  padding-left: 0.5rem;
}

.modal-contact-body .g-3 {
  --bs-gutter-x: 1rem;
  --bs-gutter-y: 1rem;
}

.modal-contact-body .g-3 > * {
  margin-top: var(--bs-gutter-y);
}

@media (min-width: 768px) {
  .modal-contact-body .col-md-6 {
    flex: 0 0 auto;
    width: 50%;
  }
}

.modal-contact-body .mb-4 {
  margin-bottom: 1.5rem;
}

.modal-contact-body .w-100 {
  width: 100%;
}
