/* Styles pour le portail partenaire */

/* Dashboard styles */
.dashboard-header {
  margin-bottom: 2rem;
}

.dashboard-stats {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: 1rem;
  margin: 1.5rem 0;
}

.stat-card {
  background: var(--vert);
  color: white;
  padding: 1.5rem;
  border-radius: var(--radius);
  text-align: center;
  box-shadow: var(--ombre);
}

.stat-number {
  font-size: 2rem;
  font-weight: bold;
  margin-bottom: 0.5rem;
}

.stat-label {
  font-size: 0.9rem;
  opacity: 0.9;
}

.dashboard-nav {
  display: flex;
  gap: 0.5rem;
  margin-bottom: 2rem;
  flex-wrap: wrap;
}

.dashboard-section {
  background: white;
  padding: 2rem;
  border-radius: var(--radius);
  box-shadow: var(--ombre);
}

.dashboard-section h3 {
  margin-bottom: 1.5rem;
  color: var(--vert);
}

/* Forms */
.form-partenaire {
  max-width: 100%;
}

.form-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1rem;
}

.form-group {
  margin-bottom: 1.5rem;
}

.form-group label {
  display: block;
  margin-bottom: 0.5rem;
  font-weight: 600;
  color: var(--noir);
}

.form-group input,
.form-group select,
.form-group textarea {
  width: 100%;
  padding: 0.75rem;
  border: 2px solid var(--gris-clair);
  border-radius: var(--radius);
  font-size: 1rem;
  transition: border-color 0.3s ease;
}

.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
  outline: none;
  border-color: var(--vert);
}

/* Terrains grid */
.terrains-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: 1.5rem;
  margin-top: 1rem;
}

.terrain-card {
  background: white;
  border-radius: var(--radius);
  padding: 1.5rem;
  box-shadow: var(--ombre);
  border-left: 4px solid var(--vert);
}

.terrain-card h4 {
  margin-bottom: 0.5rem;
  color: var(--vert);
}

.terrain-card .terrain-info {
  color: var(--gris);
  font-size: 0.9rem;
  margin-bottom: 1rem;
}

.terrain-card .terrain-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 0.75rem;
  margin-bottom: 0.75rem;
}

.terrain-card .terrain-header h4 {
  margin: 0;
  flex: 1;
  line-height: 1.3;
}

.terrain-card .terrain-actions {
  display: flex;
  gap: 0.5rem;
  flex-wrap: wrap;
}

.status-actif {
  background: var(--vert);
  color: white;
  padding: 0.2rem 0.65rem;
  border-radius: var(--radius);
  font-size: 0.75rem;
  font-weight: 600;
  text-transform: uppercase;
  white-space: nowrap;
}

.status-inactif {
  background: var(--gris);
  color: white;
  padding: 0.2rem 0.65rem;
  border-radius: var(--radius);
  font-size: 0.75rem;
  font-weight: 600;
  text-transform: uppercase;
  white-space: nowrap;
}

/* Reservations list */
.reservations-list {
  margin-top: 1rem;
}

.reservation-item {
  background: var(--gris-clair);
  padding: 1rem;
  border-radius: var(--radius);
  margin-bottom: 1rem;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.reservation-info h4 {
  margin-bottom: 0.25rem;
}

.reservation-info .reservation-details {
  color: var(--gris);
  font-size: 0.9rem;
}

.reservation-status {
  padding: 0.25rem 0.75rem;
  border-radius: var(--radius);
  font-size: 0.8rem;
  font-weight: 600;
}

.reservation-status.en_attente {
  background: var(--jaune);
  color: var(--noir);
}

.reservation-status.confirmee {
  background: var(--vert);
  color: white;
}

.reservation-status.annulee {
  background: var(--rouge);
  color: white;
}

/* Notifications */
.notifications-list {
  margin-top: 1rem;
}

.notification-item {
  background: white;
  border-left: 4px solid var(--vert);
  padding: 1rem;
  border-radius: var(--radius);
  margin-bottom: 1rem;
  box-shadow: var(--ombre);
}

.notification-item.unread {
  background: var(--jaune-clair);
  border-left-color: var(--jaune);
}

.notification-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 0.5rem;
}

.notification-title {
  font-weight: 600;
  color: var(--noir);
}

.notification-date {
  color: var(--gris);
  font-size: 0.8rem;
}

.notification-content {
  color: var(--gris);
  font-size: 0.9rem;
  white-space: pre-wrap;
}

/* Section actions */
.section-actions {
  margin-bottom: 1.5rem;
}

