/*
 * ═══════════════════════════════════════════════════════════════════════════
 * wezunu GPX-Import UI
 * Developed by Toni Sciacca - mail@tonisciacca.com
 * ═══════════════════════════════════════════════════════════════════════════
 */

/* ── Overlay ───────────────────────────────────────────────────────────── */

.gpxi-overlay {
    display: none;
    position: fixed;
    inset: 0;
    z-index: 9000;
    background: rgba(0, 0, 0, 0.55);
    backdrop-filter: blur(3px);
    align-items: center;
    justify-content: center;
    padding: 16px;
}

.gpxi-overlay--visible {
    display: flex;
}

.gpxi-noscroll {
    overflow: hidden;
}

/* ── Panel ─────────────────────────────────────────────────────────────── */

.gpxi-panel {
    background: #fff;
    border-radius: 16px;
    box-shadow: 0 24px 64px rgba(0, 0, 0, 0.18);
    width: 100%;
    max-width: 520px;
    max-height: 90vh;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
}

/* ── Header ────────────────────────────────────────────────────────────── */

.gpxi-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 20px 24px 16px;
    border-bottom: 1px solid #f0f0f0;
    position: sticky;
    top: 0;
    background: #fff;
    z-index: 1;
    border-radius: 16px 16px 0 0;
}

.gpxi-header-title {
    display: flex;
    align-items: center;
    gap: 8px;
    font-weight: 600;
    font-size: 16px;
    color: #111;
}

.gpxi-header-title i {
    width: 18px;
    height: 18px;
    color: #3b82f6;
}

.gpxi-close {
    background: none;
    border: none;
    cursor: pointer;
    padding: 4px;
    border-radius: 6px;
    color: #888;
    display: flex;
    align-items: center;
    transition: background 0.15s, color 0.15s;
}

.gpxi-close:hover {
    background: #f5f5f5;
    color: #333;
}

.gpxi-close i {
    width: 18px;
    height: 18px;
}

/* ── Screens ───────────────────────────────────────────────────────────── */

.gpxi-screen {
    padding: 24px;
}

.gpxi-screen--hidden {
    display: none !important;
}

/* ── Dropzone ──────────────────────────────────────────────────────────── */

.gpxi-zone {
    border: 2px dashed #d1d5db;
    border-radius: 12px;
    padding: 40px 24px;
    text-align: center;
    cursor: pointer;
    transition: border-color 0.2s, background 0.2s;
    background: #fafafa;
}

.gpxi-zone:hover,
.gpxi-zone--active {
    border-color: #3b82f6;
    background: #eff6ff;
}

.gpxi-zone-icon {
    width: 40px;
    height: 40px;
    color: #9ca3af;
    margin-bottom: 12px;
}

.gpxi-zone-label {
    font-size: 15px;
    font-weight: 500;
    color: #374151;
    margin: 0 0 6px;
}

.gpxi-zone-hint {
    font-size: 13px;
    color: #9ca3af;
    margin: 0 0 16px;
}

.gpxi-pick-btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    background: #3b82f6;
    color: #fff;
    border: none;
    border-radius: 8px;
    padding: 8px 16px;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: background 0.15s;
}

.gpxi-pick-btn:hover {
    background: #2563eb;
}

.gpxi-pick-btn i {
    width: 15px;
    height: 15px;
}

.gpxi-error {
    margin-top: 12px;
    font-size: 13px;
    color: #dc2626;
    background: #fef2f2;
    border-radius: 6px;
    padding: 8px 12px;
}

/* ── AI Toggle ─────────────────────────────────────────────────────────── */

.gpxi-ai-toggle {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-top: 16px;
    font-size: 13px;
    color: #6b7280;
    cursor: pointer;
    user-select: none;
}

.gpxi-ai-toggle i {
    width: 14px;
    height: 14px;
    color: #7c3aed;
}

.gpxi-ai-toggle input[type="checkbox"] {
    accent-color: #7c3aed;
    width: 15px;
    height: 15px;
}

