/* ============================================================
   Scalo Sud — Feuille de style principale
   Design méditerranéen élégant
   ============================================================ */

/* === BASE === */
html { scroll-behavior: smooth; }
*, *::before, *::after { box-sizing: border-box; }

body {
    font-family: 'Open Sans', Arial, sans-serif;
    background-color: #F5F2ED;
    color: #2D2926;
    margin: 0;
    padding: 0;
    -webkit-font-smoothing: antialiased;
}

h1, h2, h3, h4, h5, h6 { font-family: 'Playfair Display', serif; outline: none; }

/* ========== PALM TREE NAVBAR ANIMATION ========== */

.palm-nav-container {
    position: absolute;
    left: 50%;
    bottom: 0;
    transform: translateX(-50%);
    width: 82px;
    height: 68px;
    pointer-events: none;
    z-index: 0;
    overflow: visible;
    /* Autorise le débordement haut/côtés (feuilles) mais coupe au bas de la navbar */
    clip-path: inset(-200px -200px 0px -200px);
}

.palm-sway-wrapper {
    width: 100%;
    height: 100%;
    transform-origin: 43px 66px;
    animation: palm-idle-sway 6s ease-in-out 2.8s infinite;
}

.palm-nav-svg {
    display: block;
    overflow: visible;
}

/* Sol qui s'écarte quand le tronc perce */
.ground-left  { animation: ground-split-left  0.6s cubic-bezier(0.25,0.46,0.45,0.94) 0.15s both; }
.ground-right { animation: ground-split-right 0.6s cubic-bezier(0.25,0.46,0.45,0.94) 0.15s both; }
@keyframes ground-split-left  { to { transform: translateX(-8px) translateY(3px); } }
@keyframes ground-split-right { to { transform: translateX(8px)  translateY(3px); } }

/* Particules de terre qui s'envolent */
.dp { opacity: 0; }
.dp1 { animation: dp1 0.9s ease-out 0.2s  forwards; }
.dp2 { animation: dp2 0.9s ease-out 0.25s forwards; }
.dp3 { animation: dp3 0.7s ease-out 0.2s  forwards; }
.dp4 { animation: dp4 0.7s ease-out 0.3s  forwards; }
.dp5 { animation: dp5 0.8s ease-out 0.35s forwards; }
.dp6 { animation: dp6 0.8s ease-out 0.3s  forwards; }
@keyframes dp1 { 0%{opacity:1;transform:translate(0,0) scale(1)} 100%{opacity:0;transform:translate(-15px,-10px) scale(0.3)} }
@keyframes dp2 { 0%{opacity:1;transform:translate(0,0) scale(1)} 100%{opacity:0;transform:translate(15px,-10px)  scale(0.3)} }
@keyframes dp3 { 0%{opacity:1;transform:translate(0,0) scale(1)} 100%{opacity:0;transform:translate(-20px,-5px)  scale(0.2)} }
@keyframes dp4 { 0%{opacity:1;transform:translate(0,0) scale(1)} 100%{opacity:0;transform:translate(20px,-5px)   scale(0.2)} }
@keyframes dp5 { 0%{opacity:1;transform:translate(0,0) scale(1)} 100%{opacity:0;transform:translate(-9px,-16px)  scale(0.2)} }
@keyframes dp6 { 0%{opacity:1;transform:translate(0,0) scale(1)} 100%{opacity:0;transform:translate(9px,-16px)   scale(0.2)} }

/* Tronc qui pousse du bas vers le haut */
.palm-trunk-fill {
    transform-origin: 43px 66px;
    transform: scaleY(0);
    animation: trunk-grow 1.0s cubic-bezier(0.25,0.46,0.45,0.94) 0.1s forwards;
}
@keyframes trunk-grow { to { transform: scaleY(1); } }

/* Anneaux du tronc apparaissent après la pousse */
.palm-ring {
    opacity: 0;
    animation: fade-in 0.3s ease-out 1.1s forwards;
}

/* Couronne */
.palm-crown {
    transform-origin: 41px 23px;
    transform: scale(0);
    animation: pop-in 0.35s cubic-bezier(0.34,1.56,0.64,1) 1.0s forwards;
}

/* Feuilles qui se déploient une à une */
.palm-frond {
    transform-origin: 41px 23px;
    transform: scale(0);
    opacity: 0;
    animation: frond-deploy 0.55s cubic-bezier(0.34,1.56,0.64,1) var(--d) forwards;
}
.pf1 { --d: 1.10s; }
.pf2 { --d: 1.22s; }
.pf3 { --d: 1.34s; }
.pf4 { --d: 1.46s; }
.pf5 { --d: 1.52s; }
.pf6 { --d: 1.64s; }
.pf7 { --d: 1.76s; }
.pf8 { --d: 1.88s; }
.pf9 { --d: 2.02s; }
@keyframes frond-deploy {
    0%  { transform: scale(0); opacity: 0; }
    50% { opacity: 1; }
    to  { transform: scale(1); opacity: 1; }
}

