/**
 * OVD Hébergements — Styles frontend
 * Inspiré de ovr-annonces et ovr-gestion-membres
 */

/* ── Variables ──────────────────────────────────────────────────────────────── */
:root {
  --ovr-bleu-nuit:   #1a3a4a;
  --ovr-or:          #d4af37;
  --ovr-or-clair:    #f0e4a8;
  --ovr-vert:        #2d6a4f;
  --ovr-rouge:       #9b2226;
  --ovr-gris-clair:  #f8f5f0;
  --ovr-gris-bord:   #d4c5a9;
  --ovr-texte:       #2c2c2c;
  --ovr-radius:      6px;
  --ovr-shadow:      0 2px 8px rgba(26,58,74,.12);
}

/* ── Wrapper général ─────────────────────────────────────────────────────────── */
.ovd-heb-wrap {
  font-family: Georgia, 'Times New Roman', serif;
  color: var(--ovr-texte);
  max-width: 1100px;
  margin: 0 auto;
  padding: 20px 0;
}
.ovd-heb-wrap h2,
.ovd-heb-wrap h3 {
  color: var(--ovr-bleu-nuit);
  border-bottom: 2px solid var(--ovr-or);
  padding-bottom: 8px;
  margin-bottom: 20px;
}

/* ── Formulaire de recherche ─────────────────────────────────────────────────── */
.ovd-heb-search-form {
  background: var(--ovr-gris-clair);
  border: 1px solid var(--ovr-gris-bord);
  border-radius: var(--ovr-radius);
  padding: 24px;
  margin-bottom: 30px;
}

.ovd-heb-fields-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
  gap: 14px;
  margin-bottom: 18px;
}

.ovr-field {
  display: flex;
  flex-direction: column;
  gap: 5px;
}
.ovr-field.ovr-field-full {
  grid-column: 1 / -1;
}
.ovr-field label {
  font-size: 12px;
  font-weight: bold;
  color: var(--ovr-bleu-nuit);
  text-transform: uppercase;
  letter-spacing: .5px;
}
.ovr-field input[type="text"],
.ovr-field input[type="number"],
.ovr-field input[type="date"],
.ovr-field input[type="email"],
.ovr-field textarea,
.ovr-field select {
  border: 1px solid var(--ovr-gris-bord);
  border-radius: 4px;
  padding: 8px 10px;
  font-size: 14px;
  font-family: inherit;
  background: #fff;
  transition: border-color .2s;
}
.ovr-field input:focus,
.ovr-field textarea:focus {
  outline: none;
  border-color: var(--ovr-or);
  box-shadow: 0 0 0 2px rgba(212,175,55,.2);
}
.ovr-field textarea {
  resize: vertical;
}
.ovr-field input[type="checkbox"] {
  width: 16px;
  height: 16px;
  margin-right: 6px;
  accent-color: var(--ovr-bleu-nuit);
}

/* ── Boutons ─────────────────────────────────────────────────────────────────── */
.ovr-btn {
  display: inline-block;
  padding: 10px 20px;
  border-radius: var(--ovr-radius);
  border: none;
  cursor: pointer;
  font-family: inherit;
  font-size: 14px;
  font-weight: bold;
  letter-spacing: .3px;
  text-decoration: none;
  transition: opacity .2s, transform .1s;
}
.ovr-btn:hover { opacity: .88; transform: translateY(-1px); }
.ovr-btn:active { transform: translateY(0); }

