/*********************************************/
/* Styles specifiques a la page Voyages      */
/* (fonts, couleurs et layout communs :      */
/* voir base.css)                            */
/*********************************************/

:root {
    --bordeaux: #7b1450;
    --pink: #f4a6c8;
    --pink-strong: #ef8fb9;
    --pink-soft: #f9dcea;
    --cream: #fff8f0;
    --line: rgba(123, 20, 80, 0.15);
    --panel-bg: rgba(255, 250, 250, 0.7);
    --stub-width: 130px;
    --status-done: #3f8f5e;
    --status-planned: var(--bordeaux);
    --status-wish: #d94f8a;
}

body {
    padding: calc(var(--navbar-height) + 20px) 32px 20px;
    font-family: var(--font-primary);
    color: var(--color-text);
}

main {
    max-width: 1000px;
    margin: 0 auto;
    padding: 10px 0 40px;
}

h2 {
    margin: 0;
    color: var(--bordeaux);
}

label {
    margin: 0;
    padding: 0;
    font-size: 14px;
}

[hidden] {
    display: none !important;
}


/**********/
/* HEADER */
/**********/

.trip-header {
    position: relative;
    max-width: 1000px;
    margin: 0 auto;
}

.trip-header h1 {
    margin-bottom: 0;
}

.trip-subtitle {
    margin: 24px 0;
    font-size: 14px;
    letter-spacing: 2px;
    text-transform: uppercase;
    color: var(--bordeaux);
    opacity: 0.7;
}

.trip-subtitle i {
    margin-right: 6px;
}

.sticker-plane {
    position: absolute;
    top: 4px;
    right: 0;
    width: 72px;
    height: 72px;
    animation: glide 5s ease-in-out infinite;
}

.sticker-plane polygon {
    stroke: var(--bordeaux);
    stroke-width: 4;
    stroke-linejoin: round;
}

.plane-wing {
    fill: var(--pink);
}

.plane-body {
    fill: var(--pink-soft);
}

.plane-fold {
    fill: var(--pink-strong);
}

@keyframes glide {
    0%, 100% { transform: translate(0, 0) rotate(-4deg); }
    50% { transform: translate(-6px, -8px) rotate(4deg); }
}

@media (prefers-reduced-motion: reduce) {
    .sticker-plane {
        animation: none;
    }
}


/***********/
/* SUMMARY */
/***********/

.summary-stats {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 8px;
    margin: 0 0 20px;
    padding: 0;
    list-style: none;
}

.summary-stats li {
    padding: 10px 18px;
    border-radius: 14px;
    background-color: var(--panel-bg);
    border: 1px solid var(--line);
    backdrop-filter: blur(8px);
    font-size: 14px;
}

.summary-stats strong {
    margin-right: 2px;
    color: var(--bordeaux);
    font-weight: 400;
    font-size: 20px;
}

.summary-stats i {
    margin-right: 6px;
    font-size: 12px;
}

.stat-done i { color: var(--status-done); }
.stat-planned i { color: var(--status-planned); }
.stat-wish i { color: var(--status-wish); }


/*********/
/* CARTE */
/*********/

.trip-map {
    margin: 0 0 24px;
    padding: 14px;
    border-radius: 20px;
    background-color: var(--panel-bg);
    border: 1px solid var(--line);
    backdrop-filter: blur(8px);
}

.map-frame svg {
    display: block;
    width: 100%;
    height: auto;
}

/* Styles d'origine du SVG retirés à l'injection : couleurs de la charte */
.trip-map .ocean {
    fill: rgba(255, 248, 240, 0.7);
    stroke: none;
}

.trip-map .land {
    fill: #f6d3e3;
    stroke: #fff;
    stroke-width: 0.5;
}

.trip-map .coast {
    stroke-width: 0.3;
}

.trip-map .lake {
    fill: #fff8f0;
    stroke: none;
}

.trip-map .circle,
.trip-map .aq {
    display: none;
}

.trip-map .land.is-visited {
    fill: #c4e2cf;
}

.map-trip {
    cursor: pointer;
    outline: none;
}

.map-trip.pin-done { color: var(--status-done); }
.map-trip.pin-planned { color: var(--status-planned); }
.map-trip.pin-wish { color: var(--status-wish); }