/* Noix de coco statiques */
.palm-coconut {
    transform-box: fill-box;
    transform-origin: center;
    transform: scale(0);
    opacity: 0;
    animation: pop-in 0.4s cubic-bezier(0.34,1.56,0.64,1) 2.4s forwards;
}

/* Noix de coco qui tombe */
.palm-coconut-fall {
    opacity: 0;
    transform-box: fill-box;
    transform-origin: center;
    animation: coconut-fall 1.4s ease-in 3.3s forwards;
}
@keyframes coconut-fall {
    /* Chute accélérée (gravité) */
    0%  { opacity:1; transform:translate(0,0) rotate(0deg);
          animation-timing-function: cubic-bezier(0.55,0,1,0.45); }
    /* Impact au sol */
    78% { transform:translate(5px,42px) rotate(195deg);
          animation-timing-function: cubic-bezier(0.15,0.8,0.4,1); }
    /* Rebond */
    86% { transform:translate(5px,34px) rotate(212deg);
          animation-timing-function: cubic-bezier(0.55,0,1,0.45); }
    /* Retombe */
    93% { transform:translate(5px,42px) rotate(224deg);
          animation-timing-function: ease-out; }
    /* Petit rebond final */
    97% { transform:translate(5px,39px) rotate(227deg); }
    /* Posée */
    100%{ opacity:1; transform:translate(5px,42px) rotate(228deg); }
}

/* Poussière d'impact */
.coconut-impact {
    opacity: 0;
    transform-box: fill-box;
    transform-origin: center;
    animation: coconut-impact-anim 0.5s ease-out 4.39s forwards;
}
@keyframes coconut-impact-anim {
    0%   { opacity: 0.55; transform: scaleX(0.4); }
    40%  { opacity: 0.3;  transform: scaleX(2); }
    100% { opacity: 0;    transform: scaleX(3); }
}

/* Keyframes partagés */
@keyframes fade-in { to { opacity: 1; } }
@keyframes pop-in  { to { transform: scale(1); opacity: 1; } }

/* Balancement continu */
@keyframes palm-idle-sway {
    0%, 100% { transform: rotate(0deg); }
    30%       { transform: rotate(1.8deg); }
    70%       { transform: rotate(-1.8deg); }
}
/* ================================================= */

/* === HERO FULL PAGE === */
.hero-section {
    position: relative;
    min-height: calc(100vh - 64px);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    background-size: cover;
    background-position: center;
    background-attachment: fixed;
    text-align: center;
    overflow: hidden;
}

@media (max-width: 768px) {
    .hero-section { background-attachment: scroll; }
}

.hero-overlay {
    position: absolute;
    inset: 0;
    background: linear-gradient(to bottom, rgba(0,0,0,0.25) 0%, rgba(0,0,0,0.55) 100%);
    z-index: 1;
}

.hero-content {
    position: relative;
    z-index: 2;
    padding: 20px 24px;
    width: 100%;
    max-width: 760px;
    margin: 0 auto;
}

.hero-title {
    font-family: 'Playfair Display', serif;
    font-size: clamp(2rem, 6vw, 4.5rem);
    font-weight: 700;
    color: white;
    line-height: 1.15;
    margin: 0 0 24px;
    text-shadow: 0 2px 16px rgba(0,0,0,0.35);
    outline: none;
}

.hero-scroll-hint {
    display: flex;
    justify-content: center;
    margin-top: 24px;
    animation: bounce 2.5s infinite;
}

@keyframes bounce {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(10px); }
}

/* === PAGE HERO (inner pages) === */
.page-hero {
    position: relative;
    min-height: 320px;
    display: flex;
    align-items: flex-end;
    background-size: cover;
    background-position: center;
}

.page-hero-content {
    position: relative;
    z-index: 2;
    padding: 48px 24px;
    max-width: 1200px;
    margin: 0 auto;
    width: 100%;
    text-align: center;
}

/* === SECTIONS === */
.section-padding { padding: 80px 0; }

@media (max-width: 768px) {
    .section-padding { padding: 48px 0; }
}

.section-header {
    text-align: center;
    margin-bottom: 52px;
}

.section-title {
    font-family: 'Playfair Display', serif;
    font-size: clamp(1.8rem, 4vw, 2.8rem);
    font-weight: 700;
    color: #2D2926;
    margin: 8px 0 16px;
}

/* === CARDS === */
.accommodation-card {
    transition: transform 0.25s ease, box-shadow 0.25s ease;
    background: white;
}

.accommodation-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 16px 40px rgba(0,0,0,0.1) !important;
}

