/**
 * wezunu · Trip Wizard (Task 2.4)
 * Developed by Toni Sciacca - mail@tonisciacca.com
 */

/* ── Overlay ─────────────────────────────────────────────────────────────── */
.tw-overlay {
    position: fixed; inset: 0; z-index: 9990;
    background: rgba(15,18,22,.5);
    backdrop-filter: blur(8px); -webkit-backdrop-filter: blur(8px);
    display: none; align-items: center; justify-content: center;
    padding: 20px;
}
.tw-overlay.open { display: flex; }

.tw-shell {
    position: relative;
    width: 100%; max-width: 560px;
    background: #fff;
    border-radius: 22px;
    box-shadow: 0 28px 72px rgba(0,0,0,.3);
    overflow: hidden;
    font-family: 'Outfit', sans-serif;
    display: flex; flex-direction: column;
    max-height: 88vh;
    animation: twPop .2s cubic-bezier(.34,1.56,.64,1);
}
@keyframes twPop { from { transform: scale(.96) translateY(10px); opacity: 0; } to { transform: none; opacity: 1; } }

.tw-close {
    position: absolute; top: 16px; right: 16px;
    width: 32px; height: 32px; border-radius: 50%;
    border: none; background: rgba(0,0,0,.06); cursor: pointer;
    display: flex; align-items: center; justify-content: center;
    color: #6b6b6b; transition: background .15s;
    z-index: 2;
}
.tw-close:hover { background: rgba(0,0,0,.12); }
.tw-close [data-lucide] { width: 16px; height: 16px; }

