/* ========================================
   VoyageMap v11 — Daylight Edition
   Theme: Azure Sky & White Clouds
   ======================================== */

/* ---------- Variables ---------- */
:root {
    /* --- Daylight Palette (White + Sky Blue) --- */
    --bg-primary: #f0f9ff;
    /* Very pale blue sky */
    --bg-secondary: #e0f2fe;
    /* Light blue */
    --bg-card: #ffffff;
    /* Pure White */
    --bg-card-hover: #f8fafc;
    /* Slight grey tint */
    --bg-input: #f1f5f9;
    /* Light grey input */

    /* --- Glass --- */
    --bg-glass: rgba(255, 255, 255, 0.85);
    --bg-glass-light: rgba(255, 255, 255, 0.95);

    /* --- Text Colors --- */
    --text-primary: #0f172a;
    /* Dark Slate */
    --text-secondary: #475569;
    /* Slate 600 */
    --text-muted: #94a3b8;
    /* Slate 400 */

    /* --- Sky Accents --- */
    --accent: #0ea5e9;
    /* Sky 500 */
    --accent-light: #38bdf8;
    /* Sky 400 */
    --accent-dark: #0284c7;
    /* Sky 600 */
    --accent-dim: #e0f2fe;
    /* Pale Sky */

    /* --- Sun/Warmth --- */
    --accent-glow: rgba(14, 165, 233, 0.25);
    --accent-surface: rgba(14, 165, 233, 0.08);

    /* --- Functional Colors (Muted) --- */
    --green: #10b981;
    --green-surface: rgba(16, 185, 129, 0.1);
    --red: #ef4444;
    --red-surface: rgba(239, 68, 68, 0.1);
    --orange: #f59e0b;
    --orange-surface: rgba(245, 158, 11, 0.1);

    /* --- Gradients (Green -> Turquoise -> Red) --- */
    --gradient-accent: linear-gradient(135deg, #10b981 0%, #0ea5e9 50%, #ef4444 100%);
    --gradient-text: linear-gradient(135deg, #10b981 0%, #0ea5e9 50%, #ef4444 100%);
    --gradient-hero: radial-gradient(circle at 50% 50%, rgba(255, 255, 255, 0.8), transparent 60%);

    /* --- Borders --- */
    --border: #e2e8f0;
    /* Slate 200 */
    --border-accent: #0ea5e9;
    /* Sky Line */
    --border-light: #cbd5e1;
    /* Slate 300 */

    /* --- Geometry (Sharp / Architectural) --- */
    --radius-xs: 0px;
    --radius-sm: 2px;
    --radius-md: 2px;
    --radius-lg: 4px;
    --radius-xl: 4px;
    --radius-full: 9999px;

    /* --- Effects --- */
    --shadow-sm: 0 0 0 1px rgba(255, 255, 255, 0.05);
    --shadow-md: 0 4px 12px rgba(0, 0, 0, 0.8), 0 0 0 1px rgba(212, 175, 55, 0.1);
    /* Subtle gold rim */
    --shadow-lg: 0 10px 30px rgba(0, 0, 0, 0.9), 0 0 20px rgba(212, 175, 55, 0.05);
    --shadow-glow: 0 0 15px var(--accent-glow);

    /* --- Layout --- */
    --header-height: 60px;
    --sidebar-width: 400px;
    --transition: 0.25s cubic-bezier(0.2, 0, 0.2, 1);
}

/* ---------- Reset ---------- */
*,
*::before,
*::after {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
    -webkit-text-size-adjust: 100%;
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
    background-color: var(--bg-primary);
    color: var(--text-primary);
    font-size: 15px;
    line-height: 1.5;
    height: 100dvh;
    overflow: hidden;
    -webkit-font-smoothing: antialiased;
}

a {
    color: inherit;
    text-decoration: none;
    transition: color var(--transition);
}

input,
select,
textarea {
    font-family: inherit;
    font-size: inherit;
}

button {
    font-family: inherit;
    font-size: inherit;
    border: none;
    background: none;
    cursor: pointer;
}

/* Scrollbar (Thin Gold) */
::-webkit-scrollbar {
    width: 6px;
    height: 6px;
}

::-webkit-scrollbar-track {
    background: var(--bg-primary);
}

::-webkit-scrollbar-thumb {
    background: #333;
    border: 1px solid var(--bg-primary);
}

::-webkit-scrollbar-thumb:hover {
    background: #555;
    border-color: var(--accent);
}

/* --- Header (Floating Wide Pill) --- */
.header {
    position: fixed;
    top: 10px;
    left: 50%;
    transform: translateX(-50%);
    width: 90%;
    max-width: 800px;
    /* Much wider as requested */
    min-width: 320px;
    height: 64px;
    /* Slightly taller for better touch targets */

    background: rgba(255, 255, 255, 0.9);
    /* Solid white pill */
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);

    border: 1px solid var(--border-light);
    border-radius: 99px;

    z-index: 1000;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.08);
    /* Soft daylight shadow */
    padding: 6px 8px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.header-inner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    width: 100%;
    padding: 0 16px;
}

.logo {
    display: flex;
    align-items: center;
    gap: 10px;
    font-family: 'Outfit', sans-serif;
    font-size: 1.2rem;
    font-weight: 800;
    color: var(--text-primary);
    text-decoration: none;
}

.logo-icon-wrap {
    width: 30px;
    height: 30px;
    background: var(--gradient-accent);
    border-radius: var(--radius-xs);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.85rem;
    color: white;
    box-shadow: var(--shadow-glow-sm);
}

.logo-accent {
    background: var(--gradient-accent);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

/* Mobile Adjustments for Header */
@media (max-width: 600px) {
    .header {
        top: 10px;
        width: 94%;
        height: 56px;
        padding: 4px;
    }

    .header-inner {
        padding: 0 12px;
    }

    .logo-text {
        font-size: 1rem;
    }

    .nav-link span {
        display: none;
        /* Hide text on mobile, icons only */
    }

    .nav-link {
        padding: 8px;
    }
}

.nav {
    display: flex;
    gap: 2px;
}

.nav-link {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 6px 12px;
    border-radius: var(--radius-sm);
    color: var(--text-muted);
    font-weight: 500;
    font-size: 0.82rem;
    transition: var(--transition);
}

.nav-link:hover {
    color: var(--text-primary);
    background: var(--bg-card-hover);
}

.nav-link.active {
    color: var(--accent-light);
    background: var(--accent-surface);
    box-shadow: 0 0 10px var(--accent-surface);
}

/* ---------- Main ---------- */
.main-content {
    margin-top: var(--header-height);
    height: calc(100vh - var(--header-height));
    height: calc(100dvh - var(--header-height));
    position: relative;
}

/* ---------- Create Panel ---------- */
/* ---------- Create Panel (Responsive) ---------- */
.create-panel {
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 16px;
    padding-top: 100px;
    /* Clear header */
    padding-bottom: 40px;
    position: relative;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
}

.create-panel-inner {
    width: 100%;
    max-width: 520px;
    animation: fadeUp 0.6s ease;
    position: relative;
    padding: 20px;
    /* Reduced specific mobile padding */
    background: rgba(255, 255, 255, 0.6);
    /* Glass card backing for better readability */
    backdrop-filter: blur(12px);
    border-radius: 24px;
    border: 1px solid rgba(255, 255, 255, 0.5);
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.05);
}