.ovr-btn-primary  { background: var(--ovr-bleu-nuit); color: #fff; }
.ovr-btn-secondary{ background: var(--ovr-or);        color: var(--ovr-bleu-nuit); }
.ovr-btn-success  { background: var(--ovr-vert);      color: #fff; }
.ovr-btn-danger   { background: var(--ovr-rouge);     color: #fff; }
.ovr-btn-neutral  { background: #6c757d;              color: #fff; }
.ovr-btn-small    { padding: 6px 12px; font-size: 12px; }

/* ── Grille de résultats ─────────────────────────────────────────────────────── */
.ovd-heb-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 22px;
  margin-top: 10px;
}

/* ── Carte bien ──────────────────────────────────────────────────────────────── */
.ovd-heb-card {
  background: #fff;
  border: 1px solid var(--ovr-gris-bord);
  border-radius: var(--ovr-radius);
  box-shadow: var(--ovr-shadow);
  overflow: hidden;
  transition: box-shadow .2s, transform .2s;
}
.ovd-heb-card:hover {
  box-shadow: 0 6px 20px rgba(26,58,74,.18);
  transform: translateY(-3px);
}
.ovd-heb-card-photos {
  height: 190px;
  background: var(--ovr-gris-clair);
  overflow: hidden;
  position: relative;
}
.ovd-heb-card-photos img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.ovd-heb-card-photos .no-photo {
  display: flex;
  align-items: center;
  justify-content: center;
  height: 100%;
  font-size: 48px;
  color: var(--ovr-gris-bord);
}
.ovd-heb-card-body {
  padding: 16px;
}
.card-titre {
  margin: 0 0 6px;
  font-size: 16px;
  color: var(--ovr-bleu-nuit);
}
.card-localisation {
  font-size: 13px;
  color: #666;
  margin: 0 0 8px;
}
.card-localisation::before { content: "📍 "; }
.card-capacite {
  font-size: 13px;
  color: var(--ovr-bleu-nuit);
  background: var(--ovr-gris-clair);
  border-radius: 3px;
  padding: 4px 8px;
  display: inline-block;
  margin-bottom: 10px;
}
.card-description {
  font-size: 13px;
  color: #555;
  line-height: 1.5;
  margin-bottom: 14px;
  /* Tronquer à 3 lignes */
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

/* ── Fiche détaillée ─────────────────────────────────────────────────────────── */
.ovd-heb-localisation {
  font-size: 15px;
  color: #555;
  margin-bottom: 20px;
}
.ovd-heb-galerie {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  margin-bottom: 24px;
}
.ovd-heb-galerie img {
  width: calc(33.33% - 6px);
  height: 200px;
  object-fit: cover;
  border-radius: var(--ovr-radius);
  cursor: pointer;
  transition: opacity .2s;
}
.ovd-heb-galerie img:first-child {
  width: 100%;
  height: 320px;
}
.ovd-heb-galerie img:hover { opacity: .9; }

.ovd-heb-details-grid {
  display: grid;
  grid-template-columns: 1fr 360px;
  gap: 30px;
  margin-bottom: 30px;
}
.ovd-heb-desc ul {
  list-style: none;
  padding: 0;
  margin: 14px 0;
}
.ovd-heb-desc ul li::before {
  content: "✓ ";
  color: var(--ovr-vert);
  font-weight: bold;
}

/* ── Calendrier ──────────────────────────────────────────────────────────────── */
#ovd-heb-calendar,
#ovd-heb-cal-fiche {
  background: #fff;
  border: 1px solid var(--ovr-gris-bord);
  border-radius: var(--ovr-radius);
  padding: 12px;
  margin-top: 12px;
}

/* ── Disponibilités (liste + saisie) ─────────────────────────────────────────── */
.ovd-heb-dispos-controls {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  margin-bottom: 12px;
}
.ovd-heb-dispos-controls input[type="date"] {
  border: 1px solid var(--ovr-gris-bord);
  border-radius: 4px;
  padding: 6px 8px;
  font-size: 13px;
}
.ovd-heb-dispos-controls span {
  font-size: 13px;
  color: #666;
}
.ovd-heb-dispos-list {
  margin-top: 10px;
}
.ovr-dispo-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 6px 10px;
  background: #edf7f1;
  border-left: 3px solid var(--ovr-vert);
  border-radius: 3px;
  margin-bottom: 5px;
  font-size: 13px;
}
.ovr-dispo-item .btn-del-dispo {
  margin-left: auto;
  background: none;
  border: none;
  color: var(--ovr-rouge);
  cursor: pointer;
  font-size: 16px;
  padding: 0 4px;
}

/* ── Formulaire de demande de réservation ────────────────────────────────────── */
.ovd-heb-demande-form {
  background: var(--ovr-gris-clair);
  border: 1px solid var(--ovr-gris-bord);
  border-radius: var(--ovr-radius);
  padding: 24px;
  margin-top: 30px;
}
.ovd-heb-demande-form h3 {
  margin-top: 0;
}

/* ── Feedback / messages ─────────────────────────────────────────────────────── */
.ovd-heb-feedback {
  margin-top: 14px;
  padding: 12px 16px;
  border-radius: var(--ovr-radius);
  font-size: 14px;
  display: none;
}
.ovd-heb-feedback.success {
  background: #d4edda;
  border: 1px solid #b8dfc6;
  color: #155724;
  display: block;
}
.ovd-heb-feedback.error {
  background: #f8d7da;
  border: 1px solid #f1b0b7;
  color: #721c24;
  display: block;
}

/* ── Tableau bord réservations ───────────────────────────────────────────────── */
.ovd-heb-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 14px;
}
.ovd-heb-table th {
  background: var(--ovr-bleu-nuit) !important;
  color: #ffffff !important;
  padding: 10px 12px;
  text-align: left;
  font-weight: normal;
  letter-spacing: .3px;
}
.ovd-heb-table td {
  padding: 9px 12px;
  border-bottom: 1px solid var(--ovr-gris-bord);
  vertical-align: middle;
}
.ovd-heb-table tr:hover td { background: var(--ovr-gris-clair); }

/* Badges statut */
.ovr-statut {
  display: inline-block;
  padding: 3px 10px;
  border-radius: 12px;
  font-size: 12px;
  font-weight: bold;
}
.ovr-statut-en-attente         { background: #fff3cd; color: #856404; }
.ovr-statut-acceptee           { background: #d4edda; color: #155724; }
.ovr-statut-refusee            { background: #f8d7da; color: #721c24; }
.ovr-statut-annulee            { background: #e2e3e5; color: #383d41; }
.ovr-statut-precision-demandee { background: #d1ecf1; color: #0c5460; }

/* ── Gestion du bien (Offreur) ───────────────────────────────────────────────── */
.ovd-heb-mes-biens {
  margin-bottom: 16px;
}
.ovd-heb-bien-item {
  display: flex;
  align-items: center;
  padding: 10px 14px;
  background: #fff;
  border: 1px solid var(--ovr-gris-bord);
  border-radius: var(--ovr-radius);
  margin-bottom: 8px;
  gap: 10px;
}
.ovd-heb-actions { margin-left: auto; display: flex; gap: 6px; }

.ovd-heb-form-actions {
  display: flex;
  gap: 10px;
  margin-top: 20px;
  padding-top: 16px;
  border-top: 1px solid var(--ovr-gris-bord);
}

/* ── Photos preview ──────────────────────────────────────────────────────────── */
.ovd-heb-photos-preview {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 8px;
}
.ovd-heb-photos-preview .photo-thumb {
  position: relative;
  width: 100px;
  height: 80px;
}
.ovd-heb-photos-preview img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  border-radius: 4px;
  border: 1px solid var(--ovr-gris-bord);
}
.ovd-heb-photos-preview .del-photo {
  position: absolute;
  top: -6px;
  right: -6px;
  background: var(--ovr-rouge);
  color: #fff;
  border: none;
  border-radius: 50%;
  width: 20px;
  height: 20px;
  font-size: 12px;
  cursor: pointer;
  line-height: 20px;
  text-align: center;
  padding: 0;
}

/* ── Accès refusé ────────────────────────────────────────────────────────────── */
.ovd-heb-acces-refuse {
  background: var(--ovr-gris-clair);
  border: 1px solid var(--ovr-gris-bord);
  border-radius: var(--ovr-radius);
  padding: 24px;
  text-align: center;
  color: #555;
}
.ovd-heb-acces-refuse a { color: var(--ovr-bleu-nuit); font-weight: bold; }

/* ── Loading ─────────────────────────────────────────────────────────────────── */
.ovd-heb-loading {
  text-align: center;
  padding: 30px;
  color: #888;
  font-style: italic;
}

/* ── Pagination ──────────────────────────────────────────────────────────────── */
.ovd-heb-pagination {
  display: flex;
  justify-content: center;
  gap: 6px;
  margin-top: 24px;
}
.ovd-heb-pagination button {
  padding: 6px 14px;
  border: 1px solid var(--ovr-gris-bord);
  background: #fff;
  border-radius: 4px;
  cursor: pointer;
  font-family: inherit;
  font-size: 13px;
}
.ovd-heb-pagination button.active {
  background: var(--ovr-bleu-nuit);
  color: #fff;
  border-color: var(--ovr-bleu-nuit);
}
.ovd-heb-pagination button:hover:not(.active) {
  background: var(--ovr-gris-clair);
}

/* ── Vide ────────────────────────────────────────────────────────────────────── */
.ovr-empty {
  text-align: center;
  color: #888;
  font-style: italic;
  padding: 30px;
}

/* ── Responsive ──────────────────────────────────────────────────────────────── */
@media (max-width: 768px) {
  .ovd-heb-details-grid { grid-template-columns: 1fr; }
  .ovd-heb-galerie img  { width: calc(50% - 4px); }
  .ovd-heb-galerie img:first-child { width: 100%; height: 220px; }
  .ovd-heb-fields-grid  { grid-template-columns: 1fr 1fr; }
}
@media (max-width: 480px) {
  .ovd-heb-fields-grid  { grid-template-columns: 1fr; }
  .ovd-heb-galerie img  { width: 100%; }
}

/* ── Formulaire de connexion inline ─────────────────────────────────────────── */
.ovd-heb-login-wrap {
  display: flex;
  justify-content: center;
  padding: 40px 20px;
}
.ovd-heb-login-box {
  background: #fff;
  border: 1px solid var(--ovr-gris-bord);
  border-radius: var(--ovr-radius);
  box-shadow: var(--ovr-shadow);
  width: 100%;
  max-width: 420px;
  overflow: hidden;
}
.ovd-heb-login-header {
  background: var(--ovr-bleu-nuit);
  padding: 28px 30px 22px;
  text-align: center;
}
.ovd-heb-login-logo {
  font-size: 40px;
  color: var(--ovr-or);
  line-height: 1;
  margin-bottom: 8px;
}
.ovd-heb-login-header h2 {
  color: var(--ovr-or);
  font-size: 20px;
  margin: 0 0 8px;
  border: none;
  padding: 0;
  letter-spacing: 2px;
}
.ovd-heb-login-header p {
  color: #a0b4bc;
  font-size: 13px;
  margin: 0;
  line-height: 1.5;
}
.ovd-heb-login-header a {
  color: var(--ovr-or);
}
.ovd-heb-login-body {
  padding: 28px 30px;
}

/* Surcharge styles natifs WP login form */
.ovd-heb-login-body #loginform {
  padding: 0;
  background: none;
  border: none;
  box-shadow: none;
  margin: 0;
}
.ovd-heb-login-body #loginform p {
  margin-bottom: 16px;
}
.ovd-heb-login-body #loginform label {
  font-size: 12px;
  font-weight: bold;
  color: var(--ovr-bleu-nuit);
  text-transform: uppercase;
  letter-spacing: .5px;
  display: block;
  margin-bottom: 5px;
}
.ovd-heb-login-body #loginform input[type="text"],
.ovd-heb-login-body #loginform input[type="password"] {
  width: 100%;
  border: 1px solid var(--ovr-gris-bord);
  border-radius: 4px;
  padding: 9px 12px;
  font-size: 14px;
  font-family: inherit;
  box-sizing: border-box;
  transition: border-color .2s;
}
.ovd-heb-login-body #loginform input:focus {
  outline: none;
  border-color: var(--ovr-or);
  box-shadow: 0 0 0 2px rgba(212,175,55,.2);
}
.ovd-heb-login-body #loginform .forgetmenot {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 13px;
  color: #666;
}
.ovd-heb-login-body #loginform input[type="checkbox"] {
  accent-color: var(--ovr-bleu-nuit);
}
.ovd-heb-login-body #loginform input[type="submit"] {
  width: 100%;
  background: var(--ovr-bleu-nuit);
  color: #fff;
  border: none;
  border-radius: var(--ovr-radius);
  padding: 11px;
  font-size: 15px;
  font-family: inherit;
  font-weight: bold;
  cursor: pointer;
  letter-spacing: .5px;
  margin-top: 8px;
  transition: opacity .2s;
}
.ovd-heb-login-body #loginform input[type="submit"]:hover {
  opacity: .88;
}
.ovd-heb-login-body .login-remember {
  margin-bottom: 0 !important;
}