/* ── Loading ───────────────────────────────────────────────────────────── */

#gpxi-screen-loading {
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 56px 24px;
    text-align: center;
    gap: 12px;
}

.gpxi-spinner {
    width: 32px;
    height: 32px;
    color: #3b82f6;
    animation: gpxi-spin 1s linear infinite;
}

@keyframes gpxi-spin {
    to { transform: rotate(360deg); }
}

.gpxi-loading-label {
    font-size: 15px;
    font-weight: 500;
    color: #374151;
    margin: 0;
    min-height: 1.4em;
    transition: opacity 0.3s;
}

.gpxi-loading-hint {
    font-size: 13px;
    color: #9ca3af;
    margin: 0;
}

/* ── Ergebnis-Block ────────────────────────────────────────────────────── */

.gpxi-ai-block {
    background: linear-gradient(135deg, #ede9fe 0%, #f5f3ff 100%);
    border-radius: 10px;
    padding: 16px;
    margin-bottom: 20px;
}

.gpxi-ai-label {
    display: flex;
    align-items: center;
    gap: 5px;
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: #7c3aed;
    margin-bottom: 8px;
}

.gpxi-ai-label i {
    width: 12px;
    height: 12px;
}

.gpxi-ai-title {
    font-size: 18px;
    font-weight: 700;
    color: #1e1b4b;
    margin: 0 0 8px;
    line-height: 1.3;
}

.gpxi-ai-desc {
    font-size: 13px;
    color: #4c4980;
    margin: 0;
    line-height: 1.5;
}

/* ── Stats ─────────────────────────────────────────────────────────────── */

.gpxi-stats {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 12px;
    margin-bottom: 16px;
}

.gpxi-stat {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
    text-align: center;
    background: #f9fafb;
    border-radius: 8px;
    padding: 12px 8px;
}

.gpxi-stat i {
    width: 16px;
    height: 16px;
    color: #6b7280;
    margin-bottom: 2px;
}

.gpxi-stat-value {
    font-size: 13px;
    font-weight: 600;
    color: #111827;
    font-variant-numeric: tabular-nums;
}

.gpxi-stat-label {
    font-size: 11px;
    color: #9ca3af;
}

/* ── Pills ──────────────────────────────────────────────────────────────── */

.gpxi-pills {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-bottom: 20px;
}

.gpxi-pill {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    padding: 4px 10px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 500;
}

.gpxi-pill i {
    width: 13px;
    height: 13px;
}

.gpxi-pill--transport {
    background: #dbeafe;
    color: #1d4ed8;
}

.gpxi-pill--type {
    background: #dcfce7;
    color: #166534;
}

.gpxi-pill--region {
    background: #fef9c3;
    color: #92400e;
}

.gpxi-pill--zweck {
    background: #fce7f3;
    color: #9d174d;
}

.gpxi-pill--zg {
    background: #e0e7ff;
    color: #3730a3;
}

.gpxi-pill--thema {
    background: #f0fdf4;
    color: #166534;
    border: 1px solid #bbf7d0;
}

/* ── Multimodal Bar ─────────────────────────────────────────────────────── */

.gpxi-mm-bar {
    display: flex;
    border-radius: 8px;
    overflow: hidden;
    height: 36px;
    margin-bottom: 12px;
    gap: 2px;
}

.gpxi-mm-seg {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 4px;
    font-size: 11px;
    font-weight: 600;
    min-width: 0;
    overflow: hidden;
    border-radius: 4px;
    transition: flex 0.3s;
}

.gpxi-mm-seg i[data-lucide] {
    width: 13px;
    height: 13px;
    flex-shrink: 0;
}

/* ── Score ─────────────────────────────────────────────────────────────── */

.gpxi-score-block {
    background: #f9fafb;
    border-radius: 10px;
    padding: 14px 16px;
    margin-bottom: 20px;
}

.gpxi-score-header {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    margin-bottom: 8px;
}

.gpxi-score-label {
    font-size: 12px;
    font-weight: 600;
    color: #6b7280;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.gpxi-score-value {
    font-size: 22px;
    font-weight: 700;
    color: #111827;
    font-variant-numeric: tabular-nums;
}

.gpxi-score-value::after {
    content: '/100';
    font-size: 12px;
    font-weight: 400;
    color: #9ca3af;
    margin-left: 2px;
}

.gpxi-score-bar-wrap {
    background: #e5e7eb;
    border-radius: 4px;
    height: 6px;
    margin-bottom: 12px;
    overflow: hidden;
}

.gpxi-score-bar {
    height: 100%;
    background: linear-gradient(90deg, #3b82f6, #6366f1);
    border-radius: 4px;
    transition: width 0.6s ease;
}

.gpxi-score-dims {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.gpxi-score-dim {
    display: grid;
    grid-template-columns: 80px 1fr 30px;
    align-items: center;
    gap: 8px;
    font-size: 12px;
    color: #6b7280;
}

.gpxi-score-dim-bar-wrap {
    background: #e5e7eb;
    border-radius: 3px;
    height: 4px;
    overflow: hidden;
}

.gpxi-score-dim-bar {
    height: 100%;
    background: #93c5fd;
    border-radius: 3px;
}

.gpxi-score-dim-val {
    font-variant-numeric: tabular-nums;
    color: #374151;
    font-weight: 500;
    text-align: right;
}

/* ── Etappen ────────────────────────────────────────────────────────────── */

.gpxi-stages {
    margin-bottom: 20px;
}

.gpxi-stages-title {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 12px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: #6b7280;
    margin-bottom: 10px;
}

.gpxi-stages-title i {
    width: 13px;
    height: 13px;
}

.gpxi-stage {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 0;
    border-bottom: 1px solid #f3f4f6;
}

.gpxi-stage:last-child {
    border-bottom: none;
}

.gpxi-stage-num {
    width: 24px;
    height: 24px;
    border-radius: 50%;
    background: #3b82f6;
    color: #fff;
    font-size: 11px;
    font-weight: 600;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.gpxi-stage-info {
    display: flex;
    align-items: center;
    gap: 14px;
    flex-wrap: wrap;
}

.gpxi-stage-dist {
    font-size: 14px;
    font-weight: 600;
    color: #111827;
    font-variant-numeric: tabular-nums;
}

.gpxi-stage-ele,
.gpxi-stage-dur {
    display: flex;
    align-items: center;
    gap: 3px;
    font-size: 12px;
    color: #6b7280;
    font-variant-numeric: tabular-nums;
}

.gpxi-stage-ele i,
.gpxi-stage-dur i {
    width: 12px;
    height: 12px;
}

/* ── Highlights ─────────────────────────────────────────────────────────── */

/* ── Attraktivitätsprofil ───────────────────────────────────────────────── */

.gpxi-attractivity {
    margin-bottom: 16px;
}

.gpxi-attractivity-title {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 12px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: #6b7280;
    margin-bottom: 8px;
}

.gpxi-attractivity-title i { width: 13px; height: 13px; }

.gpxi-attr-bars {
    display: flex;
    align-items: flex-end;
    gap: 2px;
    height: 48px;
    background: #f9fafb;
    border-radius: 8px;
    padding: 6px 8px 0;
}

.gpxi-attr-bar {
    flex: 1;
    background: #d1fae5;
    border-radius: 3px 3px 0 0;
    min-height: 4px;
    transition: background 0.2s;
}

.gpxi-attr-bar--hot {
    background: #10b981;
}

.gpxi-attr-label {
    display: flex;
    justify-content: space-between;
    font-size: 10px;
    color: #9ca3af;
    margin-top: 3px;
    padding: 0 8px;
}

/* ── Top-Abschnitte ─────────────────────────────────────────────────────── */

.gpxi-top-sections {
    margin-bottom: 16px;
}

.gpxi-top-sections-title {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 12px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: #6b7280;
    margin-bottom: 8px;
}

.gpxi-top-sections-title i { width: 13px; height: 13px; color: #f59e0b; }

.gpxi-top-section {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 8px 10px;
    border-radius: 8px;
    background: #fffbeb;
    margin-bottom: 6px;
    border: 1px solid #fde68a;
}

.gpxi-ts-rank {
    width: 22px;
    height: 22px;
    border-radius: 50%;
    background: #f59e0b;
    color: #fff;
    font-size: 11px;
    font-weight: 700;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.gpxi-ts-info {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.gpxi-ts-km {
    font-size: 13px;
    font-weight: 600;
    color: #111827;
}

.gpxi-ts-len {
    font-size: 11px;
    color: #6b7280;
}

.gpxi-ts-score {
    font-size: 20px;
    font-weight: 700;
    color: #d97706;
}

.gpxi-highlights {
    margin-bottom: 20px;
}

.gpxi-highlights-title {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 12px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: #6b7280;
    margin-bottom: 8px;
}

.gpxi-highlights-title i {
    width: 13px;
    height: 13px;
    color: #f59e0b;
}

.gpxi-highlight-item {
    display: flex;
    align-items: flex-start;
    gap: 8px;
    font-size: 13px;
    color: #374151;
    padding: 5px 0;
    line-height: 1.4;
}

.gpxi-highlight-item i {
    width: 14px;
    height: 14px;
    color: #10b981;
    flex-shrink: 0;
    margin-top: 1px;
}

/* ── Übernachtungsplanung ───────────────────────────────────────────────── */

.gpxi-overnight { margin-bottom: 16px; }

.gpxi-overnight-title {
    display: flex; align-items: center; gap: 6px;
    font-size: 12px; font-weight: 600; text-transform: uppercase;
    letter-spacing: 0.05em; color: #6b7280; margin-bottom: 8px;
}
.gpxi-overnight-title i { width: 13px; height: 13px; color: #6366f1; }

.gpxi-overnight-stop {
    background: #eef2ff; border-radius: 10px;
    padding: 10px 12px; margin-bottom: 8px;
}

.gpxi-overnight-label {
    font-size: 11px; font-weight: 700; color: #4338ca;
    text-transform: uppercase; letter-spacing: 0.04em; margin-bottom: 6px;
}

.gpxi-overnight-option {
    display: flex; align-items: center; gap: 8px;
    font-size: 13px; color: #1e1b4b; padding: 4px 0;
}
.gpxi-overnight-option i { width: 14px; height: 14px; color: #6366f1; flex-shrink: 0; }
.gpxi-overnight-dist { margin-left: auto; font-size: 11px; color: #6b7280; }
.gpxi-overnight-empty { color: #9ca3af; font-size: 12px; }

/* ── Verbesserungsvorschläge ─────────────────────────────────────────────── */

.gpxi-tipps { margin-bottom: 16px; }

.gpxi-tipps-title {
    display: flex; align-items: center; gap: 6px;
    font-size: 12px; font-weight: 600; text-transform: uppercase;
    letter-spacing: 0.05em; color: #6b7280; margin-bottom: 8px;
}
.gpxi-tipps-title i { width: 13px; height: 13px; color: #f59e0b; }

.gpxi-tipp {
    display: flex; align-items: flex-start; gap: 10px;
    padding: 8px 10px; border-radius: 8px;
    background: #fffbeb; border: 1px solid #fde68a;
    margin-bottom: 6px; font-size: 13px; color: #374151; line-height: 1.4;
}
.gpxi-tipp i { width: 14px; height: 14px; color: #d97706; flex-shrink: 0; margin-top: 2px; }

/* ── Actions ────────────────────────────────────────────────────────────── */

.gpxi-actions {
    display: flex;
    gap: 10px;
    padding-top: 8px;
    border-top: 1px solid #f3f4f6;
    margin-top: 4px;
}

.gpxi-btn-primary {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    background: #3b82f6;
    color: #fff;
    border: none;
    border-radius: 8px;
    padding: 9px 16px;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    text-decoration: none;
    transition: background 0.15s;
    flex: 1;
    justify-content: center;
}

.gpxi-btn-primary:hover {
    background: #2563eb;
}

.gpxi-btn-primary:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

.gpxi-btn-primary i {
    width: 15px;
    height: 15px;
}

.gpxi-btn-ghost {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    background: none;
    color: #6b7280;
    border: 1px solid #e5e7eb;
    border-radius: 8px;
    padding: 9px 14px;
    font-size: 14px;
    cursor: pointer;
    transition: background 0.15s, color 0.15s;
    white-space: nowrap;
}

.gpxi-btn-ghost:hover {
    background: #f9fafb;
    color: #374151;
}

.gpxi-btn-ghost i {
    width: 14px;
    height: 14px;
}

/* ── Gespeichert ────────────────────────────────────────────────────────── */

#gpxi-screen-saved {
    text-align: center;
    padding: 48px 24px;
}

.gpxi-saved-icon i {
    width: 48px;
    height: 48px;
    color: #10b981;
}

.gpxi-saved-title {
    font-size: 18px;
    font-weight: 600;
    color: #111827;
    margin: 16px 0 24px;
}

.gpxi-saved-actions {
    display: flex;
    flex-direction: column;
    gap: 10px;
    max-width: 240px;
    margin: 0 auto;
}

/* ── Responsive ─────────────────────────────────────────────────────────── */

@media (max-width: 480px) {
    .gpxi-stats {
        grid-template-columns: repeat(2, 1fr);
    }

    .gpxi-actions {
        flex-direction: column;
    }

    .gpxi-btn-primary,
    .gpxi-btn-ghost {
        width: 100%;
        justify-content: center;
    }
}

/* ── Feedback-Widget ────────────────────────────────────────────────────── */
.gpxi-feedback {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 8px;
    margin-top: 18px;
    padding: 12px 16px;
    border-radius: 12px;
    background: #faf8f5;
    border: 1px solid #e8e8e8;
    font-size: 13px;
    color: #6b6b6b;
}
.gpxi-fb-q {
    display: flex;
    align-items: center;
    gap: 6px;
    font-weight: 500;
    color: #374151;
    flex: 1;
    min-width: 180px;
}
.gpxi-fb-q i { width: 14px; height: 14px; color: #9ca3af; }
.gpxi-fb-btn {
    padding: 6px 14px;
    border-radius: 50px;
    border: none;
    cursor: pointer;
    font: 600 12px 'Outfit', sans-serif;
    transition: background .15s, color .15s;
}
.gpxi-fb-yes  { background: #dcfce7; color: #166534; }
.gpxi-fb-yes:hover { background: #bbf7d0; }
.gpxi-fb-alt {
    background: none;
    border: none;
    cursor: pointer;
    font: 400 12px 'Outfit', sans-serif;
    color: #9ca3af;
    text-decoration: underline;
    padding: 0;
}
.gpxi-fb-alt:hover { color: #374151; }
.gpxi-fb-correct {
    display: flex;
    align-items: center;
    gap: 8px;
    width: 100%;
}
.gpxi-fb-select {
    padding: 6px 12px;
    border: 1px solid #e8e8e8;
    border-radius: 50px;
    font: 13px 'Outfit', sans-serif;
    background: #fff;
    color: #1a1a1a;
    cursor: pointer;
}
.gpxi-fb-send { background: #FF385C; color: #fff; }
.gpxi-fb-send:hover { background: #e02849; }
.gpxi-fb-done {
    display: flex;
    align-items: center;
    gap: 6px;
    color: #166534;
    font-weight: 600;
    font-size: 13px;
}
.gpxi-fb-done i { width: 14px; height: 14px; }