.map-pin {
    fill: currentColor;
    stroke: #fff;
    stroke-width: 1.5;
    vector-effect: non-scaling-stroke;
    transform-box: fill-box;
    transform-origin: center;
    transition: transform 0.15s ease;
}

.map-route {
    fill: none;
    stroke: currentColor;
    stroke-width: 1.5;
    stroke-dasharray: 4 3;
    vector-effect: non-scaling-stroke;
    opacity: 0.7;
}

.map-trip:hover .map-pin,
.map-trip:focus-visible .map-pin {
    transform: scale(1.7);
}

.map-trip:focus-visible .map-route {
    opacity: 1;
    stroke-width: 2.5;
}

.map-footer {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 6px 16px;
    margin-top: 8px;
}

.map-legend {
    display: flex;
    gap: 16px;
    margin: 0;
    padding: 0;
    list-style: none;
    font-size: 13px;
}

.map-legend .legend-dot {
    display: inline-block;
    width: 10px;
    height: 10px;
    margin-right: 6px;
    border-radius: 50%;
    background-color: currentColor;
}

.map-legend .pin-done { color: var(--status-done); }
.map-legend .pin-planned { color: var(--status-planned); }
.map-legend .pin-wish { color: var(--status-wish); }

.map-credits {
    font-size: 11px;
    opacity: 0.6;
}


/*****************/
/* ONGLETS       */
/*****************/

.trip-toolbar {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 20px;
}

.tab-group {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    padding: 4px;
    border-radius: 24px;
    background-color: var(--panel-bg);
    border: 1px solid var(--line);
    backdrop-filter: blur(8px);
}

.tab {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    font-family: var(--font-primary);
    font-size: 14px;
    color: var(--color-text);
    padding: 7px 16px;
    border-radius: 20px;
    border: none;
    background: transparent;
    cursor: pointer;
    transition: background-color 0.2s ease, color 0.2s ease;
}

.tab:hover {
    background-color: rgba(255, 255, 255, 0.7);
}

.tab[aria-pressed="true"] {
    color: #fff;
    background-color: var(--bordeaux);
}

.tab-count {
    min-width: 20px;
    padding: 0 6px;
    border-radius: 10px;
    background-color: rgba(123, 20, 80, 0.1);
    font-size: 12px;
    line-height: 20px;
    text-align: center;
}

.tab[aria-pressed="true"] .tab-count {
    background-color: rgba(255, 255, 255, 0.25);
}


/***********/
/* BOUTONS */
/***********/

.btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    font-family: var(--font-primary);
    font-size: 14px;
    color: var(--bordeaux);
    padding: 7px 16px;
    border-radius: 20px;
    border: 1px solid rgba(123, 20, 80, 0.3);
    background-color: rgba(255, 255, 255, 0.7);
    text-decoration: none;
    cursor: pointer;
    transition: background-color 0.2s ease, color 0.2s ease;
}

.btn:hover {
    background-color: var(--pink-soft);
}

.btn-primary {
    color: #fff;
    background-color: var(--bordeaux);
    border-color: var(--bordeaux);
}

.btn-primary:hover {
    background-color: #5e0f3d;
}

.btn-danger {
    color: #b71c1c;
    border-color: rgba(183, 28, 28, 0.4);
}

.btn-danger:hover {
    background-color: rgba(183, 28, 28, 0.08);
}

.btn-small {
    padding: 4px 10px;
    font-size: 12px;
}


/**********************/
/* BILLETS D'EMBARQUEMENT */
/**********************/