/* ── Progress ──────────────────────────────────────────────────────────────── */
.tw-progress {
    display: flex; align-items: center;
    padding: 20px 24px 0;
    gap: 0;
}
.tw-step { display: flex; flex-direction: column; align-items: center; gap: 4px; }
.tw-step-dot {
    width: 28px; height: 28px; border-radius: 50%;
    background: #f0f0f0; color: #9a9a9a;
    display: flex; align-items: center; justify-content: center;
    font-size: 12px; font-weight: 700; transition: all .2s;
}
.tw-step-dot [data-lucide] { width: 13px; height: 13px; }
.tw-step.active .tw-step-dot { background: #FF385C; color: #fff; }
.tw-step.done .tw-step-dot   { background: #10b981; color: #fff; }
.tw-step-label { font-size: 10px; color: #9a9a9a; font-weight: 500; white-space: nowrap; }
.tw-step.active .tw-step-label { color: #FF385C; font-weight: 700; }
.tw-step.done .tw-step-label   { color: #10b981; }
.tw-step-line {
    flex: 1; height: 2px; background: #e8e8e8;
    margin: 0 4px; margin-bottom: 18px;
    transition: background .2s;
}
.tw-step-line.done { background: #10b981; }

/* ── Body ─────────────────────────────────────────────────────────────────── */
.tw-body { flex: 1; overflow-y: auto; padding: 20px 24px 0; }

.tw-step-content { padding-bottom: 8px; }

.tw-step-icon {
    width: 52px; height: 52px; border-radius: 16px;
    background: rgba(255,56,92,.08);
    display: flex; align-items: center; justify-content: center;
    margin-bottom: 16px;
}
.tw-step-icon [data-lucide] { width: 26px; height: 26px; color: #FF385C; }

.tw-step-title { font-size: 22px; font-weight: 800; color: #1a1a1a; margin-bottom: 6px; }
.tw-step-sub   { font-size: 14px; color: #6b6b6b; margin-bottom: 20px; }

/* ── Step 1: Search ─────────────────────────────────────────────────────── */
.tw-search-wrap {
    position: relative; display: flex; align-items: center;
    border: 2px solid #e8e8e8; border-radius: 14px;
    background: #fafafa; transition: border-color .15s;
}
.tw-search-wrap:focus-within { border-color: #FF385C; background: #fff; }
.tw-search-icon { width: 18px; height: 18px; color: #9a9a9a; margin-left: 14px; flex-shrink: 0; }
.tw-search-input {
    flex: 1; border: none; outline: none; background: transparent;
    font: inherit; font-size: 16px; padding: 14px 14px;
    color: #1a1a1a;
}
.tw-search-input::placeholder { color: #9a9a9a; }

.tw-search-results { margin-top: 6px; border-radius: 12px; overflow: hidden; }
.tw-search-loading { padding: 12px 16px; color: #9a9a9a; font-size: 13px; display: flex; align-items: center; gap: 8px; }
.tw-search-loading [data-lucide] { width: 14px; height: 14px; animation: twSpin 1s linear infinite; }
@keyframes twSpin { to { transform: rotate(360deg); } }
.tw-search-item {
    display: flex; align-items: center; gap: 10px;
    padding: 11px 16px; cursor: pointer;
    border: 1px solid #e8e8e8; border-top: none;
    background: #fff; transition: background .1s;
}
.tw-search-item:first-child { border-top: 1px solid #e8e8e8; border-radius: 12px 12px 0 0; }
.tw-search-item:last-child  { border-radius: 0 0 12px 12px; }
.tw-search-item:only-child  { border-radius: 12px; }
.tw-search-item:hover { background: #fafafa; }
.tw-search-item [data-lucide] { width: 14px; height: 14px; color: #FF385C; flex-shrink: 0; }
.tw-si-name    { font-size: 14px; font-weight: 600; color: #1a1a1a; }
.tw-si-country { font-size: 12px; color: #9a9a9a; margin-left: 4px; }
.tw-no-results { padding: 12px 16px; color: #9a9a9a; font-size: 13px; }
.tw-selected-tag {
    display: inline-flex; align-items: center; gap: 6px;
    margin-top: 12px; padding: 6px 14px; border-radius: 999px;
    background: rgba(255,56,92,.1); color: #FF385C;
    font-size: 13px; font-weight: 600;
}
.tw-selected-tag [data-lucide] { width: 13px; height: 13px; }

/* ── Step 2: Reiseart ──────────────────────────────────────────────────── */
.tw-label { font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: .5px; color: #9a9a9a; margin-bottom: 10px; }

.tw-type-grid { display: flex; flex-wrap: wrap; gap: 8px; }
.tw-type-pill {
    display: inline-flex; align-items: center; gap: 6px;
    padding: 8px 14px; border-radius: 999px;
    border: 2px solid #e8e8e8; background: #fff;
    font: inherit; font-size: 13px; font-weight: 500; color: #1a1a1a;
    cursor: pointer; transition: all .15s;
}
.tw-type-pill [data-lucide] { width: 14px; height: 14px; }
.tw-type-pill:hover { border-color: #FF385C; color: #FF385C; }
.tw-type-pill.active { border-color: #FF385C; background: rgba(255,56,92,.08); color: #FF385C; font-weight: 700; }

.tw-mode-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; }
.tw-mode-card {
    display: flex; flex-direction: column; align-items: center; gap: 6px;
    padding: 14px 8px; border-radius: 14px;
    border: 2px solid #e8e8e8; background: #fff;
    font: inherit; font-size: 12px; font-weight: 500; color: #6b6b6b;
    cursor: pointer; transition: all .15s;
}
.tw-mode-card [data-lucide] { width: 20px; height: 20px; }
.tw-mode-card:hover { border-color: #FF385C; color: #FF385C; }
.tw-mode-card.active { border-color: #FF385C; background: rgba(255,56,92,.08); color: #FF385C; font-weight: 700; }

/* ── Step 3: Dauer ──────────────────────────────────────────────────────── */
.tw-duration-wrap { text-align: center; padding: 16px 0; }
.tw-duration-display { font-size: 42px; font-weight: 800; color: #1a1a1a; margin-bottom: 16px; }
.tw-duration-slider {
    width: 100%; accent-color: #FF385C; cursor: pointer;
    height: 6px; border-radius: 3px;
}
.tw-duration-labels { display: flex; justify-content: space-between; font-size: 11px; color: #9a9a9a; margin-top: 8px; }
.tw-date-input {
    width: 100%; padding: 13px 16px; border-radius: 12px;
    border: 2px solid #e8e8e8; font: inherit; font-size: 15px;
    color: #1a1a1a; background: #fafafa; outline: none;
    transition: border-color .15s;
}
.tw-date-input:focus { border-color: #FF385C; background: #fff; }

/* ── Step 4: Vibe ───────────────────────────────────────────────────────── */
.tw-vibe-row { margin-bottom: 20px; }
.tw-vibe-label {
    display: flex; align-items: center; justify-content: space-between;
    margin-bottom: 8px; font-size: 13px; font-weight: 600; color: #1a1a1a;
}
.tw-vibe-label [data-lucide] { width: 16px; height: 16px; color: #9a9a9a; }
.tw-vibe-label span { flex: 1; padding: 0 8px; }
.tw-vibe-slider { width: 100%; accent-color: #FF385C; cursor: pointer; }

/* ── Step 5: AI Suggestions ─────────────────────────────────────────────── */
.tw-ai-loading {
    display: flex; flex-direction: column; align-items: center;
    padding: 48px 24px; text-align: center;
}
.tw-ai-spinner { width: 44px; height: 44px; color: #FF385C; animation: twPulse 1.4s ease-in-out infinite; margin-bottom: 16px; }
@keyframes twPulse { 0%,100%{opacity:.4;transform:scale(.9);} 50%{opacity:1;transform:scale(1.05);} }
.tw-ai-loading h3 { font-size: 18px; font-weight: 700; margin-bottom: 8px; color: #1a1a1a; }
.tw-ai-loading p  { font-size: 13px; color: #9a9a9a; }

.tw-poi-grid { display: flex; flex-direction: column; gap: 8px; }
.tw-poi-card {
    display: flex; align-items: flex-start; gap: 12px;
    padding: 14px; border-radius: 14px;
    border: 2px solid #e8e8e8; background: #fff;
    cursor: pointer; transition: all .15s;
    position: relative;
}
.tw-poi-card:hover { border-color: #FF385C; }
.tw-poi-card.active { border-color: #FF385C; background: rgba(255,56,92,.05); }
.tw-poi-cat-icon {
    width: 38px; height: 38px; border-radius: 10px;
    background: #f5f5f5; flex-shrink: 0;
    display: flex; align-items: center; justify-content: center;
}
.tw-poi-cat-icon [data-lucide] { width: 18px; height: 18px; color: #6b6b6b; }
.tw-poi-card.active .tw-poi-cat-icon { background: rgba(255,56,92,.1); }
.tw-poi-card.active .tw-poi-cat-icon [data-lucide] { color: #FF385C; }
.tw-poi-body { flex: 1; min-width: 0; }
.tw-poi-name { font-size: 14px; font-weight: 700; color: #1a1a1a; }
.tw-poi-cat  { font-size: 12px; color: #9a9a9a; margin-top: 1px; }
.tw-poi-desc { font-size: 12px; color: #6b6b6b; margin-top: 4px; line-height: 1.4; }
.tw-poi-check {
    width: 22px; height: 22px; border-radius: 50%;
    border: 2px solid #e8e8e8; flex-shrink: 0;
    display: flex; align-items: center; justify-content: center;
    transition: all .15s;
}
.tw-poi-check [data-lucide] { width: 11px; height: 11px; color: transparent; }
.tw-poi-card.active .tw-poi-check { border-color: #FF385C; background: #FF385C; }
.tw-poi-card.active .tw-poi-check [data-lucide] { color: #fff; }

/* ── Nav ────────────────────────────────────────────────────────────────── */
.tw-nav {
    display: flex; align-items: center;
    padding: 16px 24px 20px;
    border-top: 1px solid #f0f0f0;
    gap: 12px;
}
.tw-btn-back {
    display: inline-flex; align-items: center; gap: 6px;
    padding: 11px 20px; border-radius: 999px;
    border: 1.5px solid #e8e8e8; background: #fff;
    font: inherit; font-size: 14px; font-weight: 600; color: #6b6b6b;
    cursor: pointer; transition: all .15s;
}
.tw-btn-back:hover { border-color: #1a1a1a; color: #1a1a1a; }
.tw-btn-back [data-lucide] { width: 15px; height: 15px; }

.tw-btn-primary {
    display: inline-flex; align-items: center; gap: 7px;
    padding: 12px 24px; border-radius: 999px;
    border: none; background: #FF385C; color: #fff;
    font: inherit; font-size: 15px; font-weight: 700;
    cursor: pointer; transition: background .15s;
    box-shadow: 0 4px 16px rgba(255,56,92,.3);
}
.tw-btn-primary:hover:not(:disabled) { background: #e0304f; }
.tw-btn-primary:disabled { opacity: .7; cursor: not-allowed; }
.tw-btn-primary [data-lucide] { width: 16px; height: 16px; }

/* ── Error toast ────────────────────────────────────────────────────────── */
.tw-error-toast {
    position: absolute; bottom: 80px; left: 50%; transform: translateX(-50%);
    background: #1a1a1a; color: #fff; font-size: 13px; font-weight: 600;
    padding: 10px 20px; border-radius: 999px;
    white-space: nowrap; z-index: 10;
    animation: twPop .2s ease;
}

/* ── Mobile ─────────────────────────────────────────────────────────────── */
@media (max-width: 560px) {
    .tw-overlay { padding: 0; align-items: flex-end; }
    .tw-shell { max-width: 100%; border-radius: 22px 22px 0 0; max-height: 94vh; }
    .tw-mode-grid { grid-template-columns: repeat(4, 1fr); }
    .tw-step-label { display: none; }
}

/* ── GPX-Import Einstieg (Step 1) ────────────────────────────────────────── */
.tw-gpx-entry {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 10px;
    margin-top: 20px;
    padding-top: 20px;
    border-top: 1px solid #f0f0f0;
}

.tw-gpx-divider {
    font-size: 12px;
    color: #9ca3af;
    text-transform: uppercase;
    letter-spacing: 0.08em;
}

.tw-gpx-btn {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    background: #f9fafb;
    border: 1.5px solid #e5e7eb;
    border-radius: 10px;
    padding: 9px 18px;
    font-size: 14px;
    font-weight: 500;
    color: #374151;
    cursor: pointer;
    transition: background 0.15s, border-color 0.15s, color 0.15s;
}

.tw-gpx-btn:hover {
    background: #eff6ff;
    border-color: #3b82f6;
    color: #1d4ed8;
}

.tw-gpx-btn i {
    width: 16px;
    height: 16px;
}