/* Accès refusé (membre non validé) */
.ovd-heb-acces-refuse {
  background: var(--ovr-gris-clair);
  border: 1px solid var(--ovr-gris-bord);
  border-left: 4px solid var(--ovr-or);
  border-radius: var(--ovr-radius);
  padding: 20px 24px;
  text-align: center;
  color: #555;
}
.ovd-heb-acces-refuse a {
  color: var(--ovr-bleu-nuit);
  font-weight: bold;
}

/* ── Correction header login (sans logo ni titre) ────────────────────────────── */
.ovd-heb-login-header {
  background: var(--ovr-bleu-nuit);
  padding: 18px 30px;
  text-align: center;
}
.ovd-heb-login-header p {
  color: #a0b4bc;
  font-size: 13px;
  margin: 0;
  line-height: 1.5;
}
.ovd-heb-login-logo,
.ovd-heb-login-header h2 {
  display: none !important;
}

/* ── Bouton pleine largeur ───────────────────────────────────────────────────── */
.ovd-btn-full { width: 100%; text-align: center; display: block; box-sizing: border-box; }

/* ── Intro formulaire login ──────────────────────────────────────────────────── */
.ovd-login-intro {
  font-size: 14px;
  color: #555;
  margin-bottom: 18px;
  line-height: 1.6;
  text-align: center;
}

