/* ── Reset / Base ─────────────────────────────── */
body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    background: #f0f2f5;
    color: #1a1a2e;
    padding: 0 16px 100px; /* bottom padding clears the FAB */
    max-width: 480px;
    margin: 0 auto;
}

/* ── Header ───────────────────────────────────── */
header {
    text-align: center;
    padding: 32px 0 36px;
}

header h1 {
    font-size: 1.6rem;
    font-weight: 800;
    letter-spacing: -0.5px;
    color: #1a1a2e;
}

header h1 span {
    color: #4f7cff;
}

.trip-meta {
    margin-top: 6px;
    font-size: 0.85rem;
    color: #888;
    font-weight: 500;
}

/* ── Timeline wrapper ─────────────────────────── */
.timeline {
    position: relative;
    padding-left: 32px;
}

.timeline::before {
    content: '';
    position: absolute;
    left: 11px;
    top: 0;
    bottom: 0;
    width: 2px;
    background: linear-gradient(to bottom, #e0e4f0, #c8cde0);
}

/* ── Day group ────────────────────────────────── */
.day-group {
    position: relative;
    margin-bottom: 28px;
}

.day-dot {
    position: absolute;
    left: -26px;
    top: 3px;
    width: 14px;
    height: 14px;
    border-radius: 50%;
    background: #4f7cff;
    border: 2px solid #f0f2f5;
    z-index: 1;
}

.day-label {
    font-size: 0.72rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.8px;
    color: #4f7cff;
    margin-bottom: 10px;
}

/* ── Events list ──────────────────────────────── */
.events {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

/* ── Event card ───────────────────────────────── */
.event-card {
    background: #fff;
    border-radius: 14px;
    padding: 13px 15px;
    display: flex;
    align-items: center;
    gap: 13px;
    box-shadow: 0 1px 3px rgba(0,0,0,0.06), 0 2px 8px rgba(0,0,0,0.04);
}

.event-icon {
    width: 42px;
    height: 42px;
    border-radius: 11px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1rem;
    flex-shrink: 0;
}

.icon-flight     { background: #eef1ff; color: #4f7cff; }
.icon-hotel      { background: #fff0ec; color: #e8603c; }
.icon-car-rental { background: #edfaf1; color: #2e9e5b; }

.event-details {
    flex: 1;
    min-width: 0;
}

.event-name {
    font-size: 0.9rem;
    font-weight: 600;
    color: #1a1a2e;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.event-meta {
    display: flex;
    align-items: center;
    gap: 6px;
    margin-top: 3px;
}

.event-time {
    font-size: 0.75rem;
    color: #999;
}

.event-badge {
    font-size: 0.68rem;
    font-weight: 600;
    padding: 2px 7px;
    border-radius: 20px;
    white-space: nowrap;
}

.badge-flight     { background: #eef1ff; color: #4f7cff; }
.badge-hotel      { background: #fff0ec; color: #e8603c; }
.badge-car-rental { background: #edfaf1; color: #2e9e5b; }

.event-duration {
    font-size: 0.72rem;
    color: #bbb;
    font-weight: 500;
    white-space: nowrap;
    flex-shrink: 0;
}

/* ── Floating Action Button ───────────────────── */
.fab {
    position: fixed;
    bottom: 24px;
    right: 24px;
    width: 56px;
    height: 56px;
    border-radius: 50%;
    background: #4f7cff;
    color: #fff;
    border: none;
    font-size: 1.4rem;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 4px 16px rgba(79,124,255,0.45);
    cursor: pointer;
    transition: transform 0.15s ease, box-shadow 0.15s ease, background 0.15s ease;
    z-index: 1040;
}

.fab:hover,
.fab:focus-visible {
    background: #3a66e8;
    transform: scale(1.08);
    box-shadow: 0 6px 20px rgba(79,124,255,0.55);
    outline: none;
}

.fab:active {
    transform: scale(0.96);
}

/* ── Off-canvas overrides ─────────────────────── */
#offcanvas-add-item {
    border-radius: 20px 0 0 20px;
    width: 360px;
    max-width: 100vw;
}

#offcanvas-add-item .offcanvas-header {
    padding: 20px 20px 16px;
}

#offcanvas-add-item .offcanvas-body {
    padding: 20px;
    overflow-y: auto;
}

/* Submit button */
.btn-add {
    background: #4f7cff;
    border-color: #4f7cff;
    font-weight: 600;
    padding: 12px;
    border-radius: 12px;
}

.btn-add:hover,
.btn-add:focus {
    background: #3a66e8;
    border-color: #3a66e8;
}

/* ── Google PlaceAutocompleteElement ─────────── */
.place-input-wrap {
    display: flex;
    align-items: center;
    gap: 10px;
    border: 1px solid #dee2e6;
    border-radius: 0.375rem;
    background: #fff;
    padding: 0 0.75rem;
    transition: border-color 0.15s ease-in-out, box-shadow 0.15s ease-in-out;
}

.place-input-wrap:focus-within {
    border-color: #86b7fe;
    box-shadow: 0 0 0 0.25rem rgba(13, 110, 253, 0.25);
}

#place-autocomplete-container {
    flex: 1;
    min-width: 0;
}

gmp-place-autocomplete {
    width: 100%;
    --gmp-input-border: none;
    --gmp-input-border-radius: 0;
    --gmp-input-padding: 0.375rem 0;
    --gmp-input-outline: none;
    --gmp-input-font-size: 0.9rem;
}