.card-img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.4s ease;
    display: block;
}

.accommodation-card:hover .card-img {
    transform: scale(1.04);
}

/* === NAVIGATION === */
.brand-link { text-decoration: none !important; }

.nav-btn {
    font-weight: 500 !important;
    letter-spacing: 0.3px !important;
    text-transform: none !important;
    font-size: 14px !important;
}


/* === FOOTER === */
.site-footer {
    background: linear-gradient(135deg, #0B1F2E 0%, #0A3D5C 100%);
    padding: 64px 0 32px;
}

/* === ADMIN LOGIN === */
.admin-login-wrapper {
    min-height: 100vh;
    background: linear-gradient(135deg, #1A78A4 0%, #0B1F2E 100%);
    display: flex;
    align-items: center;
    justify-content: center;
}

/* === UTILITIES === */
.text-center { text-align: center; }
.h-100 { height: 100%; }

/* === MUDBLAZOR OVERRIDES === */
.mud-button-root {
    text-transform: none !important;
    letter-spacing: 0.3px !important;
}

.mud-nav-link {
    border-radius: 8px !important;
    margin: 2px 8px !important;
    font-weight: 500;
}

.mud-table-head .mud-table-cell {
    background: #F5F2ED !important;
    font-size: 13px;
}

.mud-table-row:hover {
    background: rgba(13,110,110,0.04) !important;
}

/* === SCROLLBAR === */
::-webkit-scrollbar { width: 6px; }
::-webkit-scrollbar-track { background: #f1f1f1; }
::-webkit-scrollbar-thumb { background: #1A78A4; border-radius: 3px; }

/* === BLAZOR ERROR UI === */
#blazor-error-ui {
    background: #ffe4e4;
    border-top: 1px solid #ffb3b3;
    bottom: 0;
    display: none;
    left: 0;
    padding: 12px 20px;
    position: fixed;
    width: 100%;
    z-index: 1000;
    font-size: 14px;
}

/* === MudDateRangePicker — alignement vertical (inline) === */
.mud-picker .mud-input-slot {
    margin-bottom: 0 !important;
}
.mud-picker .mud-input.mb-3,
.mud-picker .mud-input-control.mb-3 {
    margin-bottom: 0 !important;
}
.mud-range-input-separator {
    align-self: center;
}

/* === Calendrier statique dans la carte hébergement === */

/* Bloquer tout popup/popover issu du calendrier (évite l'ouverture au resize) */
.booking-calendar ~ * .mud-popover,
.booking-calendar .mud-picker-popover-open,
.booking-calendar .mud-popover-cascading-value {
    display: none !important;
    pointer-events: none !important;
}

.booking-calendar .mud-picker-static {
    width: 100%;
    max-width: 100%;
    box-shadow: none;
    border-radius: 0;
    margin: 0 auto;
    overflow: hidden;
}

/* Centrer et contraindre le contenu */
.booking-calendar .mud-picker-content {
    width: 100%;
    max-width: 100%;
    overflow: hidden;
}

/* Empiler les deux mois verticalement */
.booking-calendar .mud-picker-calendar-content,
.booking-calendar .mud-picker-calendar-content-2 {
    display: flex !important;
    flex-direction: column !important;
    grid-template-columns: unset !important;
    width: 100% !important;
    max-width: 100% !important;
}
.booking-calendar .mud-picker-calendar-container {
    width: 100% !important;
    max-width: 100% !important;
}

/* Réduire la taille du résumé des dates en haut */
.booking-calendar .mud-toolbar {
    min-height: 48px !important;
    padding: 4px 12px !important;
}
.booking-calendar .mud-toolbar .mud-typography-h4 {
    font-size: 1rem !important;
    line-height: 1.3 !important;
}
.booking-calendar .mud-toolbar .mud-typography-subtitle1,
.booking-calendar .mud-toolbar .mud-typography-body1 {
    font-size: 0.75rem !important;
}
.booking-calendar .mud-button-date,
.booking-calendar .mud-button-date .mud-button-label {
    font-size: 1.25rem !important;
    font-weight: 500 !important;
    line-height: 1.2 !important;
}

/* MudBlazor 9 : jours désactivés = .mud-day.mud-disabled */
.booking-calendar .mud-day.mud-disabled {
    opacity: 0.35 !important;
    text-decoration: line-through;
    cursor: not-allowed !important;
}

#blazor-error-ui .dismiss {
    cursor: pointer;
    position: absolute;
    right: 16px;
    top: 50%;
    transform: translateY(-50%);
    font-size: 18px;
}

.blazor-error-boundary {
    background: #b32121;
    padding: 1rem 1rem 1rem 3.7rem;
    color: white;
    border-radius: 8px;
}

.blazor-error-boundary::after {
    content: "Une erreur est survenue.";
}