.notification-actions {
  margin-bottom: 1rem;
}

/* Filters */
.reservations-filters {
  margin-bottom: 1rem;
}

.reservations-filters select {
  padding: 0.5rem;
  border: 2px solid var(--gris-clair);
  border-radius: var(--radius);
  background: white;
}

/* Responsive */
@media (max-width: 768px) {
  .form-row {
    grid-template-columns: 1fr;
  }
  
  .dashboard-nav {
    flex-direction: column;
  }
  
  .dashboard-stats {
    grid-template-columns: 1fr;
  }
  
  .terrains-grid {
    grid-template-columns: 1fr;
  }
  
  .reservation-item {
    flex-direction: column;
    align-items: flex-start;
    gap: 1rem;
  }
}

/* Modal styles — z-index élevé pour passer au-dessus du header fixe / autres couches */
.modal {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.55);
  z-index: 10050;
  box-sizing: border-box;
  overflow-y: auto;
  padding: 1.5rem 1rem;
  align-items: flex-start;
  justify-content: center;
}

.modal.modal-visible {
  display: flex;
}

.modal-content {
  background: white;
  padding: 2rem;
  border-radius: var(--radius);
  max-width: 520px;
  width: 100%;
  margin: 0 auto 2rem;
  position: relative;
  box-sizing: border-box;
  max-height: calc(100vh - 3rem);
  overflow-y: auto;
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.15);
}

.modal-actions {
  display: flex;
  gap: 0.75rem;
  flex-wrap: wrap;
  margin-top: 1.25rem;
}

.modal-close {
  position: absolute;
  top: 1rem;
  right: 1rem;
  background: none;
  border: none;
  font-size: 1.5rem;
  cursor: pointer;
  color: var(--gris);
}

.modal-close:hover {
  color: var(--noir);
}

/* Modale réservation — en-tête et résumé lisibles */
.modal-content.modal-content--resa {
  display: flex;
  flex-direction: column;
  padding: 0;
  max-width: 560px;
  max-height: min(92vh, 720px);
  overflow: hidden;
}

.resa-modal-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 1rem;
  flex-shrink: 0;
  padding: 1rem 1rem 1rem 1.25rem;
  background: linear-gradient(165deg, #e6f4ec 0%, #f8fcfa 55%, #ffffff 100%);
  border-bottom: 3px solid var(--vert, #00853d);
  box-shadow: 0 1px 0 rgba(0, 0, 0, 0.06);
}

.resa-modal-heading {
  margin: 0;
  flex: 1;
  min-width: 0;
  font-size: clamp(1.15rem, 3.5vw, 1.45rem);
  font-weight: 800;
  line-height: 1.28;
  letter-spacing: -0.02em;
  color: #0a1f14;
}

.modal-close.modal-close--resa {
  position: static;
  flex-shrink: 0;
  width: 2.75rem;
  height: 2.75rem;
  margin: 0;
  padding: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 12px;
  background: #fff;
  border: 2px solid #b8d4c4;
  font-size: 1.5rem;
  font-weight: 700;
  line-height: 1;
  color: #143d2a;
  cursor: pointer;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.06);
}

.modal-close.modal-close--resa:hover {
  background: #f0faf4;
  border-color: var(--vert, #00853d);
  color: #000;
}

.resa-modal-body {
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  overflow-x: hidden;
  padding: 1.15rem 1.25rem 1.35rem;
  -webkit-overflow-scrolling: touch;
}

.resa-summary-card {
  background: #fff;
  border: 2px solid #c8ddd2;
  border-radius: 14px;
  padding: 1.15rem 1.2rem 1.25rem;
  margin: 0 0 1.1rem;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.9), 0 2px 12px rgba(0, 83, 45, 0.06);
}

.resa-summary-card::before {
  content: 'Résumé de la réservation';
  display: block;
  font-size: 0.72rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: #2d6b4a;
  margin-bottom: 0.85rem;
  padding-bottom: 0.5rem;
  border-bottom: 1px solid #d4e8dd;
}

/* Une ligne = libellé au-dessus, valeur en grand */
.modal-content--resa .resa-dl {
  display: block;
  margin: 0;
}

.modal-content--resa .resa-dl dt {
  margin: 0.95rem 0 0 0;
  font-size: 0.72rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.07em;
  color: #3a5c48;
  line-height: 1.35;
}

.modal-content--resa .resa-dl dt:first-of-type {
  margin-top: 0;
}