/* ── Barre membre connecté ───────────────────────────────────────────────────── */
.ovd-heb-membre-bar {
  background: var(--ovr-bleu-nuit);
  color: #a0b4bc;
  font-size: 13px;
  padding: 8px 16px;
  border-radius: var(--ovr-radius);
  margin-bottom: 20px;
}
.ovd-heb-membre-bar strong { color: var(--ovr-or); }
.ovd-heb-membre-bar a { color: #a0b4bc; text-decoration: underline; }

/* ── Déconnexion ─────────────────────────────────────────────────────────────── */
.ovd-heb-deconnexion {
  font-size: 13px;
  color: #555;
  text-align: right;
  margin-bottom: 10px;
}

/* ── Carte Leaflet ─────────────────────────────────────────────────────────── */
.ovd-heb-map-wrap {
    margin: 20px 0;
}
.ovd-heb-map-wrap h4 {
    margin-bottom: 4px;
}
.ovd-heb-map-notice {
    font-size: 0.85em;
    color: #666;
    margin-bottom: 8px;
}
#ovd-heb-map {
    width: 100%;
    height: 350px;
    border-radius: 8px;
    border: 1px solid #ddd;
    z-index: 0;
}

/* ── Badge photo en attente ────────────────────────────────────────────────── */
.photo-thumb { position: relative; display: inline-block; margin: 4px; }
.photo-pending-badge {
    position: absolute;
    bottom: 4px; left: 4px;
    background: rgba(0,0,0,0.6);
    color: #fff;
    font-size: 0.7em;
    padding: 2px 5px;
    border-radius: 3px;
}

