/* ================================================================
   Vacances 2026 — Frise chronologique
   Thème : bleu/teal (distinct du bordeaux cave-vin)
   ================================================================ */

:root {
    --color-depart:   #6b7280;
    --color-trajet:   #3b82f6;
    --color-visite:   #16a34a;
    --color-nuit:     #7c3aed;
    --color-repas:    #f97316;
    --color-recharge: #f59e0b;

    --color-primary:  #0d6efd;
    --color-bg:       #f0f7ff;
    --color-card:     #ffffff;
    --timeline-h:     72px;
    --timeline-bg:    #e9ecef;
    --grad-top:       linear-gradient(180deg, #0d6efd 0%, #0891b2 100%);
}

/* ── Layout ──────────────────────────────────────────────────── */
body {
    background: var(--color-bg);
    font-family: system-ui, -apple-system, sans-serif;
}

.navbar-brand {
    font-weight: 700;
    font-size: 1.25rem;
}

/* ── Summary bar ─────────────────────────────────────────────── */
.summary-bar {
    background: var(--grad-top);
    color: #fff;
    padding: 0.6rem 1rem;
    border-radius: 0.5rem;
    display: flex;
    flex-wrap: wrap;
    gap: 1.5rem;
    align-items: center;
    font-size: 0.9rem;
}
.summary-bar .stat {
    display: flex;
    align-items: center;
    gap: 0.4rem;
}
.summary-bar .stat strong { font-size: 1.1rem; }

/* ── Day card ────────────────────────────────────────────────── */
.day-card {
    background: var(--color-card);
    border-radius: 0.75rem;
    box-shadow: 0 1px 4px rgba(0,0,0,0.08);
    margin-bottom: 1.25rem;
    overflow: hidden;
}

.day-header {
    background: linear-gradient(90deg, #1e40af 0%, #0891b2 100%);
    color: #fff;
    padding: 0.6rem 1rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 0.5rem;
}
.day-header h2 {
    font-size: 1rem;
    font-weight: 700;
    margin: 0;
}
.day-meta {
    display: flex;
    gap: 1rem;
    font-size: 0.82rem;
    opacity: 0.9;
}
.day-meta .badge-day {
    background: rgba(255,255,255,0.2);
    border-radius: 1rem;
    padding: 0.15rem 0.55rem;
}

/* ── Timeline container ──────────────────────────────────────── */
.timeline-wrapper {
    padding: 0.5rem 0.75rem 0.75rem;
    overflow-x: auto;
}

.timeline-scale {
    position: relative;
    height: 20px;
    margin-bottom: 4px;
    min-width: 700px;
}
.timeline-scale .hour-label {
    position: absolute;
    font-size: 0.68rem;
    color: #6b7280;
    transform: translateX(-50%);
    user-select: none;
}
.timeline-scale .hour-tick {
    position: absolute;
    top: 14px;
    width: 1px;
    height: 6px;
    background: #cbd5e1;
    transform: translateX(-50%);
}

.timeline {
    position: relative;
    height: var(--timeline-h);
    background: var(--timeline-bg);
    border-radius: 6px;
    overflow: visible;
    min-width: 700px;
    cursor: default;
}

/* ── Activity block ──────────────────────────────────────────── */
.act-block {
    position: absolute;
    top: 6px;
    height: calc(var(--timeline-h) - 12px);
    border-radius: 5px;
    cursor: pointer;
    user-select: none;
    display: flex;
    align-items: center;
    overflow: hidden;
    padding: 0 6px;
    transition: filter 0.1s;
    box-sizing: border-box;
    min-width: 20px;
    box-shadow: 0 1px 3px rgba(0,0,0,0.2);
}
.act-block:hover { filter: brightness(1.12); }
.act-block.dragging { opacity: 0.85; z-index: 100; box-shadow: 0 4px 16px rgba(0,0,0,0.3); }
.act-block.resizing { opacity: 0.85; z-index: 100; }
.act-block.conflict { outline: 2px solid #ef4444; }

/* Couleurs par type */
.act-block[data-type="depart"]   { background: var(--color-depart); }
.act-block[data-type="trajet"]   { background: var(--color-trajet); }
.act-block[data-type="visite"]   { background: var(--color-visite); }
.act-block[data-type="nuit"]     { background: var(--color-nuit); }
.act-block[data-type="repas"]    { background: var(--color-repas); }
.act-block[data-type="recharge"] { background: var(--color-recharge); }

/* Texte dans le bloc */
.act-block .act-label {
    color: #fff;
    font-size: 0.7rem;
    font-weight: 600;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    pointer-events: none;
    flex: 1;
    min-width: 0;
}
.act-block .act-icon {
    font-size: 0.85rem;
    margin-right: 3px;
    flex-shrink: 0;
    pointer-events: none;
}

/* Poignée droite (modifier durée) */
.act-resize {
    position: absolute;
    right: 0;
    top: 0;
    width: 10px;
    height: 100%;
    cursor: ew-resize;
    opacity: 0;
    background: rgba(255,255,255,0.3);
    border-radius: 0 5px 5px 0;
    transition: opacity 0.15s;
    flex-shrink: 0;
}
.act-block:hover .act-resize { opacity: 1; }

/* Poignée gauche (modifier heure début) */
.act-resize-left {
    position: absolute;
    left: 0;
    top: 0;
    width: 10px;
    height: 100%;
    cursor: ew-resize;
    opacity: 0;
    background: rgba(255,255,255,0.3);
    border-radius: 5px 0 0 5px;
    transition: opacity 0.15s;
    flex-shrink: 0;
}
.act-block:hover .act-resize-left { opacity: 1; }

/* Overflow arrow (nuit qui dépasse) */
.act-overflow {
    position: absolute;
    right: 4px;
    top: 50%;
    transform: translateY(-50%);
    color: rgba(255,255,255,0.8);
    font-size: 0.8rem;
    pointer-events: none;
}

/* ── Reservation badge ───────────────────────────────────────── */
.act-badge {
    position: absolute;
    top: 2px;
    right: 2px;
    width: 8px;
    height: 8px;
    border-radius: 50%;
    pointer-events: none;
    z-index: 2;
}
.act-badge.res-a_faire     { background: #f97316; }
.act-badge.res-a_faire_q   { background: #eab308; }
.act-badge.res-fait_a_payer{ background: #3b82f6; }
.act-badge.res-fait_paye   { background: #22c55e; }
.act-badge.res-fait_debite { background: #22c55e; }

/* ── Battery graph ───────────────────────────────────────────── */
.battery-track {
    min-width: 700px;
    margin-top: 4px;
    padding: 2px 0 4px;
    position: relative;
    background: #f8fafc;
    border-radius: 0 0 6px 6px;
    border-top: 1px solid #e9ecef;
}
.battery-track svg { overflow: visible; }

/* ── Activity list (under timeline) ─────────────────────────── */
.act-list {
    margin-top: 0.5rem;
    min-width: 700px;
    display: flex;
    flex-wrap: wrap;
    gap: 0.25rem;
}
.act-pill {
    font-size: 0.72rem;
    padding: 0.15rem 0.5rem;
    border-radius: 1rem;
    color: #fff;
    cursor: pointer;
    white-space: nowrap;
}
.act-pill:hover { filter: brightness(1.15); }
.act-pill[data-type="depart"]   { background: var(--color-depart); }
.act-pill[data-type="trajet"]   { background: var(--color-trajet); }
.act-pill[data-type="visite"]   { background: var(--color-visite); }
.act-pill[data-type="nuit"]     { background: var(--color-nuit); }
.act-pill[data-type="repas"]    { background: var(--color-repas); }
.act-pill[data-type="recharge"] { background: var(--color-recharge); }

/* ── Legend ──────────────────────────────────────────────────── */
.legend {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem 1rem;
    font-size: 0.78rem;
    color: #374151;
}
.legend-item {
    display: flex;
    align-items: center;
    gap: 0.3rem;
}
.legend-dot {
    width: 12px;
    height: 12px;
    border-radius: 3px;
    flex-shrink: 0;
}

/* ── Modal tweaks ────────────────────────────────────────────── */
.modal-header.modal-type-depart   { background: var(--color-depart);   color:#fff; }
.modal-header.modal-type-trajet   { background: var(--color-trajet);   color:#fff; }
.modal-header.modal-type-visite   { background: var(--color-visite);   color:#fff; }
.modal-header.modal-type-nuit     { background: var(--color-nuit);     color:#fff; }
.modal-header.modal-type-repas    { background: var(--color-repas);    color:#fff; }
.modal-header.modal-type-recharge { background: var(--color-recharge); color:#fff; }
.modal-header .btn-close { filter: invert(1); }

/* ── Responsive ──────────────────────────────────────────────── */
@media (max-width: 576px) {
    .day-meta { gap: 0.5rem; font-size: 0.75rem; }
    .summary-bar { gap: 0.75rem; }
}