.modal-content--resa .resa-dl dd {
  margin: 0.28rem 0 0 0;
  font-size: 1.08rem;
  font-weight: 600;
  line-height: 1.45;
  color: #0d1110;
  word-break: break-word;
}

.modal-content--resa .resa-dl dd .reservation-status {
  font-size: 0.95rem;
  vertical-align: middle;
}

.resa-subtitle {
  margin: 1.35rem 0 0.55rem;
  font-size: 0.82rem;
  font-weight: 800;
  color: #0a5c32;
  text-transform: uppercase;
  letter-spacing: 0.06em;
}

.resa-sep {
  border: none;
  border-top: 1px solid #e5e5e5;
  margin: 0.25rem 0 0;
}

.resa-hint {
  font-size: 0.86rem;
  color: #444;
  margin: 0 0 0.65rem;
  line-height: 1.5;
}

.resa-select-wide,
.resa-textarea {
  width: 100%;
  max-width: 100%;
  box-sizing: border-box;
  font-size: 1rem;
}

.modal-content--resa .form-group label:not(.visually-hidden):not(.resa-check-line) {
  font-size: 0.92rem;
  font-weight: 700;
  color: #222;
}

.resa-notify-block {
  background: #f7faf8;
  border: 2px solid #dce8e0;
  border-radius: 12px;
  padding: 1rem 1.1rem;
  margin-bottom: 0.25rem;
}

.resa-check-line {
  display: flex;
  align-items: center;
  gap: 0.55rem;
  margin: 0.4rem 0;
  font-size: 0.95rem;
  font-weight: 600;
  color: #1a1a1a;
  cursor: pointer;
}

.resa-notify-channels {
  margin: 0.45rem 0 0.75rem 0.1rem;
  padding: 0.5rem 0.65rem;
  display: flex;
  flex-wrap: wrap;
  gap: 0.65rem 1.35rem;
  background: #fff;
  border-radius: 10px;
  border: 1px solid #e0ebe4;
}

.resa-preview-label {
  display: block;
  font-size: 0.8rem;
  font-weight: 800;
  color: #2d4a3a;
  margin: 0.55rem 0 0.35rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.resa-preview {
  width: 100%;
  box-sizing: border-box;
  font-family: ui-monospace, 'Cascadia Code', monospace;
  font-size: 0.84rem;
  line-height: 1.5;
  padding: 0.75rem 0.85rem;
  border: 2px solid #cfdad4;
  border-radius: 10px;
  resize: vertical;
  min-height: 7.5rem;
  background: #fff;
  color: #111;
}

.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.modal-content--resa .modal-actions {
  margin-top: 1.35rem;
  padding-top: 1rem;
  border-top: 1px solid #e8ece9;
}

@media (max-width: 400px) {
  .resa-modal-header {
    flex-direction: column-reverse;
    align-items: stretch;
  }
  .modal-close.modal-close--resa {
    align-self: flex-end;
  }
}

/* Loading states */
.loading {
  text-align: center;
  padding: 2rem;
  color: var(--gris);
}

.loading-spinner {
  border: 3px solid var(--gris-clair);
  border-top: 3px solid var(--vert);
  border-radius: 50%;
  width: 40px;
  height: 40px;
  animation: spin 1s linear infinite;
  margin: 0 auto 1rem;
}

@keyframes spin {
  0% { transform: rotate(0deg); }
  100% { transform: rotate(360deg); }
}

/* Empty states */
.empty-state {
  text-align: center;
  padding: 3rem;
  color: var(--gris);
}

.empty-state h4 {
  margin-bottom: 1rem;
  color: var(--gris);
}

.empty-state p {
  margin-bottom: 1.5rem;
}

/* Success messages */
.success-message {
  position: fixed;
  bottom: 1.25rem;
  left: 50%;
  transform: translateX(-50%);
  z-index: 10100;
  min-width: 260px;
  max-width: min(420px, 92vw);
  box-shadow: 0 6px 24px rgba(0, 0, 0, 0.18);
  background: var(--vert);
  color: white;
  padding: 1rem 1.25rem;
  border-radius: var(--radius);
  text-align: center;
  font-size: 0.95rem;
}

/* Error messages */
.error-message {
  position: fixed;
  bottom: 1.25rem;
  left: 50%;
  transform: translateX(-50%);
  z-index: 10100;
  min-width: 260px;
  max-width: min(420px, 92vw);
  box-shadow: 0 6px 24px rgba(0, 0, 0, 0.18);
  background: var(--rouge);
  color: white;
  padding: 1rem 1.25rem;
  border-radius: var(--radius);
  text-align: center;
  font-size: 0.95rem;
}