.ticket-list {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

/* Encoches de part et d'autre de la ligne de découpe du talon */
.ticket {
    display: grid;
    grid-template-columns: minmax(0, 1fr) var(--stub-width);
    overflow: hidden;
    border-radius: 16px;
    background-color: rgba(255, 255, 255, 0.85);
    -webkit-mask:
        radial-gradient(circle 11px at calc(100% - var(--stub-width)) 0, transparent 98%, #000) top / 100% 51% no-repeat,
        radial-gradient(circle 11px at calc(100% - var(--stub-width)) 100%, transparent 98%, #000) bottom / 100% 51% no-repeat;
    mask:
        radial-gradient(circle 11px at calc(100% - var(--stub-width)) 0, transparent 98%, #000) top / 100% 51% no-repeat,
        radial-gradient(circle 11px at calc(100% - var(--stub-width)) 100%, transparent 98%, #000) bottom / 100% 51% no-repeat;
}

.ticket-main {
    display: flex;
    flex-direction: column;
    gap: 8px;
    padding: 16px 22px;
    min-width: 0;
}

.ticket-top {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 8px;
    font-size: 11px;
    letter-spacing: 1.5px;
    text-transform: uppercase;
    color: var(--bordeaux);
}

.ticket-kind {
    opacity: 0.7;
}

.ticket-kind i {
    margin-right: 4px;
}

.ticket-status {
    margin-left: auto;
    padding: 2px 10px;
    border-radius: 999px;
    background-color: rgba(123, 20, 80, 0.08);
}

.ticket-planned .ticket-status {
    color: #fff;
    background-color: var(--bordeaux);
}

.ticket-done .ticket-status {
    color: #2f6f48;
    background-color: rgba(95, 174, 126, 0.18);
}

.ticket-favorite {
    color: #d94f8a;
}

.ticket-unmapped {
    opacity: 0.45;
}

.ticket.is-highlighted {
    animation: ticket-flash 1.4s ease;
}

@keyframes ticket-flash {
    0%, 100% { background-color: rgba(255, 255, 255, 0.85); }
    30% { background-color: var(--pink-soft); }
}

.ticket-destination {
    margin: 0;
    font-weight: 400;
    font-size: 26px;
    line-height: 1.1;
    color: var(--color-text);
    overflow-wrap: anywhere;
}

.ticket-country {
    margin-left: 8px;
    font-size: 15px;
    opacity: 0.6;
}

.ticket-stops {
    margin: 0;
    font-size: 14px;
    text-align: left;
    opacity: 0.85;
    overflow-wrap: anywhere;
}

.ticket-stops .stop-arrow {
    margin: 0 6px;
    color: var(--pink-strong);
}

.ticket-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 6px 24px;
    margin: 4px 0 0;
}

.ticket-meta div {
    display: flex;
    flex-direction: column;
}

.ticket-meta dt {
    font-size: 10px;
    letter-spacing: 1.5px;
    text-transform: uppercase;
    opacity: 0.55;
}

.ticket-meta dd {
    margin: 0;
    font-size: 15px;
}

.ticket-note {
    margin: 0;
    padding-left: 8px;
    border-left: 2px solid var(--pink);
    font-size: 13px;
    font-style: italic;
    text-align: left;
    opacity: 0.85;
    white-space: pre-line;
}

.ticket-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    margin-top: 4px;
}

.ticket-stub {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 6px;
    padding: 16px 10px;
    border-left: 2px dashed rgba(123, 20, 80, 0.25);
    background-color: rgba(249, 220, 234, 0.55);
    color: var(--bordeaux);
    text-align: center;
}

.ticket-planned .ticket-stub {
    background-color: var(--bordeaux);
    color: #fff;
    border-left-color: rgba(255, 255, 255, 0.5);
}

.ticket-done .ticket-stub {
    background-color: rgba(95, 174, 126, 0.15);
    color: #2f6f48;
}

.stub-code {
    font-size: 34px;
    letter-spacing: 3px;
    line-height: 1;
}

.stub-when {
    font-size: 11px;
    letter-spacing: 1px;
    text-transform: uppercase;
    opacity: 0.85;
    overflow-wrap: anywhere;
}


/*************/
/* CHECKLIST */
/*************/

.checklist {
    margin-top: 2px;
}

.checklist-toggle {
    display: flex;
    align-items: center;
    gap: 10px;
    width: 100%;
    padding: 6px 0;
    border: none;
    background: none;
    font-family: var(--font-primary);
    font-size: 14px;
    color: var(--bordeaux);
    cursor: pointer;
    text-align: left;
}

.checklist-toggle i {
    font-size: 11px;
    transition: transform 0.2s ease;
}

.checklist-toggle[aria-expanded="true"] i {
    transform: rotate(90deg);
}

.checklist-count {
    font-size: 12px;
    opacity: 0.7;
}

.checklist-bar {
    flex: 0 1 140px;
    height: 6px;
    border-radius: 3px;
    background-color: rgba(123, 20, 80, 0.1);
    overflow: hidden;
}

.checklist-bar span {
    display: block;
    height: 100%;
    border-radius: 3px;
    background-color: var(--pink-strong);
}

.checklist-items {
    list-style: none;
    margin: 4px 0 8px;
    padding: 0;
}

.checklist-items li {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 4px 0;
    border-bottom: 1px dashed var(--line);
}

.checklist-items label {
    display: flex;
    flex: 1;
    align-items: center;
    gap: 10px;
    font-size: 14px;
    cursor: pointer;
}

.checklist-items input {
    width: 16px;
    height: 16px;
    accent-color: var(--bordeaux);
    flex-shrink: 0;
}

.checklist-items li.is-done span {
    text-decoration: line-through;
    opacity: 0.55;
}

.item-delete {
    width: 26px;
    height: 26px;
    border-radius: 50%;
    border: none;
    background: transparent;
    color: var(--color-text);
    opacity: 0.4;
    cursor: pointer;
}

.item-delete:hover {
    opacity: 1;
    color: #b71c1c;
}

.checklist-add {
    display: flex;
    gap: 6px;
}

.checklist-add input {
    flex: 1;
    min-width: 0;
    padding: 6px 10px;
    border-radius: 10px;
    border: 1px solid var(--line);
    background-color: #fff;
    font-family: var(--font-primary);
    font-size: 14px;
    color: var(--color-text);
}

.checklist-add input:focus {
    outline: 2px solid var(--pink-strong);
    border-color: var(--bordeaux);
}


/*************/
/* PASSEPORT */
/*************/

.passport {
    padding: 28px 24px;
    border-radius: 20px;
    border: 1px solid var(--line);
    background-color: rgba(255, 250, 245, 0.85);
    background-image: repeating-linear-gradient(0deg, transparent 0 31px, rgba(123, 20, 80, 0.05) 31px 32px);
    backdrop-filter: blur(8px);
}

.passport-title {
    margin: 0 0 20px;
    font-size: 12px;
    letter-spacing: 4px;
    text-transform: uppercase;
    text-align: center;
    color: var(--bordeaux);
    opacity: 0.6;
}

.stamp-grid {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 22px 26px;
}

.stamp {
    --stamp-color: var(--bordeaux);
    position: relative;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 2px;
    width: 150px;
    height: 150px;
    padding: 14px;
    box-sizing: border-box;
    border: 3px double var(--stamp-color);
    border-radius: 50%;
    background: transparent;
    color: var(--stamp-color);
    font-family: var(--font-primary);
    text-transform: uppercase;
    opacity: 0.8;
    transform: rotate(var(--stamp-rotate, 0deg));
    cursor: pointer;
    transition: transform 0.2s ease, opacity 0.2s ease;
}

.stamp::after {
    content: '';
    position: absolute;
    inset: 7px;
    border: 1px dashed var(--stamp-color);
    border-radius: inherit;
    opacity: 0.6;
    pointer-events: none;
}

.stamp:hover,
.stamp:focus-visible,
.stamp[aria-pressed="true"] {
    opacity: 1;
    transform: rotate(0deg) scale(1.05);
}

.stamp[aria-pressed="true"] {
    background-color: rgba(255, 255, 255, 0.6);
}

.stamp-rect {
    width: 170px;
    height: 120px;
    border-radius: 10px;
}

.stamp-oval {
    width: 180px;
    height: 124px;
    border-radius: 50%;
}

.stamp-kind {
    font-size: 9px;
    letter-spacing: 2px;
    opacity: 0.8;
}

.stamp-destination {
    max-width: 100%;
    font-size: 17px;
    letter-spacing: 1px;
    line-height: 1.1;
    overflow-wrap: anywhere;
}

.stamp-country {
    font-size: 10px;
    letter-spacing: 1px;
    opacity: 0.8;
}

.stamp-date {
    margin-top: 2px;
    padding: 1px 8px;
    border-top: 1px solid currentColor;
    border-bottom: 1px solid currentColor;
    font-size: 11px;
    letter-spacing: 1.5px;
}

.stamp-heart {
    position: absolute;
    top: 6px;
    right: 14px;
    font-size: 14px;
    color: #d94f8a;
}

.stamp-detail {
    margin-top: 20px;
}

.trip-empty {
    margin: 0 auto;
    max-width: 520px;
    padding: 18px;
    border-radius: 14px;
    background-color: var(--panel-bg);
    border: 1px solid var(--line);
    font-size: 16px;
    opacity: 1;
}


/**********/
/* DRAWER */
/**********/

.drawer-overlay {
    position: fixed;
    inset: 0;
    z-index: 1100;
    background-color: rgba(65, 52, 56, 0.35);
}

.drawer {
    position: fixed;
    top: 0;
    right: 0;
    z-index: 1101;
    width: min(480px, 100%);
    height: 100%;
    box-sizing: border-box;
    padding: 20px 24px 32px;
    overflow-y: auto;
    background-color: var(--cream);
    border-left: 1px solid var(--line);
    box-shadow: -12px 0 30px rgba(123, 20, 80, 0.12);
    transform: translateX(100%);
    visibility: hidden;
    transition: transform 0.25s ease, visibility 0.25s;
}

.drawer.is-open {
    transform: none;
    visibility: visible;
}

.drawer-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 18px;
}

.drawer-header h2 {
    text-align: left;
    font-size: 22px;
}

.drawer-close {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    border: 1px solid rgba(123, 20, 80, 0.3);
    background: transparent;
    color: var(--bordeaux);
    font-size: 18px;
    cursor: pointer;
}

.drawer-form {
    display: flex;
    flex-direction: column;
    gap: 14px;
}

.field {
    display: flex;
    flex-direction: column;
    flex: 1;
    min-width: 0;
}

.field label {
    margin-bottom: 6px;
}

.field-row {
    display: flex;
    gap: 12px;
}

.field-code {
    flex: 0 0 90px;
}

.field-code input {
    text-transform: uppercase;
    letter-spacing: 2px;
}

.field-hint {
    display: block;
    font-size: 12px;
    opacity: 0.6;
}

.field input,
.field select,
.field textarea {
    font-family: var(--font-primary);
    font-size: 15px;
    color: var(--color-text);
    padding: 8px 10px;
    border-radius: 10px;
    border: 1px solid rgba(123, 20, 80, 0.3);
    background-color: #fff;
    box-sizing: border-box;
    width: 100%;
}

.field textarea {
    resize: vertical;
}

.field input:focus,
.field select:focus,
.field textarea:focus {
    outline: 2px solid var(--pink-strong);
    border-color: var(--bordeaux);
}

.toggle {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    font-size: 14px;
    cursor: pointer;
}

.toggle input {
    width: 16px;
    height: 16px;
    accent-color: var(--bordeaux);
}

.drawer-actions {
    display: flex;
    justify-content: space-between;
    gap: 10px;
}


/*********/
/* TOAST */
/*********/

.toast-container {
    position: fixed;
    right: 20px;
    bottom: 20px;
    z-index: 1200;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.toast {
    padding: 10px 16px;
    border-radius: 12px;
    font-size: 14px;
    color: #fff;
    background-color: var(--bordeaux);
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.15);
    animation: toast-in 0.2s ease;
}

.toast-error {
    background-color: #b71c1c;
}

@keyframes toast-in {
    from { opacity: 0; transform: translateY(8px); }
}


/**********/
/* FOOTER */
/**********/

footer p {
    margin: 0;
}


/****************/
/* RESPONSIVE   */
/****************/

@media (max-width: 900px) {
    .trip-header h1 {
        font-size: 42px;
    }
}

@media (max-width: 700px) {
    body {
        padding: calc(var(--navbar-height) + 12px) 14px 16px;
    }

    .trip-header h1 {
        font-size: 32px;
    }

    .sticker-plane {
        display: none;
    }

    .trip-toolbar {
        justify-content: center;
    }

    /* Talon au-dessus du billet : plus d'encoches */
    .ticket {
        grid-template-columns: 1fr;
        -webkit-mask: none;
        mask: none;
    }

    .ticket-stub {
        order: -1;
        flex-direction: row;
        justify-content: space-between;
        padding: 10px 18px;
        border-left: none;
        border-bottom: 2px dashed rgba(123, 20, 80, 0.25);
        border-radius: 16px 16px 0 0;
    }

    .stub-code {
        font-size: 24px;
    }

    .stamp {
        width: 130px;
        height: 130px;
    }

    .stamp-rect,
    .stamp-oval {
        width: 150px;
        height: 110px;
    }

    .field-row {
        flex-direction: column;
    }
}