/* ── Fiche bien — corrections visuelles ───────────────────────────────────── */
.ovd-heb-caracteristiques {
    list-style: none;
    padding: 0;
    margin: 12px 0;
    display: flex;
    flex-wrap: wrap;
    gap: 8px 20px;
}
.ovd-heb-caracteristiques li {
    font-size: 0.95em;
    color: #333;
}
.ovd-heb-calendar-view {
    margin-top: 24px;
    width: 100%;
}
.ovd-heb-calendar-view h4 {
    margin-bottom: 12px;
    font-size: 1.1em;
}

/* ── Calendrier FullCalendar — corrections ─────────────────────────────────── */
.fc .fc-button {
    padding: 3px 8px !important;
    font-size: 0.8em !important;
    line-height: 1.4 !important;
}
.fc .fc-toolbar.fc-header-toolbar {
    align-items: center !important;
    gap: 6px !important;
    flex-wrap: wrap !important;
}
.fc .fc-toolbar-title {
    font-size: 1em !important;
}
/* Jours et dates en noir */
.fc .fc-col-header-cell-cushion,
.fc .fc-daygrid-day-number {
    color: #000 !important;
    text-decoration: none !important;
}

/* ── Formulaire demande de séjour — textarea pleine largeur ───────────────── */
#demande-message {
    width: 100%;
    box-sizing: border-box;
    min-height: 90px;
}