@media (min-width: 768px) {
    .create-panel-inner {
        padding: 40px;
        background: transparent;
        /* Clean look on desktop */
        backdrop-filter: none;
        border: none;
        box-shadow: none;
    }
}

/* Decorative Blue Flanking Lines (Desktop Only) */
@media (min-width: 768px) {

    .create-panel-inner::before,
    .create-panel-inner::after {
        content: '';
        position: absolute;
        top: 50%;
        transform: translateY(-50%);
        height: 70%;
        width: 2px;
        background: linear-gradient(to bottom, transparent 0%, var(--accent) 50%, transparent 100%);
        opacity: 0.3;
        pointer-events: none;
        border-radius: 99px;
    }

    .create-panel-inner::before {
        left: -25px;
    }

    .create-panel-inner::after {
        right: -25px;
    }
}

@media (max-width: 767px) {

    .create-panel-inner::before,
    .create-panel-inner::after {
        display: none;
        /* Hide on mobile */
    }

    .create-title {
        font-size: 1.8rem;
    }

    .form-row {
        flex-direction: column;
        gap: 12px;
    }
}

@keyframes fadeUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Projector & Mist Effect - Adjusted for Light Mode */
.projector-effect {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100vh;
    z-index: 0;
    pointer-events: none;
    opacity: 0.8;
    /* Bright daylight */
    mix-blend-mode: normal;
    /* CSS Fallback / Pre-load color (Matches Vanta Sky) */
    background-color: #68b8d7;
}

/* Removed CSS Mist Animation */
.create-hero {
    text-align: center;
    margin-bottom: 32px;
    position: relative;
    z-index: 5;
    /* Ensure above projector */
}

/* Removed create-hero-bg light behind text */
.create-hero-bg {
    display: none;
}

.create-title {
    font-family: 'Outfit', sans-serif;
    font-size: clamp(1.6rem, 4vw, 2.2rem);
    font-weight: 900;
    line-height: 1.2;
    position: relative;
    z-index: 1;
    margin-bottom: 8px;
}

.gradient-text {
    /* Deep Sky Gradient */
    background: linear-gradient(to bottom,
            #0ea5e9 0%,
            #0284c7 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    font-weight: 800;
    filter: none;
    /* Clean text for day */
}

/* ... */

.btn-primary {
    background: var(--gradient-accent);
    color: white;
    /* White text on blue button */
    border: none;
    box-shadow: 0 4px 15px rgba(14, 165, 233, 0.4);
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.1);
    font-weight: 700;
    position: relative;
    overflow: hidden;
}

.btn-primary::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 60%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.4), transparent);
    transform: skewX(-20deg);
    transition: none;
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(14, 165, 233, 0.6);
    color: white;
}

.btn-primary:hover::before {
    left: 200%;
    transition: 0.6s ease;
}

.create-subtitle {
    color: var(--text-secondary);
    font-size: 0.9rem;
    position: relative;
    z-index: 1;
}

/* ---------- Forms ---------- */
.create-form {
    display: flex;
    flex-direction: column;
    gap: 14px;
}

.form-row {
    display: flex;
    gap: 10px;
}

.form-row-2>* {
    flex: 1;
}

.form-group {
    display: flex;
    flex-direction: column;
    gap: 5px;
    flex: 1;
}

.form-label {
    font-size: 0.72rem;
    font-weight: 600;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    display: flex;
    align-items: center;
    gap: 4px;
}

.form-label i {
    font-size: 0.65rem;
    opacity: 0.7;
}

.label-optional {
    font-weight: 400;
    opacity: 0.5;
    text-transform: none;
}

.form-input {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    padding: 10px 12px;
    color: var(--text-primary);
    font-size: 0.85rem;
    transition: var(--transition);
    outline: none;
    width: 100%;
}

.form-input:focus {
    border-color: var(--accent);
    box-shadow: 0 0 0 3px var(--accent-glow);
    background: var(--bg-card-hover);
}

.form-input::placeholder {
    color: var(--text-muted);
}

.form-input-lg {
    font-size: 1rem;
    padding: 12px 16px;
    font-weight: 600;
}

.form-select {
    appearance: none;
    -webkit-appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath fill='%23556480' d='M6 8L1 3h10z'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 12px center;
    padding-right: 32px;
    cursor: pointer;
}

/* Color Picker */
.color-picker {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
}

.color-dot {
    width: 30px;
    height: 30px;
    border-radius: 50%;
    border: 2px solid transparent;
    cursor: pointer;
    transition: var(--transition);
}

.color-dot:hover {
    transform: scale(1.15);
}

.color-dot.active {
    border-color: white;
    box-shadow: 0 0 12px rgba(255, 255, 255, 0.2);
    transform: scale(1.15);
}

/* ---------- Buttons ---------- */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 10px 18px;
    border: none;
    border-radius: var(--radius-sm);
    font-weight: 600;
    font-size: 0.85rem;
    cursor: pointer;
    transition: var(--transition);
    white-space: nowrap;
    touch-action: manipulation;
}

.btn-primary {
    background: transparent;
    color: var(--accent);
    border: 1px solid var(--accent);
    box-shadow: 0 0 10px rgba(212, 175, 55, 0.1);
}

.btn-primary:hover {
    background: var(--accent-surface);
    color: var(--accent-light);
    border-color: var(--accent-light);
    box-shadow: 0 0 20px var(--accent-glow);
    transform: translateY(-1px);
}

.btn-primary:active {
    transform: translateY(0);
}

.btn-ghost {
    background: transparent;
    color: var(--text-secondary);
    border: 1px solid var(--border);
}

.btn-ghost:hover {
    background: var(--bg-card);
    color: var(--text-primary);
}

.btn-danger {
    background: var(--red-surface);
    color: var(--red);
    border: 1px solid rgba(239, 68, 68, 0.15);
}

.btn-danger:hover {
    background: rgba(239, 68, 68, 0.18);
}

.btn-lg {
    padding: 13px 24px;
    font-size: 0.95rem;
    border-radius: var(--radius-md);
}

.btn-sm {
    padding: 6px 12px;
    font-size: 0.78rem;
}

.btn-create {
    width: 100%;
    margin-top: 6px;
}

.btn-icon {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 34px;
    height: 34px;
    min-width: 34px;
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    background: var(--bg-card);
    color: var(--text-secondary);
    cursor: pointer;
    transition: var(--transition);
    flex-shrink: 0;
}

.btn-icon:hover {
    background: var(--bg-card-hover);
    color: var(--accent-light);
    border-color: var(--border-accent);
}

.btn-icon.btn-sm {
    width: 26px;
    height: 26px;
    min-width: 26px;
    font-size: 0.7rem;
}

.btn-pick {
    color: var(--accent-light);
    border-color: var(--border-accent);
}

.btn-danger-icon:hover {
    color: var(--red);
    background: var(--red-surface);
}

/* ---------- Trips Page (New Theme) ---------- */
.trips-page {
    padding: 24px 16px;
    padding-top: 100px;
    /* Clear floating header */
    max-width: 1200px;
    margin: 0 auto;
    overflow-y: auto;
    height: 100%;
}

.trips-page-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 32px;
    flex-wrap: wrap;
    gap: 16px;
}

.trips-page-title {
    font-family: 'Outfit', sans-serif;
    font-size: clamp(1.8rem, 4vw, 2.5rem);
    font-weight: 900;
    color: var(--text-primary);
}