/* ── Mon Compte ───────────────────────────────────────────────────────────── */
.ovd-heb-mon-compte h2 {
    color: var(--ovr-bleu-nuit);
    border-bottom: 2px solid var(--ovr-or);
    padding-bottom: 8px;
    margin-bottom: 24px;
}
.ovd-heb-compte-grid {
    display: flex;
    flex-wrap: wrap;
    gap: 20px;
    margin-bottom: 24px;
}
.ovd-heb-compte-bloc {
    flex: 1 1 260px;
    background: #faf7f2;
    border: 1px solid var(--ovr-gris-bord);
    border-radius: 6px;
    padding: 16px 20px;
}
.ovd-heb-compte-bloc.ovd-heb-compte-full {
    flex: 1 1 100%;
}
.ovd-heb-compte-bloc h3 {
    color: var(--ovr-bleu-nuit);
    font-size: 14px;
    text-transform: uppercase;
    letter-spacing: 1px;
    margin: 0 0 12px;
    border-bottom: 1px solid var(--ovr-gris-bord);
    padding-bottom: 8px;
}
.ovd-heb-compte-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 14px;
}
.ovd-heb-compte-table th {
    color: #666;
    font-weight: normal;
    text-align: left;
    padding: 5px 10px 5px 0;
    width: 120px;
    vertical-align: top;
}
.ovd-heb-compte-table td {
    color: #222;
    padding: 5px 0;
    font-weight: 500;
}
.ovd-heb-compte-actions {
    display: flex;
    align-items: center;
    gap: 20px;
    flex-wrap: wrap;
}
.ovd-heb-compte-note {
    font-size: 13px;
    color: #666;
    margin: 0;
    flex: 1;
}

/* ── Badge recharge VE ───────────────────────────────────────────── */
.ovd-badge-ve {
    display: inline-block;
    margin-left: 8px;
    padding: 2px 7px;
    background: #e8f4e8;
    color: #2d6a4f;
    border: 1px solid #b7ddb7;
    border-radius: 12px;
    font-size: 11px;
    font-weight: 600;
    vertical-align: middle;
    white-space: nowrap;
}