.trips-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
    /* Wider cards */
    gap: 24px;
}

@media (max-width: 600px) {
    .trips-grid {
        grid-template-columns: 1fr;
        /* Stack on mobile */
    }
}

.trip-card {
    background: rgba(255, 255, 255, 0.85);
    /* Daylight Card */
    backdrop-filter: blur(12px);
    border: 1px solid white;
    border-radius: 24px;
    overflow: hidden;
    transition: all 0.3s cubic-bezier(0.2, 0, 0.2, 1);
    animation: cardIn 0.4s ease backwards;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.04);
}

.trip-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 12px 40px rgba(14, 165, 233, 0.15);
    border-color: var(--accent-light);
}

.trip-card-map {
    height: 160px;
    /* Taller visual */
    background: #e0f2fe;
    position: relative;
    overflow: hidden;
}

/* ---------- Planner Layout ---------- */
.planner {
    display: flex;
    height: 100%;
    width: 100%;
}

/* ---------- Sidebar ---------- */
.agenda-sidebar {
    width: var(--sidebar-width);
    min-width: var(--sidebar-width);
    background: var(--bg-secondary);
    border-right: 1px solid var(--border);
    display: flex;
    flex-direction: column;
    transition: var(--transition-slow);
    z-index: 100;
}

.agenda-sidebar.collapsed {
    width: 0;
    min-width: 0;
    overflow: hidden;
}

.agenda-header {
    padding: 14px;
    flex-shrink: 0;
    border-bottom: 1px solid var(--border);
}

.agenda-header-top {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 10px;
}

.agenda-trip-info {
    flex: 1;
    min-width: 0;
}

.agenda-trip-name {
    font-family: 'Outfit', sans-serif;
    font-size: 1rem;
    font-weight: 700;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.agenda-trip-dates {
    font-size: 0.72rem;
    color: var(--text-muted);
}

/* Budget Summary */
.budget-summary {
    display: flex;
    gap: 6px;
    margin-top: 6px;
    flex-wrap: wrap;
}

.budget-pill {
    display: flex;
    align-items: center;
    gap: 4px;
    padding: 2px 8px;
    border-radius: var(--radius-full);
    font-size: 0.68rem;
    font-weight: 600;
}

.budget-spent {
    background: var(--green-surface);
    color: var(--green);
}

.budget-spent i {
    font-size: 0.6rem;
}

.budget-est {
    background: var(--orange-surface);
    color: var(--orange);
}

.budget-est i {
    font-size: 0.6rem;
}

.view-toggle {
    display: flex;
    gap: 3px;
    background: var(--bg-card);
    border-radius: var(--radius-sm);
    padding: 3px;
}

.view-btn {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 5px;
    padding: 6px 10px;
    background: transparent;
    border: none;
    color: var(--text-muted);
    font-size: 0.78rem;
    font-weight: 600;
    border-radius: var(--radius-xs);
    cursor: pointer;
    transition: var(--transition);
}

.view-btn:hover {
    color: var(--text-secondary);
}

.view-btn.active {
    background: var(--accent);
    color: white;
    box-shadow: var(--shadow-glow-sm);
}

.agenda-drag-handle {
    display: none;
}

/* ---------- Agenda Content ---------- */
.agenda-content {
    flex: 1;
    overflow-y: auto;
    padding: 10px;
    -webkit-overflow-scrolling: touch;
}

.agenda-days {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.empty-agenda {
    text-align: center;
    padding: 40px 16px;
    color: var(--text-muted);
}

/* Day Card */
.day-card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    overflow: hidden;
    transition: var(--transition);
    animation: slideIn 0.3s ease forwards;
    opacity: 0;
}

@keyframes slideIn {
    from {
        opacity: 0;
        transform: translateX(-10px);
    }

    to {
        opacity: 1;
        transform: translateX(0);
    }
}

.day-card:hover {
    border-color: var(--border-hover);
}

.day-card-header {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 10px 12px;
    cursor: pointer;
    transition: var(--transition);
    touch-action: manipulation;
}

.day-card-header:hover {
    background: var(--bg-card-hover);
}

.day-number {
    width: 32px;
    height: 32px;
    background: var(--accent-surface);
    border-radius: var(--radius-xs);
    display: flex;
    align-items: center;
    justify-content: center;
    font-family: 'Outfit', sans-serif;
    font-weight: 800;
    font-size: 0.82rem;
    color: var(--accent-light);
    flex-shrink: 0;
}

.day-info {
    flex: 1;
    min-width: 0;
}

.day-title {
    font-weight: 600;
    font-size: 0.82rem;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.day-date {
    font-size: 0.7rem;
    color: var(--text-muted);
}

.day-toggle {
    color: var(--text-muted);
    font-size: 0.65rem;
    transition: var(--transition);
}

.day-card.expanded .day-toggle {
    transform: rotate(180deg);
}

.day-body {
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.4s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.day-card.expanded .day-body {
    max-height: 3000px;
    overflow: visible;
}

.day-note-icon {
    color: var(--accent);
    margin-left: 4px;
    font-size: 0.7rem;
}

.day-actions {
    display: flex;
    align-items: center;
    gap: 6px;
    margin-left: auto;
    margin-right: 8px;
}

.day-badge {
    background: var(--bg-input);
    color: var(--text-muted);
    padding: 1px 6px;
    border-radius: var(--radius-full);
    font-size: 0.65rem;
    font-weight: 600;
}

.day-budget-tag {
    background: var(--green-surface);
    color: var(--green);
    padding: 1px 7px;
    border-radius: var(--radius-full);
    font-size: 0.65rem;
    font-weight: 600;
}

/* ---------- Lodging Section ---------- */
.day-lodging {
    display: flex;
    align-items: center;
    gap: 10px;
    margin: 8px 12px;
    padding: 10px 12px;
    background: linear-gradient(135deg, rgba(99, 102, 241, 0.06), rgba(139, 92, 246, 0.04));
    border: 1px solid var(--border-accent);
    border-radius: var(--radius-sm);
    cursor: pointer;
    transition: var(--transition);
}

.day-lodging:hover {
    background: linear-gradient(135deg, rgba(99, 102, 241, 0.1), rgba(139, 92, 246, 0.06));
}

.lodging-icon {
    width: 32px;
    height: 32px;
    background: var(--accent-surface);
    border-radius: var(--radius-xs);
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--accent-light);
    font-size: 0.85rem;
    flex-shrink: 0;
}

.lodging-info {
    flex: 1;
    min-width: 0;
}

.lodging-name {
    font-weight: 600;
    font-size: 0.82rem;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.lodging-loc {
    font-size: 0.68rem;
    color: var(--text-muted);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.lodging-price {
    font-size: 0.78rem;
    font-weight: 700;
    color: var(--green);
    white-space: nowrap;
}

.lodging-price span {
    font-size: 0.62rem;
    font-weight: 400;
    color: var(--text-muted);
    margin-left: 1px;
}

.lodging-actions {
    display: flex;
    gap: 2px;
    opacity: 0;
    transition: var(--transition);
}

.day-lodging:hover .lodging-actions {
    opacity: 1;
}

.day-lodging-empty {
    display: flex;
    align-items: center;
    gap: 6px;
    margin: 8px 12px;
    padding: 8px 12px;
    background: transparent;
    border: 1px dashed var(--border);
    border-radius: var(--radius-sm);
    color: var(--text-muted);
    font-size: 0.75rem;
    font-weight: 500;
    cursor: pointer;
    transition: var(--transition);
    width: calc(100% - 24px);
}

.day-lodging-empty:hover {
    border-color: var(--accent);
    color: var(--accent-light);
    background: var(--accent-surface);
}

.day-lodging-empty i {
    font-size: 0.8rem;
}

/* ---------- Timeline ---------- */
.timeline-container {
    padding: 6px 0 14px 16px;
    display: flex;
    flex-direction: column;
    min-height: 20px;
}

.timeline-item {
    display: flex;
    gap: 12px;
    position: relative;
    padding-bottom: 0;
    min-height: 44px;
}

.timeline-time {
    width: 36px;
    text-align: right;
    font-size: 0.7rem;
    color: var(--text-muted);
    padding-top: 10px;
    font-weight: 500;
    flex-shrink: 0;
    line-height: 1.2;
}

.time-end {
    opacity: 0.5;
    font-size: 0.62rem;
}

.timeline-marker {
    display: flex;
    flex-direction: column;
    align-items: center;
    position: relative;
    width: 14px;
    flex-shrink: 0;
}

.timeline-dot {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    margin-top: 12px;
    z-index: 2;
    box-shadow: 0 0 0 3px var(--bg-card);
}

.timeline-line {
    width: 2px;
    background: var(--border);
    flex: 1;
    margin-top: -2px;
    margin-bottom: -6px;
}

.timeline-content {
    flex: 1;
    padding: 8px 10px 8px 8px;
    background: var(--bg-input);
    border: 1px solid transparent;
    border-radius: var(--radius-sm);
    margin-bottom: 8px;
    display: flex;
    align-items: center;
    gap: 8px;
    transition: var(--transition);
    cursor: grab;
    position: relative;
    overflow: hidden;
    touch-action: pan-y;
}

.timeline-content:hover {
    background: var(--bg-card-hover);
    border-color: var(--border);
    transform: translateX(2px);
}

.timeline-content:active {
    cursor: grabbing;
}

.timeline-content.sortable-ghost {
    opacity: 0.4;
    background: var(--bg-card);
    border: 1px dashed var(--text-muted);
}

.timeline-content.sortable-chosen {
    background: var(--bg-card-hover);
    box-shadow: var(--shadow-md);
    transform: scale(1.02);
}

.timeline-content.sortable-fallback {
    opacity: 0.9;
    box-shadow: var(--shadow-lg);
}

.activity-drag-handle {
    color: var(--text-muted);
    font-size: 0.7rem;
    cursor: grab;
    padding: 4px;
    opacity: 0.5;
    transition: var(--transition);
    touch-action: none;
}

.timeline-content:hover .activity-drag-handle {
    opacity: 1;
}

.activity-emoji {
    font-size: 1.1rem;
    width: 24px;
    text-align: center;
    flex-shrink: 0;
}

.activity-info {
    flex: 1;
    min-width: 0;
    cursor: pointer;
}

.activity-name {
    font-weight: 600;
    font-size: 0.82rem;
    color: var(--text-primary);
}

.activity-meta {
    display: flex;
    align-items: center;
    gap: 6px;
    flex-wrap: wrap;
}

.activity-loc {
    font-size: 0.7rem;
    color: var(--text-muted);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.activity-price-tag {
    font-size: 0.62rem;
    font-weight: 600;
    color: var(--green);
    background: var(--green-surface);
    padding: 1px 5px;
    border-radius: var(--radius-full);
    white-space: nowrap;
}

.activity-actions {
    display: flex;
    gap: 2px;
    opacity: 0;
    transition: var(--transition);
}

.timeline-content:hover .activity-actions {
    opacity: 1;
}

/* Add Activity Button */
.btn-add-day-activity {
    margin: 4px 0 8px 62px;
    width: auto;
    align-self: flex-start;
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 6px 12px;
    background: transparent;
    border: 1px dashed var(--border);
    border-radius: var(--radius-full);
    color: var(--text-muted);
    font-size: 0.75rem;
    font-weight: 500;
    cursor: pointer;
    transition: var(--transition);
    touch-action: manipulation;
}

.btn-add-day-activity:hover {
    border-color: var(--accent);
    color: var(--accent-light);
    background: var(--accent-surface);
}

/* ---------- POI Categories ---------- */
.poi-categories {
    display: flex;
    gap: 4px;
    flex-wrap: wrap;
    margin-bottom: 8px;
}

.poi-cat {
    display: flex;
    align-items: center;
    gap: 3px;
    padding: 5px 10px;
    border: 1px solid var(--border);
    border-radius: var(--radius-full);
    background: var(--bg-card);
    color: var(--text-muted);
    font-size: 0.7rem;
    font-weight: 500;
    cursor: pointer;
    transition: var(--transition);
    white-space: nowrap;
}

.poi-cat:hover {
    border-color: var(--accent);
    color: var(--accent-light);
    background: var(--accent-surface);
}

.poi-cat.active {
    background: var(--accent);
    color: white;
    border-color: var(--accent);
    box-shadow: 0 2px 8px var(--accent-glow);
}

/* ---------- Map ---------- */
.map-container {
    flex: 1;
    position: relative;
    overflow: hidden;
}

.map {
    width: 100%;
    height: 100%;
    touch-action: pan-x pan-y;
}

.maplibregl-canvas {
    touch-action: none;
}

.maplibregl-canvas-container {
    touch-action: none;
}

/* MapLibre Overrides */
.maplibregl-ctrl-group {
    background: var(--bg-card) !important;
    border: 1px solid var(--border) !important;
    border-radius: var(--radius-sm) !important;
    box-shadow: var(--shadow-md) !important;
    overflow: hidden;
}

.maplibregl-ctrl-group button {
    width: 32px !important;
    height: 32px !important;
    background: var(--bg-card) !important;
    border-color: var(--border) !important;
}

.maplibregl-ctrl-group button:hover {
    background: var(--bg-card-hover) !important;
}

.maplibregl-ctrl-group button .maplibregl-ctrl-icon {
    filter: invert(1) brightness(0.85);
}

.maplibregl-ctrl-attrib {
    background: rgba(0, 0, 0, 0.4) !important;
    backdrop-filter: blur(8px);
    color: rgba(255, 255, 255, 0.5) !important;
    font-size: 9px !important;
}

.maplibregl-ctrl-attrib a {
    color: var(--accent-light) !important;
}

/* Popup */
.maplibregl-popup-content {
    background: var(--bg-card) !important;
    color: var(--text-primary) !important;
    border: 1px solid var(--border) !important;
    border-radius: var(--radius-md) !important;
    box-shadow: var(--shadow-lg) !important;
    padding: 12px 14px !important;
}

.maplibregl-popup-tip {
    border-top-color: var(--bg-card) !important;
}

.maplibregl-popup-anchor-bottom .maplibregl-popup-tip {
    border-top-color: var(--bg-card) !important;
    border-bottom-color: transparent !important;
}

.maplibregl-popup-anchor-top .maplibregl-popup-tip {
    border-bottom-color: var(--bg-card) !important;
    border-top-color: transparent !important;
}

/* Markers — Circle + Triangle (no rotation = perfect anchor) */
.map-marker {
    display: flex;
    flex-direction: column;
    align-items: center;
    cursor: pointer;
    will-change: transform;
    pointer-events: auto;
}

.marker-bubble {
    width: 34px;
    height: 34px;
    border-radius: 50%;
    border: 2.5px solid rgba(255, 255, 255, 0.9);
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 3px 12px rgba(0, 0, 0, 0.4);
    position: relative;
}

.map-marker:hover .marker-bubble {
    filter: brightness(1.15);
    box-shadow: 0 5px 18px rgba(0, 0, 0, 0.55);
}

.marker-point {
    width: 0;
    height: 0;
    border-left: 8px solid transparent;
    border-right: 8px solid transparent;
    border-top: 10px solid;
    margin-top: -1px;
    pointer-events: none;
}

.marker-emoji {
    font-size: 15px;
    line-height: 1;
    pointer-events: none;
}

.marker-label {
    position: absolute;
    top: -6px;
    right: -10px;
    min-width: 18px;
    height: 18px;
    padding: 0 4px;
    background: var(--accent);
    color: white;
    font-size: 0.55rem;
    font-weight: 800;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    border: 2px solid white;
    box-shadow: 0 1px 4px rgba(0, 0, 0, 0.3);
    z-index: 2;
    pointer-events: none;
    white-space: nowrap;
}

/* MapLibre marker stability */
.maplibregl-marker {
    will-change: transform;
}

/* FAB: Agenda Button on Map Page */
.fab-agenda {
    position: absolute;
    bottom: 28px;
    right: 14px;
    z-index: 800;
    width: 48px;
    height: 48px;
    border-radius: 50%;
    background: var(--gradient-accent);
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.1rem;
    box-shadow: 0 4px 20px var(--accent-glow), 0 2px 8px rgba(0, 0, 0, 0.3);
    text-decoration: none;
    transition: var(--transition);
    animation: fabPulse 2s ease-in-out infinite;
}

.fab-agenda:hover {
    transform: scale(1.1);
    box-shadow: 0 6px 30px var(--accent-glow), 0 3px 12px rgba(0, 0, 0, 0.4);
}

@keyframes fabPulse {

    0%,
    100% {
        box-shadow: 0 4px 20px var(--accent-glow), 0 2px 8px rgba(0, 0, 0, 0.3);
    }

    50% {
        box-shadow: 0 4px 28px var(--accent-glow), 0 2px 12px rgba(0, 0, 0, 0.3);
    }
}

/* Trip Name Badge on Map */
.map-trip-badge {
    position: absolute;
    top: 148px;
    left: 50%;
    transform: translateX(-50%);
    z-index: 600;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-full);
    padding: 6px 18px;
    box-shadow: var(--shadow-md);
    pointer-events: none;
}

.map-trip-badge span {
    font-family: 'Outfit', sans-serif;
    font-weight: 700;
    font-size: 0.82rem;
    color: var(--text-primary);
}

@media (max-width: 768px) {
    .fab-agenda {
        bottom: 20px;
        right: 12px;
        width: 44px;
        height: 44px;
    }

    .map-trip-badge {
        top: 128px;
        padding: 5px 14px;
    }

    .map-trip-badge span {
        font-size: 0.75rem;
    }
}

/* Layer Control */
.map-layer-control {
    position: absolute;
    bottom: 28px;
    left: 14px;
    z-index: 800;
}

.layer-trigger {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 8px 12px;
    background: white;
    border: none;
    border-radius: var(--radius-sm);
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.2);
    color: #333;
    font-size: 0.8rem;
    font-weight: 600;
    cursor: pointer;
    transition: var(--transition);
}

.layer-trigger:hover {
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.25);
}

.layer-trigger i {
    font-size: 0.85rem;
    color: #555;
}

.layer-menu {
    position: absolute;
    bottom: calc(100% + 8px);
    left: 0;
    background: white;
    border-radius: var(--radius-md);
    box-shadow: 0 6px 30px rgba(0, 0, 0, 0.25);
    padding: 12px;
    width: 200px;
    opacity: 0;
    visibility: hidden;
    transform: translateY(8px) scale(0.95);
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    pointer-events: none;
}

.layer-menu.open {
    opacity: 1;
    visibility: visible;
    transform: translateY(0) scale(1);
    pointer-events: auto;
}

.layer-menu-title {
    font-size: 0.68rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: #888;
    margin-bottom: 8px;
}

.layer-menu-options {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 6px;
}

.style-option {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
    padding: 0;
    background: none;
    border: 2px solid transparent;
    border-radius: var(--radius-sm);
    cursor: pointer;
    transition: var(--transition);
    overflow: hidden;
}

/* Timeline */
/* Timeline */
/* Timeline - Simple & Robust */
.map-timeline-container {
    position: absolute;
    bottom: 100px;
    left: 50%;
    transform: translateX(-50%);
    z-index: 3000;
    display: none;
    /* Controlled by JS */
    align-items: center;
    justify-content: center;
    gap: 15px;
    background-color: #111111 !important;
    color: #ffffff !important;
    padding: 10px 20px;
    border-radius: 30px;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.5);
    min-width: 300px;
    font-family: sans-serif;
}

.day-nav-btn {
    background: #333333 !important;
    color: #ffffff !important;
    border: 1px solid #555555 !important;
    padding: 8px 15px;
    border-radius: 20px;
    cursor: pointer;
    font-size: 14px;
    font-weight: bold;
    display: flex;
    align-items: center;
    gap: 5px;
}

.day-nav-btn:hover {
    background: #555555 !important;
}

.day-nav-btn.disabled {
    opacity: 0.5;
    cursor: default;
    background: #222222 !important;
}

.day-nav-info {
    text-align: center;
    color: #ffffff !important;
}

.day-nav-title {
    font-size: 16px;
    font-weight: bold;
    margin-bottom: 2px;
}

.day-nav-sub {
    font-size: 12px;
    color: #aaaaaa !important;
}

.timeline-btn {
    flex-shrink: 0;
    height: 36px;
    min-width: 36px;
    padding: 0 14px;
    border-radius: 18px;
    border: 1px solid transparent;
    background: transparent;
    color: var(--text-secondary);
    font-size: 0.85rem;
    font-weight: 600;
    font-family: 'Outfit', sans-serif;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: var(--transition);
    white-space: nowrap;
}

.timeline-btn:hover {
    background: rgba(0, 0, 0, 0.05);
}

.timeline-btn.active {
    background: var(--accent);
    color: white;
    box-shadow: 0 2px 8px var(--accent-glow);
}

@media (max-width: 768px) {
    .map-timeline-container {
        bottom: 80px;
        width: auto;
        max-width: 95%;
        justify-content: flex-start;
    }
}

.style-option:hover {
    border-color: #ddd;
}

.style-option.active {
    border-color: var(--accent);
}

.style-option-preview {
    width: 100%;
    height: 46px;
    border-radius: var(--radius-xs);
    background-size: cover;
    background-position: center;
}

.style-preview-streets {
    background: linear-gradient(135deg, #f0ede6, #e8e4d8, #d5e8c0, #c8dfe8);
}

.style-preview-satellite {
    background: linear-gradient(135deg, #1a3a20, #2d5a35, #3d6a45, #0d2a15);
}

.style-preview-dark {
    background: linear-gradient(135deg, #1a1b2e, #232440, #2b2d4a, #15162a);
}

.style-preview-light {
    background: linear-gradient(135deg, #f5f3f0, #ece9e4, #e0ddd6, #f5f3f0);
}

.style-option span {
    font-size: 0.68rem;
    font-weight: 600;
    color: #555;
    padding-bottom: 3px;
}

.style-option.active span {
    color: var(--accent);
}

/* 3D */
.map-3d-toggle {
    position: absolute;
    bottom: 28px;
    right: 14px;
    z-index: 800;
}

.btn-3d {
    display: flex;
    align-items: center;
    gap: 4px;
    padding: 8px 12px;
    background: white;
    border: none;
    border-radius: var(--radius-sm);
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.2);
    color: #555;
    font-size: 0.8rem;
    font-weight: 700;
    cursor: pointer;
    transition: var(--transition);
}

.btn-3d:hover {
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.25);
}

.btn-3d.active {
    background: var(--accent);
    color: white;
    box-shadow: 0 4px 16px var(--accent-glow);
}

/* Popup Content */
.popup-content {
    padding: 2px;
}

.popup-title {
    font-family: 'Outfit', sans-serif;
    font-weight: 700;
    font-size: 0.92rem;
    margin-bottom: 3px;
    color: #1a1a2e;
}

.popup-subtitle {
    font-size: 0.76rem;
    color: #666;
    display: flex;
    align-items: center;
    gap: 4px;
}

.popup-subtitle i {
    font-size: 0.6rem;
    color: var(--accent);
}

.popup-meta {
    font-size: 0.72rem;
    color: var(--green);
    margin-top: 5px;
    display: flex;
    align-items: center;
    gap: 4px;
    font-weight: 600;
}

.popup-meta i {
    font-size: 0.6rem;
}

/* Search bar */
.map-overlay-top {
    position: absolute;
    top: 90px;
    left: 50%;
    transform: translateX(-50%);
    z-index: 800;
    width: clamp(260px, 50%, 420px);
}

.search-bar {
    display: flex;
    align-items: center;
    gap: 8px;
    background: var(--bg-glass-light);
    backdrop-filter: blur(24px);
    border: 1px solid var(--border);
    border-radius: var(--radius-full);
    padding: 0 14px;
    box-shadow: var(--shadow-lg);
    transition: var(--transition);
    position: relative;
}

.search-bar:focus-within {
    border-color: var(--accent);
    box-shadow: var(--shadow-lg), 0 0 0 3px var(--accent-glow);
}

.search-bar i {
    color: var(--text-muted);
    font-size: 0.82rem;
}

.search-input {
    flex: 1;
    background: transparent;
    border: none;
    color: var(--text-primary);
    padding: 10px 0;
    font-size: 0.85rem;
    outline: none;
}

.search-input::placeholder {
    color: var(--text-muted);
}

.search-results {
    position: absolute;
    top: calc(100% + 6px);
    left: 0;
    right: 0;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-lg);
    max-height: 260px;
    overflow-y: auto;
    display: none;
}

.search-results.active {
    display: block;
    animation: fadeIn 0.15s ease;
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(-4px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.search-result-item {
    padding: 10px 12px;
    cursor: pointer;
    transition: var(--transition-fast);
    border-bottom: 1px solid var(--border);
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 0.82rem;
}

.search-result-item:last-child {
    border-bottom: none;
}

.search-result-item:hover {
    background: var(--accent-surface);
}

.search-result-icon {
    width: 26px;
    height: 26px;
    background: var(--accent-surface);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.search-result-icon i {
    font-size: 0.65rem;
    color: var(--accent-light);
}

.search-result-text {
    min-width: 0;
}

.search-result-main {
    font-weight: 600;
    font-size: 0.82rem;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.search-result-sub {
    font-size: 0.68rem;
    color: var(--text-muted);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* Pick Mode */
.pick-mode-indicator {
    position: absolute;
    bottom: 20px;
    left: 50%;
    transform: translateX(-50%);
    z-index: 800;
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 10px 16px;
    background: var(--accent);
    color: white;
    border-radius: var(--radius-full);
    font-weight: 600;
    font-size: 0.82rem;
    box-shadow: 0 4px 20px var(--accent-glow);
    animation: bounceIn 0.4s ease;
}

@keyframes bounceIn {
    from {
        opacity: 0;
        transform: translateX(-50%) translateY(15px) scale(0.92);
    }

    to {
        opacity: 1;
        transform: translateX(-50%) translateY(0) scale(1);
    }
}

.pick-mode-indicator i {
    animation: pulseIcon 1.5s infinite;
}

@keyframes pulseIcon {

    0%,
    100% {
        transform: scale(1);
    }

    50% {
        transform: scale(1.2);
    }
}

.btn-cancel-pick {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 22px;
    height: 22px;
    border: none;
    background: rgba(255, 255, 255, 0.2);
    color: white;
    border-radius: 50%;
    cursor: pointer;
    transition: var(--transition);
}

.btn-cancel-pick:hover {
    background: rgba(255, 255, 255, 0.3);
}

/* Map Stats */
.map-stats {
    position: absolute;
    bottom: 20px;
    right: 14px;
    z-index: 800;
    display: none;
    gap: 5px;
}

.stat-item {
    display: flex;
    align-items: center;
    gap: 4px;
    padding: 6px 10px;
    background: var(--bg-glass-light);
    backdrop-filter: blur(20px);
    border: 1px solid var(--border);
    border-radius: var(--radius-full);
    font-size: 0.75rem;
    font-weight: 600;
    box-shadow: var(--shadow-md);
}

.stat-item i {
    color: var(--accent-light);
    font-size: 0.75rem;
}

/* Expand btn */
.btn-expand-sidebar {
    position: absolute;
    top: 12px;
    left: 12px;
    z-index: 800;
    width: 38px;
    height: 38px;
    background: var(--bg-glass-light);
    backdrop-filter: blur(20px);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    color: var(--accent-light);
    cursor: pointer;
    font-size: 0.9rem;
    transition: var(--transition);
    display: flex;
    align-items: center;
    justify-content: center;
}

.btn-expand-sidebar:hover {
    background: var(--bg-card-hover);
    border-color: var(--border-accent);
}

/* ---------- Location Search Modal ---------- */
.location-search-group {
    position: relative;
}

.location-input-wrap {
    display: flex;
    align-items: center;
    gap: 0;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    overflow: hidden;
    transition: var(--transition);
}

.location-input-wrap:focus-within {
    border-color: var(--accent);
    box-shadow: 0 0 0 3px var(--accent-glow);
}

.location-search-icon {
    padding: 0 0 0 12px;
    color: var(--text-muted);
    font-size: 0.78rem;
}

.location-input {
    flex: 1;
    border: none !important;
    background: transparent !important;
    padding: 10px !important;
    box-shadow: none !important;
}

.location-input:focus {
    box-shadow: none !important;
}

.location-results {
    position: absolute;
    top: calc(100% + 4px);
    left: 0;
    right: 0;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-lg);
    max-height: 220px;
    overflow-y: auto;
    display: none;
    z-index: 10;
}

.location-results.active {
    display: block;
    animation: fadeIn 0.15s ease;
}

.location-result-item {
    padding: 10px 12px;
    cursor: pointer;
    transition: var(--transition-fast);
    border-bottom: 1px solid var(--border);
    display: flex;
    align-items: center;
    gap: 8px;
}

.location-result-item:last-child {
    border-bottom: none;
}

.location-result-item:hover {
    background: var(--accent-surface);
}

.location-result-item i {
    color: var(--accent-light);
    font-size: 0.75rem;
    flex-shrink: 0;
}

.loc-result-main {
    font-weight: 600;
    font-size: 0.82rem;
}

.loc-result-sub {
    font-size: 0.68rem;
    color: var(--text-muted);
}

.location-no-result {
    padding: 14px;
    text-align: center;
    color: var(--text-muted);
    font-size: 0.82rem;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 6px;
}

.location-preview {
    display: flex;
    align-items: center;
    gap: 6px;
    margin-top: 6px;
    padding: 6px 10px;
    background: var(--green-surface);
    border-radius: var(--radius-xs);
    font-size: 0.78rem;
    color: var(--green);
}

.location-preview i {
    font-size: 0.7rem;
}

.location-preview span {
    flex: 1;
    font-weight: 500;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.btn-clear-location {
    background: none;
    border: none;
    color: var(--text-muted);
    cursor: pointer;
    font-size: 0.7rem;
    padding: 2px;
    transition: var(--transition);
}

.btn-clear-location:hover {
    color: var(--red);
}

/* ---------- Modal ---------- */
.modal-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.65);
    /* Increased opacity slightly to compensate for lack of blur */
    z-index: 2000;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 16px;
    animation: fadeIn 0.15s ease;
}

.modal {
    background: var(--bg-secondary);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    width: 100%;
    max-width: 440px;
    max-height: 90vh;
    display: flex;
    flex-direction: column;
    box-shadow: var(--shadow-lg);
    animation: modalIn 0.25s ease-out;
    will-change: transform, opacity;
}

@keyframes modalIn {
    from {
        opacity: 0;
        transform: scale(0.92) translateY(15px);
    }

    to {
        opacity: 1;
        transform: scale(1) translateY(0);
    }
}

.modal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 14px 16px;
    border-bottom: 1px solid var(--border);
    flex-shrink: 0;
}

.modal-header h3 {
    font-family: 'Outfit', sans-serif;
    font-size: 1rem;
    font-weight: 700;
    display: flex;
    align-items: center;
    gap: 6px;
}

.modal-header h3 i {
    color: var(--accent-light);
}

.modal-body {
    padding: 16px;
    display: flex;
    flex-direction: column;
    gap: 12px;
    overflow-y: auto;
    flex: 1;
    -webkit-overflow-scrolling: touch;
}

.modal-footer {
    display: flex;
    justify-content: flex-end;
    gap: 8px;
    padding: 12px 16px;
    border-top: 1px solid var(--border);
    flex-shrink: 0;
}

/* ---------- Toast ---------- */
.toast-container {
    position: fixed;
    top: calc(var(--header-height) + 10px);
    right: 10px;
    z-index: 3000;
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.toast {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 10px 14px;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-lg);
    font-size: 0.82rem;
    font-weight: 500;
    min-width: 220px;
    max-width: 340px;
    animation: toastIn 0.4s var(--transition-spring);
}

@keyframes toastIn {
    from {
        opacity: 0;
        transform: translateX(30px);
    }

    to {
        opacity: 1;
        transform: translateX(0);
    }
}

.toast.toast-out {
    animation: toastOut 0.3s ease forwards;
}

@keyframes toastOut {
    to {
        opacity: 0;
        transform: translateX(30px);
    }
}

.toast-success {
    border-left: 3px solid var(--green);
}

.toast-success i {
    color: var(--green);
}

.toast-error {
    border-left: 3px solid var(--red);
}

.toast-error i {
    color: var(--red);
}

.toast-info {
    border-left: 3px solid var(--accent);
}

.toast-info i {
    color: var(--accent-light);
}

/* ---------- Spinner ---------- */
.spinner {
    width: 18px;
    height: 18px;
    border: 2px solid rgba(255, 255, 255, 0.2);
    border-top-color: white;
    border-radius: 50%;
    animation: spin 0.6s linear infinite;
}

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




.trip-card-map::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    height: 35px;
    background: linear-gradient(transparent, var(--bg-card));
    pointer-events: none;
}

.trip-card-body {
    padding: 14px 16px;
}

.trip-card-title {
    font-family: 'Outfit', sans-serif;
    font-size: 1rem;
    font-weight: 700;
    margin-bottom: 4px;
}

.trip-card-dates {
    display: flex;
    align-items: center;
    gap: 5px;
    font-size: 0.75rem;
    color: var(--text-secondary);
    margin-bottom: 8px;
}

.trip-card-dates i {
    color: var(--accent-light);
}

.trip-card-stats {
    display: flex;
    gap: 12px;
}

.trip-card-stat {
    display: flex;
    align-items: center;
    gap: 3px;
    font-size: 0.72rem;
    color: var(--text-muted);
}

.trip-card-stat i {
    color: var(--accent-light);
    font-size: 0.65rem;
}

.trip-card-footer {
    display: flex;
    justify-content: flex-end;
    gap: 6px;
    padding: 10px 16px;
    border-top: 1px solid var(--border);
}

.trip-card-footer .btn {
    padding: 6px 12px;
    font-size: 0.76rem;
}

.empty-state {
    text-align: center;
    padding: 60px 16px;
    grid-column: 1 / -1;
}

.empty-state-icon {
    font-size: 3rem;
    margin-bottom: 14px;
    opacity: 0.3;
}

.empty-state-title {
    font-family: 'Outfit', sans-serif;
    font-size: 1.3rem;
    font-weight: 700;
    margin-bottom: 6px;
    color: var(--text-secondary);
}

.empty-state-text {
    color: var(--text-muted);
    max-width: 340px;
    margin: 0 auto 16px;
    font-size: 0.88rem;
}

/* ========================================
   RESPONSIVE
   ======================================== */
@media (max-width: 768px) {
    :root {
        --header-height: 50px;
        --sidebar-width: 100%;
    }

    .nav-link span {
        display: none;
    }

    .nav-link {
        padding: 8px 10px;
    }

    .logo {
        font-size: 1.05rem;
    }

    .logo-icon-wrap {
        width: 28px;
        height: 28px;
        font-size: 0.75rem;
    }

    .create-panel {
        padding: 16px;
        align-items: flex-start;
        padding-top: 24px;
    }

    .create-panel-inner {
        max-width: 100%;
    }

    .create-hero {
        margin-bottom: 24px;
    }

    .create-title {
        font-size: 1.4rem;
    }

    .create-subtitle {
        font-size: 0.82rem;
    }

    .form-row-2 {
        flex-direction: column;
        gap: 10px;
    }

    .form-input-lg {
        font-size: 0.92rem;
        padding: 11px 14px;
    }

    .planner {
        flex-direction: column;
    }

    .agenda-sidebar {
        width: 100%;
        min-width: unset;
        max-height: 45vh;
        border-right: none;
        border-top: 1px solid var(--border);
        order: 2;
        position: relative;
        transition: max-height 0.35s ease;
    }

    .agenda-sidebar.collapsed {
        max-height: 0;
        overflow: hidden;
        border-top: none;
    }

    .agenda-drag-handle {
        display: flex;
        justify-content: center;
        padding: 8px 0 2px;
        cursor: pointer;
        touch-action: manipulation;
    }

    .drag-bar {
        width: 36px;
        height: 4px;
        background: var(--text-muted);
        border-radius: 4px;
        opacity: 0.4;
    }

    .map-container {
        flex: 1;
        min-height: 0;
        order: 1;
    }

    .map-overlay-top {
        width: calc(100% - 60px);
    }

    .map-stats {
        flex-direction: column;
        bottom: auto;
        top: 58px;
        right: 8px;
    }

    .layer-trigger span {
        display: none;
    }

    .layer-trigger {
        padding: 8px 10px;
    }

    .modal-overlay {
        align-items: flex-end;
        padding: 0;
    }

    .modal {
        max-width: 100%;
        border-radius: var(--radius-lg) var(--radius-lg) 0 0;
        max-height: 88vh;
    }

    .activity-actions {
        opacity: 1;
    }

    .lodging-actions {
        opacity: 1;
    }

    .activity-drag-handle {
        opacity: 1;
    }

    .btn {
        padding: 10px 16px;
    }

    .btn-icon {
        width: 36px;
        height: 36px;
        min-width: 36px;
    }

    .trips-grid {
        grid-template-columns: 1fr;
    }

    .trips-page-title {
        font-size: 1.4rem;
    }

    .toast-container {
        left: 10px;
        right: 10px;
    }

    .toast {
        min-width: unset;
        width: 100%;
    }

    .timeline-container {
        padding-left: 8px;
    }

    .timeline-time {
        width: 30px;
        font-size: 0.65rem;
    }

    .btn-add-day-activity {
        margin-left: 50px;
    }

    .poi-categories {
        gap: 3px;
    }

    .poi-cat {
        font-size: 0.65rem;
        padding: 4px 8px;
    }
}

/* View Switcher (Floating Bottom) */
.view-switcher {
    position: fixed;
    bottom: 24px;
    left: 50%;
    transform: translateX(-50%);
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-full);
    padding: 4px;
    display: flex;
    gap: 4px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.2);
    z-index: 1000;
}

.view-switch-btn {
    padding: 8px 16px;
    border-radius: var(--radius-full);
    border: none;
    background: transparent;
    color: var(--text-muted);
    font-weight: 600;
    font-size: 0.85rem;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 8px;
    transition: var(--transition);
    text-decoration: none;
}

.view-switch-btn:hover {
    background: var(--text-primary);
    color: var(--bg-primary);
    opacity: 0.8;
}

.view-switch-btn.active {
    background: var(--text-primary);
    color: var(--bg-primary);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

/* Pick Mode Overlay */
.mode-picking .view-switcher {
    display: none;
}

.pick-overlay {
    position: fixed;
    top: 80px;
    left: 50%;
    transform: translateX(-50%);
    background: var(--bg-card);
    border: 1px solid var(--border);
    padding: 10px 16px;
    border-radius: var(--radius-full);
    display: flex;
    align-items: center;
    gap: 12px;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2);
    z-index: 2000;
    font-weight: 600;
    animation: fadeIn 0.3s ease;
}

.pick-message {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 0.9rem;
}

@media (max-width: 768px) {
    .view-switcher {
        bottom: 16px;
        padding: 3px;
        gap: 2px;
    }

    .view-switch-btn {
        padding: 7px 12px;
        font-size: 0.78rem;
        gap: 5px;
    }

    .pick-overlay {
        top: 65px;
        padding: 8px 12px;
        font-size: 0.8rem;
    }

    .pick-message {
        font-size: 0.78rem;
    }
}

@media (max-width: 380px) {
    .map-overlay-top {
        width: calc(100% - 24px);
    }

    .form-input {
        padding: 9px 10px;
        font-size: 0.82rem;
    }

    .modal-body {
        padding: 12px;
        gap: 10px;
    }

    .view-switch-btn span {
        display: none;
        /* Icons only on very small screens */
    }

    .view-switch-btn {
        padding: 8px 14px;
    }
}

/* ========================================
   Mobile Map Enhancements
   ======================================== */
@media (max-width: 768px) {

    /* 1. Map Controls Position */
    /* Compact Top Left for Layers */
    .map-layer-control {
        bottom: auto;
        top: 60px;
        left: 10px;
        z-index: 850;
    }

    .layer-trigger {
        padding: 0;
        width: 36px;
        height: 36px;
        justify-content: center;
    }

    .layer-trigger span {
        display: none;
    }

    .layer-trigger i {
        font-size: 1rem;
        margin: 0;
    }

    .layer-menu {
        bottom: auto;
        top: 0;
        left: 42px;
        /* Open to the right */
        transform-origin: top left;
    }

    /* 3D Toggle Position (Below Layers) */
    .map-3d-toggle {
        bottom: auto;
        top: 106px;
        left: 10px;
        right: auto;
    }

    .btn-3d {
        padding: 0;
        width: 36px;
        height: 36px;
        justify-content: center;
    }

    .btn-3d span {
        display: none;
    }

    .btn-3d i {
        font-size: 1rem;
        margin: 0;
    }

    /* 2. Search Bar */
    .map-overlay-top {
        top: 10px;
        width: calc(100% - 20px);
        max-width: 320px;
        left: 50%;
        transform: translateX(-50%);
    }

    .search-bar {
        padding: 0 10px;
        height: 40px;
    }

    .search-input {
        font-size: 0.8rem;
    }

    /* 3. Stats Panel (Top Right Compact) */
    .map-stats {
        bottom: auto;
        top: 60px;
        right: 10px;
        flex-direction: column;
        gap: 6px;
        align-items: flex-end;
    }

    .stat-item {
        background: rgba(255, 255, 255, 0.95);
        color: #333;
        /* Dark text for contrast */
        padding: 6px 10px;
        font-size: 0.7rem;
        box-shadow: 0 2px 5px rgba(0, 0, 0, 0.15);
        border: 1px solid rgba(0, 0, 0, 0.1);
    }

    .stat-item i {
        color: var(--accent);
        /* Enhance icon visibility */
    }

    /* 4. Trip Badge (Bottom Center above Switcher) */
    .map-trip-badge {
        top: auto;
        bottom: 80px;
        padding: 4px 12px;
        font-size: 0.75rem;
    }

    /* 5. View Switcher */
    .view-switcher {
        bottom: 20px;
        padding: 4px;
        background: rgba(255, 255, 255, 0.95);
        backdrop-filter: blur(10px);
        box-shadow: 0 4px 25px rgba(0, 0, 0, 0.15);
    }

    .view-switch-btn {
        padding: 8px 16px;
    }

    /* Navigation Controls (Zoom) */
    .maplibregl-ctrl-top-right {
        top: 50%;
        transform: translateY(-50%);
        right: 4px !important;
    }

    .maplibregl-ctrl-group {
        margin: 0 0 10px 0 !important;
        opacity: 0.9;
    }
}

/* Common Fixes for Desktop Overlaps */
@media (min-width: 769px) {
    .map-stats {
        bottom: 30px;
        right: 90px;
        /* Avoid overlap with Attribution/Zoom if bottom-right */
        z-index: 800;
        background: transparent;
        gap: 10px;
    }

    .stat-item {
        background: white;
        color: #333;
        border: 1px solid var(--border);
        box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    }

    /* Ensure layer control doesn't cover search or badge */
    .map-layer-control {
        bottom: 30px;
        left: 20px;
        top: auto;
    }

    .map-3d-toggle {
        bottom: 30px;
        left: 100px;
        /* Next to layer control */
        right: auto;
        top: auto;
    }

    /* Search Bar Positioning */
    .map-overlay-top {
        top: 20px;
        left: 50%;
        transform: translateX(-50%);
        z-index: 900;
    }
}