:root {
    --overlay-width: 420px;
    --primary: #4f7df2;
    --primary-muted: #e3ecff;
    --slate-light: #f6f7fb;
    --text-default: #0f172a;
    --app-transition: 260ms ease;
    --app-fade: 340ms ease;
    --app-height: 100vh;
    --safe-top: var(--safe-area-inset-top, env(safe-area-inset-top, 0px));
    --safe-right: var(--safe-area-inset-right, env(safe-area-inset-right, 0px));
    --safe-bottom: var(--safe-area-inset-bottom, env(safe-area-inset-bottom, 0px));
    --safe-left: var(--safe-area-inset-left, env(safe-area-inset-left, 0px));
    --header-height: 96px;
    --footer-height: 120px;
}

html, body {
    min-height: var(--app-height);
    height: var(--app-height);
}

/* Force Tailwind's min-h-screen utility to respect the dynamic viewport height on mobile */
.min-h-screen {
    min-height: var(--app-height) !important;
}

body {
    font-family: 'Inter', sans-serif;
    background-color: #e9eef6;
	
	/* Apple iOS Rand*/
	padding-top: var(--safe-top);
    padding-bottom: var(--safe-bottom);
    background: #2f5ca5;
    overscroll-behavior: none;
    overflow-x: hidden;
}

body:not(.admin-page).app-animate {
    transition: opacity var(--app-fade), transform var(--app-fade);
}

body:not(.admin-page).app-animate.app-leave {
    opacity: 0;
    transform: translateY(8px);
}

body:not(.admin-page).app-animate.app-ready {
    opacity: 1;
    transform: translateY(0);
}

/* --- Global page section stagger fade-in --- */
/* Direct <section> children of .app-main fade in with a subtle stagger
   on initial page load. Prevents the "pop" effect when content arrives. */
body:not(.admin-page).app-animate.app-ready .app-main > section,
body:not(.admin-page).app-animate.app-ready .app-main > div:not(#app-header):not(#app-footer) {
    animation: pageSectionEnter 0.5s cubic-bezier(0.22, 0.61, 0.36, 1) both;
}

body:not(.admin-page).app-animate.app-ready .app-main > section:nth-child(1),
body:not(.admin-page).app-animate.app-ready .app-main > div:nth-child(1) { animation-delay: 60ms; }
body:not(.admin-page).app-animate.app-ready .app-main > section:nth-child(2),
body:not(.admin-page).app-animate.app-ready .app-main > div:nth-child(2) { animation-delay: 130ms; }
body:not(.admin-page).app-animate.app-ready .app-main > section:nth-child(3),
body:not(.admin-page).app-animate.app-ready .app-main > div:nth-child(3) { animation-delay: 200ms; }
body:not(.admin-page).app-animate.app-ready .app-main > section:nth-child(4),
body:not(.admin-page).app-animate.app-ready .app-main > div:nth-child(4) { animation-delay: 270ms; }
body:not(.admin-page).app-animate.app-ready .app-main > section:nth-child(5),
body:not(.admin-page).app-animate.app-ready .app-main > div:nth-child(5) { animation-delay: 340ms; }
body:not(.admin-page).app-animate.app-ready .app-main > section:nth-child(n+6),
body:not(.admin-page).app-animate.app-ready .app-main > div:nth-child(n+6) { animation-delay: 410ms; }

@keyframes pageSectionEnter {
    from {
        opacity: 0;
        transform: translateY(10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* --- Subtle fade-in for dynamically-loaded list items --- */
/* Applies to common lists that get populated by fetch (transactions, reviews, search results).
   Each item fades up gently. Lighter than the section stagger. */
#wallet-transaction-list > *,
#wallet-all-transactions-list > *,
#review-list > *,
.app-main .ticket-card {
    animation: itemFadeIn 0.36s cubic-bezier(0.22, 0.61, 0.36, 1) both;
}

@keyframes itemFadeIn {
    from {
        opacity: 0;
        transform: translateY(6px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* --- Skeleton pulse for empty states (while data loads) --- */
.skeleton-pulse {
    background: linear-gradient(90deg, #f1f5f9 0%, #e2e8f0 50%, #f1f5f9 100%);
    background-size: 200% 100%;
    border-radius: 12px;
    animation: skeletonPulse 1.4s ease-in-out infinite;
}

@keyframes skeletonPulse {
    0% { background-position: 200% 0; }
    100% { background-position: -200% 0; }
}

/* Modals get a subtle scale-in instead of just popping */
.wallet-modal:not(.hidden) .wallet-modal__panel {
    animation: modalEnter 0.32s cubic-bezier(0.34, 1.56, 0.64, 1) both;
}

@keyframes modalEnter {
    from {
        opacity: 0;
        transform: translateY(20px) scale(0.96);
    }
    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

.app-shell-header {
    top: 0;
    padding-top: calc(var(--safe-top) + 0.85rem);
    padding-left: calc(1.25rem + var(--safe-left));
    padding-right: calc(1.25rem + var(--safe-right));
    padding-bottom: 0.75rem;
    min-height: calc(var(--safe-top) + var(--header-height));
    border-radius: 0 0 22px 22px;
    background: #fff;
    overflow: hidden;
}

.app-shell-header::before {
    content: '';
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    height: calc(var(--safe-top) + var(--header-height));
    z-index: -1;
}

.home-page .app-shell-header {
    background: transparent;
    box-shadow: none;
}

.home-page .app-shell-header::before {
    display: none;
}

.app-header-slot {
    margin-top: 0.75rem;
}

body.home-page {
    background-color: #dfe6f3;
}

body.booking-page,
body.profile-page,
body.wallet-page {
    background-color: #e9eef6;
}

body.modal-open {
    overflow: hidden;
}

.wallet-modal {
    position: fixed;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(15, 23, 42, 0.35);
    z-index: 60;
    transition: opacity var(--app-transition);
}

.wallet-modal.hidden {
    display: none;
}

.wallet-modal__backdrop {
    position: absolute;
    inset: 0;
}

.wallet-modal__panel {
    position: relative;
    width: min(430px, calc(100vw - 24px));
    max-height: calc(100vh - 120px);
    margin: 0 auto;
    background: #ffffff;
    border-radius: 28px;
    padding: 1.25rem 1.25rem 1.5rem;
    box-shadow: 0 -10px 30px rgba(15, 23, 42, 0.12);
    overflow-y: auto;
    opacity: 0;
    transform: translateY(12px);
    transition: opacity var(--app-transition), transform var(--app-transition);
}

.wallet-modal.active .wallet-modal__panel {
    opacity: 1;
    transform: translateY(0);
}

.wallet-modal__header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    margin-bottom: 1rem;
}

.wallet-modal__header h3 {
    font-size: 1.1rem;
    font-weight: 700;
    color: #0f172a;
}

.wallet-modal__eyebrow {
    text-transform: uppercase;
    letter-spacing: 0.3em;
    font-size: 0.7rem;
    color: #94a3b8;
    font-weight: 600;
    margin-bottom: 0.2rem;
}

.wallet-modal__close {
    width: 38px;
    height: 38px;
    border-radius: 999px;
    border: none;
    background: #ef4444;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    color: #ffffff;
    cursor: pointer;
    transition: background 0.2s ease, color 0.2s ease;
}

.wallet-modal__close:hover {
    background: #dc2626;
    color: #ffffff;
}

#map {
    height: 100%;
    width: 100%;
    opacity: 1;
}

.leaflet-control-attribution.leaflet-control {
    display: none;
}

body.home-page .app-shell-header {
    background-color: transparent;
    box-shadow: none;
}

body.home-page #app-header-slot {
    margin-top: 1.25rem;
}

.booking-tabs {
    position: relative;
    display: grid;
    grid-template-columns: 1fr 1fr;
    background: #ffffff;
    border: 1px solid #e4e9f5;
    border-radius: 9999px;
    padding: 5px;
    height: 58px;
    isolation: isolate;
}

.booking-tabs::before {
    content: '';
    position: absolute;
    top: 5px;
    bottom: 5px;
    left: 5px;
    width: calc(50% - 5px);
    background: #183873;
    border-radius: 9999px;
    box-shadow: 0 10px 22px rgba(24, 56, 115, 0.28);
    transform: translateX(0);
    transition: transform 0.42s cubic-bezier(0.65, 0, 0.35, 1);
    z-index: 0;
}

.booking-tabs[data-active-tab="offers"]::before {
    transform: translateX(100%);
}

.booking-tab {
    position: relative;
    z-index: 1;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    height: 100%;
    border-radius: 9999px;
    border: none;
    background: transparent;
    color: #64748b;
    font-weight: 600;
    font-size: 0.9rem;
    cursor: pointer;
    transition: color 0.32s ease;
}

.booking-tab i {
    font-size: 1.15rem;
    color: #4f7cff;
    transition: color 0.32s ease, transform 0.32s ease;
}

.booking-tab:not(.is-active):hover {
    color: #183873;
}

.booking-tab.is-active {
    color: #ffffff;
}

.booking-tab.is-active i {
    color: #ffffff;
    transform: scale(1.05);
}

/* --- Pane fade & card stagger animation --- */

[data-booking-pane] {
    transition: opacity 0.28s ease;
}

[data-booking-pane].is-entering {
    animation: paneFadeIn 0.36s ease both;
}

[data-booking-pane].is-entering .ticket-card {
    animation: ticketEnter 0.42s cubic-bezier(0.22, 0.61, 0.36, 1) both;
}

[data-booking-pane].is-entering .ticket-card:nth-child(1) { animation-delay: 40ms; }
[data-booking-pane].is-entering .ticket-card:nth-child(2) { animation-delay: 100ms; }
[data-booking-pane].is-entering .ticket-card:nth-child(3) { animation-delay: 160ms; }
[data-booking-pane].is-entering .ticket-card:nth-child(4) { animation-delay: 220ms; }
[data-booking-pane].is-entering .ticket-card:nth-child(5) { animation-delay: 280ms; }
[data-booking-pane].is-entering .ticket-card:nth-child(n+6) { animation-delay: 340ms; }

@keyframes paneFadeIn {
    from {
        opacity: 0;
        transform: translateY(6px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes ticketEnter {
    from {
        opacity: 0;
        transform: translateY(14px) scale(0.97);
    }
    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

/* --- Pagination --- */

.pagination {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 6px;
    flex-wrap: wrap;
    margin-top: 1rem;
}

.pagination:empty {
    display: none;
}

.pagination-btn {
    min-width: 38px;
    height: 38px;
    padding: 0 0.65rem;
    border-radius: 9999px;
    border: 1px solid #e4e9f5;
    background: #ffffff;
    color: #475569;
    font-weight: 600;
    font-size: 0.875rem;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    transition: background 0.18s ease, color 0.18s ease, border-color 0.18s ease, box-shadow 0.18s ease, transform 0.12s ease;
}

.pagination-btn i {
    font-size: 1.05rem;
}

.pagination-btn:hover:not(:disabled):not(.is-active) {
    border-color: #183873;
    color: #183873;
    background: #f3f6ff;
}

.pagination-btn:not(:disabled):active {
    transform: translateY(1px);
}

.pagination-btn.is-active {
    background: #183873;
    color: #ffffff;
    border-color: #183873;
    box-shadow: 0 8px 18px rgba(24, 56, 115, 0.28);
}

.pagination-btn:disabled {
    opacity: 0.4;
    cursor: not-allowed;
}

.pagination-ellipsis {
    color: #94a3b8;
    font-weight: 700;
    padding: 0 0.25rem;
    user-select: none;
}

.ticket-card {
    position: relative;
    overflow: hidden;
    border-radius: 20px;
    border: 1px solid #e2e8f0;
    background: linear-gradient(180deg, #ffffff 0%, #f8fbff 100%);
    box-shadow: 0 14px 30px rgba(15, 23, 42, 0.05);
    padding: 14px;
    display: flex;
    flex-direction: column;
    gap: 10px;
    transition: box-shadow var(--app-transition), transform var(--app-transition);
}

.ticket-card::before,
.ticket-card::after {
    content: '';
    position: absolute;
    width: 22px;
    height: 22px;
    border-radius: 50%;
    background: #e9eef6;
    top: 55%;
    transform: translateY(-50%);
    box-shadow: inset 0 0 0 1px #e2e8f0;
}

.ticket-card::before {
    left: -11px;
}

.ticket-card::after {
    right: -11px;
}

.ticket-card--parking {
    background: linear-gradient(135deg, #ffffff 0%, #f0f6ff 100%);
}

.ticket-card--tip {
    background: linear-gradient(135deg, #ffffff 0%, #f9fafb 100%);
}

.ticket-card--offer {
    padding: 18px;
    gap: 14px;
}

.ticket-card--offer .ticket-card__top {
    gap: 16px;
}

.ticket-card--offer .ticket-card__title {
    margin-top: 2px;
}

.ticket-card--offer .ticket-card__subtitle {
    margin-top: 6px;
}

.ticket-card--offer .ticket-card__actions {
    margin-top: 2px;
}

/* --- Offer edit modal selects (native <select> styled like price-picker) --- */
.offer-edit-select {
    cursor: pointer;
    overflow: hidden;
}

.offer-edit-select select {
    appearance: none;
    -webkit-appearance: none;
    -moz-appearance: none;
    background: transparent;
    border: none;
    outline: none;
    flex: 1;
    min-width: 0;
    max-width: 100%;
    font-weight: 700;
    font-size: 0.9rem;
    color: #0f172a;
    cursor: pointer;
    padding-right: 0;
    text-overflow: ellipsis;
    overflow: hidden;
    white-space: nowrap;
}

.offer-edit-select .offer-edit-select__chev {
    color: #94a3b8;
    font-size: 1rem;
    flex-shrink: 0;
    pointer-events: none;
    transition: transform 0.2s ease;
}

.offer-edit-select:focus-within .offer-edit-select__chev {
    transform: rotate(180deg);
    color: #183873;
}

.ticket-card__top {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 12px;
}

.ticket-card__eyebrow {
    font-size: 0.62rem;
    text-transform: uppercase;
    letter-spacing: 0.3em;
    color: #94a3b8;
    margin-bottom: 4px;
    font-weight: 700;
}

.ticket-card__title {
    font-size: 0.95rem;
    font-weight: 700;
    color: #0f172a;
    line-height: 1.3;
}

.ticket-card__subtitle {
    font-size: 0.8rem;
    color: #64748b;
}

.ticket-card__badge-stack {
    display: flex;
    flex-direction: column;
    gap: 8px;
    align-items: flex-end;
}

.ticket-card__price {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 6px 10px;
    border-radius: 999px;
    background: #e8f0ff;
    border: 1px solid #c7dcff;
    color: #1d4ed8;
    font-weight: 700;
    font-size: 0.8rem;
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.9);
}

.ticket-card__status {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 6px 10px;
    border-radius: 999px;
}

.ticket-card__divider {
    position: relative;
    height: 12px;
    margin: -2px 0 4px;
}

.ticket-card__divider::after {
    content: '';
    position: absolute;
    inset: 0;
    background-image: linear-gradient(90deg, #cbd5e1 33%, rgba(255, 255, 255, 0) 0);
    background-position: bottom;
    background-size: 16px 2px;
    background-repeat: repeat-x;
    opacity: 0.9;
}

.ticket-card__actions .action-btn {
    border-radius: 14px;
}

.parking-offer-marker {
    position: relative;
    width: 52px;
    height: 70px;
}

.parking-offer-marker__pin {
    width: 52px;
    height: 52px;
    border-radius: 50%;
    background: #1f4ed8;
    display: flex;
    justify-content: center;
    align-items: center;
    color: #fff;
    font-weight: 700;
    font-size: 24px;
    position: relative;
    z-index: 2;
}

.parking-offer-marker__pin::after {
    content: '';
    position: absolute;
    bottom: -13px;
    left: 50%;
    transform: translateX(-50%);
    width: 0;
    height: 0;
    border-left: 12px solid transparent;
    border-right: 12px solid transparent;
    border-top: 18px solid #1f4ed8;
    z-index: 1;
}

.parking-offer-marker__pin span {
    width: 35px;
    height: 35px;
    border-radius: 50%;
    background: #fff;
    color: #1f4ed8;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.25rem;
    font-weight: 800;
    letter-spacing: -0.1em;
    padding-top: 4px;
    box-shadow: inset 0 2px 6px rgba(0, 0, 0, 0.15);
}

.glass {
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
}

.glass-strong {
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
}

.toggle:checked ~ .dot {
    transform: translateX(100%);
    background-color: #315ca7;
}

.search-overlay {
    position: fixed;
    inset: 0;
    padding: 1.25rem 1rem 1.5rem;
    display: flex;
    justify-content: center;
    align-items: center;
    background: rgba(7, 15, 33, 0.7);
    backdrop-filter: blur(12px);
    z-index: 70;
    opacity: 0;
    transform: translateY(12px);
    transition: opacity var(--app-transition), transform var(--app-transition);
    pointer-events: none;
}

.search-overlay.active {
    opacity: 1;
    transform: translateY(0);
    pointer-events: auto;
}

.search-overlay__panel {
    width: 100%;
    max-width: var(--overlay-width);
    background: rgba(249, 250, 255, 0.95);
    border-radius: 30px;
    padding: 1.25rem;
    box-shadow: 0 25px 50px rgba(15, 23, 42, 0.25);
    color: var(--text-default);
    transform: translateY(6px);
    opacity: 0;
    transition: opacity var(--app-transition), transform var(--app-transition);
}

.search-overlay.active .search-overlay__panel {
    opacity: 1;
    transform: translateY(0);
}

.search-overlay__status {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 0.75rem;
    color: #94a3b8;
    margin-bottom: 0.75rem;
}

.search-overlay__status i {
    font-size: 1rem;
    margin-left: 0.25rem;
}

.search-overlay__bar {
    display: flex;
    align-items: center;
    gap: 0.65rem;
    padding: 0.75rem 1rem;
    background: #fff;
    border-radius: 1.5rem;
    box-shadow: inset 0 1px 2px rgba(15, 23, 42, 0.05);
    position: relative;
    margin-top: 25px;
}

.search-overlay__bar button {
    color: var(--primary);
}

.search-overlay__close {
    position: absolute;
    top: -30px;
    right: -30px;
    width: 48px;
    height: 48px;
    border-radius: 9999px;
    background: #f05151;
    color: #fff !important;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 15px 30px rgba(240, 81, 81, 0.35);
    margin-top: -25px;
}

.search-overlay__suggestions {
    margin-top: 1.25rem;
    padding: 1rem;
    background: #fff;
    border-radius: 22px;
    box-shadow: inset 0 1px 1px rgba(15, 23, 42, 0.04);
}

.search-overlay__suggestions-header {
    display: flex;
    justify-content: space-between;
    align-items: baseline;
    margin-bottom: 0.75rem;
}

.search-suggestions {
    list-style: none;
    margin: 0;
    padding: 0;
    max-height: 300px;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    gap: 0.55rem;
}

.search-suggestion {
    padding: 0;
}

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

.search-suggestion__button {
    display: flex;
    align-items: flex-start;
    gap: 0.65rem;
    width: 100%;
    background: #ffffff;
    border: 1px solid #e2e8f0;
    border-radius: 16px;
    padding: 0.8rem 0.9rem 1.1rem 0.9rem;
    text-align: left;
    cursor: pointer;
    transition: border-color 0.15s ease;
    position: relative;
}

.search-suggestion__content {
    display: flex;
    align-items: flex-start;
    gap: 0.65rem;
    flex: 1;
}

.search-suggestion__icon {
    color: #0f172a;
    font-size: 1.15rem;
    margin-top: 0.2rem;
    width: 2.5rem;
    height: 2.5rem;
    border-radius: 12px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, #d9e6ff, #eef2ff);
}

.search-suggestion__distance {
    font-weight: 700;
    font-size: 0.9rem;
    color: #0f172a;
    background: #e0ecff;
    border: 1px solid #cbd5e1;
}

.search-suggestion__texts {
    flex: 1;
}

.search-suggestion__label {
    font-weight: 600;
    color: #0f172a;
    display: block;
    margin-bottom: 0.15rem;
}

.search-suggestion__meta {
    display: inline-flex;
    align-items: center;
    gap: 0.3rem;
    font-size: 0.82rem;
    color: #475569;
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    padding: 0.15rem 0.55rem;
    border-radius: 999px;
    margin-right: 0.35rem;
    margin-bottom: 0.3rem;
}

.search-suggestion__meta:last-child {
    margin-right: 0;
}

.search-suggestion__actions {
    display: flex;
    align-items: center;
    gap: 0.4rem;
    margin-left: auto;
}

.search-suggestion__action-btn {
    width: 34px;
    height: 34px;
    border-radius: 12px;
    border: 1px solid #e2e8f0;
    background: #f8fafc;
    color: #475569;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    transition: background 0.2s ease, color 0.2s ease, border-color 0.2s ease;
}

.search-suggestion__action-btn--full {
    width: 42px;
    height: 42px;
    border-radius: 50%;
    background: #ffffff;
    color: #2563eb;
    border: 2px solid #2563eb;
    position: absolute;
    right: 0.9rem;
    bottom: 0.6rem;
}

.search-suggestion__action-btn--full:hover {
    background: #ffffff;
    color: #1d4ed8;
    border-color: #1d4ed8;
}

/* Nearby overlay cards */
.search-suggestion__button.nearby-card {
    align-items: stretch;
    gap: 0.6rem;
    padding: 1rem;
    border-color: #d7e3ff;
    background: linear-gradient(135deg, #f9fbff 0%, #ffffff 100%);
    box-shadow: 0 14px 30px rgba(49, 92, 167, 0.08);
}

.nearby-card .search-suggestion__content {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: stretch;
    gap: 0.35rem;
}

.nearby-card .search-suggestion__label {
    font-size: 1rem;
    font-weight: 700;
    color: #0f172a;
}

.nearby-card .nearby-header {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.nearby-card .nearby-meta {
    display: flex;
    align-items: center;
    gap: 0.35rem;
    font-size: 0.85rem;
}

.nearby-card .search-suggestion__meta {
    background: #eef3ff;
    border-color: #d7e3ff;
    color: #1d4ed8;
    font-weight: 700;
    padding: 0.25rem 0.55rem;
    border-radius: 999px;
}

.nearby-card .nearby-distance {
    background: #f4f7ff;
    border-color: #d7e3ff;
    color: #1d4ed8;
}

.nearby-card .search-suggestion__action-btn--full {
    position: static;
    margin-left: auto;
    align-self: flex-end;
    width: 42px;
    height: 42px;
    border-radius: 14px;
    background: #eff4ff;
    color: #1d4ed8;
    border: 2px solid #c7dcff;
    box-shadow: 0 10px 18px rgba(49, 92, 167, 0.15);
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.nearby-card .search-suggestion__action-btn--full:hover {
    transform: translateY(-1px);
    box-shadow: 0 12px 22px rgba(49, 92, 167, 0.18);
}

.search-suggestion__action-btn:hover {
    background: #e2e8f0;
    color: var(--primary);
    transform: translateY(-1px);
}

.search-overlay__filter-button {
    margin-top: 1.25rem;
    width: 100%;
    background: var(--primary);
    color: #fff;
    border-radius: 999px;
    padding: 0.85rem;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    justify-content: center;
    box-shadow: 0 12px 25px rgba(79, 125, 242, 0.4);
}

.filter-modal {
    position: fixed;
    inset: 0;
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 80;
    pointer-events: none;
    opacity: 0;
    transition: opacity var(--app-transition);
}

.filter-modal.active {
    pointer-events: auto;
    opacity: 1;
}

.filter-modal__backdrop {
    position: absolute;
    inset: 0;
    background: rgba(12, 20, 41, 0.6);
    backdrop-filter: blur(8px);
}

.filter-modal__panel {
    position: relative;
    width: 92%;
    max-width: var(--overlay-width);
    background: #fff;
    border-radius: 30px;
    padding: 1.5rem;
    box-shadow: 0 25px 60px rgba(15, 23, 42, 0.35);
    max-height: calc(100vh - 3rem);
    overflow-y: auto;
    transform: translateY(10px);
    opacity: 0;
    transition: opacity var(--app-transition), transform var(--app-transition);
}

.filter-modal.active .filter-modal__panel {
    transform: translateY(0);
    opacity: 1;
}

.filter-modal__header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 1rem;
}

.filter-modal__header h3 {
    font-size: 1.5rem;
    font-weight: 700;
    margin: 0;
    color: var(--text-default);
}

.filter-reset {
    border: none;
    background: transparent;
    color: #94a3b8;
    font-size: 0.85rem;
    cursor: pointer;
    font-weight: 600;
}

.filter-close {
    position: absolute;
    right: 6px;
    top: 6px;
    width: 48px;
    height: 48px;
    border-radius: 9999px;
    background: #f05151;
    color: #fff !important;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 15px 30px rgba(240, 81, 81, 0.35);
}

.filter-section {
    margin-bottom: 1.25rem;
}

.filter-label {
    font-weight: 600;
    margin-bottom: 0.4rem;
    color: var(--text-default);
}

.filter-toggle {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.75rem;
    background: var(--slate-light);
    border-radius: 16px;
    padding: 0.75rem 0.85rem;
    margin: 0.35rem 0 0.85rem;
}

.filter-toggle__text {
    display: flex;
    flex-direction: column;
    gap: 0.15rem;
}

.filter-toggle__title {
    margin: 0;
    font-weight: 700;
    color: var(--text-default);
}

.filter-toggle__hint {
    font-size: 0.85rem;
    color: #94a3b8;
}

.toggle-switch {
    position: relative;
    display: inline-block;
    width: 50px;
    height: 28px;
}

.toggle-switch input {
    opacity: 0;
    width: 0;
    height: 0;
}

.toggle-slider {
    position: absolute;
    cursor: pointer;
    inset: 0;
    background: #cbd5e1;
    border-radius: 999px;
    transition: background 0.2s ease;
    box-shadow: inset 0 0 0 1px rgba(15, 23, 42, 0.05);
}

.toggle-slider::after {
    position: absolute;
    content: "";
    height: 20px;
    width: 20px;
    left: 4px;
    top: 4px;
    background-color: #fff;
    border-radius: 50%;
    box-shadow: 0 6px 14px rgba(79, 125, 242, 0.35);
    transition: transform 0.2s ease;
}

.toggle-switch input:checked + .toggle-slider {
    background: var(--primary);
}

.toggle-switch input:checked + .toggle-slider::after {
    transform: translateX(22px);
}

.filter-section__header {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.filter-value {
    font-weight: 600;
    color: var(--primary);
}

.filter-segmented-control {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    background: var(--slate-light);
    border-radius: 999px;
    padding: 0.3rem;
    gap: 0.35rem;
}

.segmented-option {
    border-radius: 999px;
    padding: 0.65rem;
    font-weight: 600;
    background: transparent;
    border: none;
    color: #94a3b8;
    transition: background 0.2s ease, color 0.2s ease;
    cursor: pointer;
}

.segmented-option.active {
    background: var(--primary);
    color: #fff;
    box-shadow: 0 10px 18px rgba(79, 125, 242, 0.35);
}

.filter-range {
    width: 100%;
    accent-color: var(--primary);
}

.filter-range:disabled,
.filter-range--disabled {
    opacity: 0.45;
    cursor: not-allowed;
}

.filter-range-labels {
    display: flex;
    justify-content: space-between;
    font-size: 0.85rem;
    color: #94a3b8;
    margin-top: 0.25rem;
}

.duration-selectors {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 0.75rem;
}

.duration-selectors label {
    display: flex;
    flex-direction: column;
    gap: 0.35rem;
    background: var(--slate-light);
    border-radius: 18px;
    padding: 0.75rem;
    font-weight: 600;
}

.duration-selectors input {
    border: none;
    background: #fff;
    border-radius: 12px;
    padding: 0.45rem;
    font-weight: 600;
    color: var(--text-default);
}

.double-range {
    position: relative;
    height: 44px;
}

.double-range input[type="range"] {
    position: absolute;
    left: 0;
    width: 100%;
    pointer-events: none;
    background: none;
    -webkit-appearance: none;
    appearance: none;
    height: 42px;
    z-index: 99;
}

.double-range input[type="range"]::-webkit-slider-thumb {
    pointer-events: auto;
    -webkit-appearance: none;
    width: 24px;
    height: 24px;
    border-radius: 50%;
    background: var(--primary);
    box-shadow: 0 6px 15px rgba(79, 125, 242, 0.35);
    border: 3px solid #fff;
}

.double-range input[type="range"]::-moz-range-thumb {
    pointer-events: auto;
    width: 18px;
    height: 18px;
    border-radius: 50%;
    background: var(--primary);
    border: 3px solid #fff;
    box-shadow: 0 6px 15px rgba(79, 125, 242, 0.35);
}

.double-range input[type="range"]::-webkit-slider-runnable-track,
.double-range input[type="range"]::-moz-range-track {
    height: 4px;
    border-radius: 999px;
    background: transparent;
}

.double-range .range-track {
    position: absolute;
    top: 50%;
    left: 0;
    width: 100%;
    height: 6px;
    border-radius: 999px;
    background: #e3e3e3;
    transform: translateY(-50%);
}

.double-range .range-track__fill {
    position: absolute;
    top: 0;
    height: 4px;
    border-radius: 999px;
    background: var(--primary);
    left: 0;
    width: 0;
}

.filter-apply {
    width: 100%;
    border: none;
    background: var(--primary);
    color: #fff;
    font-weight: 600;
    padding: 0.85rem;
    border-radius: 999px;
    box-shadow: 0 20px 35px rgba(79, 125, 242, 0.35);
    font-size: 1rem;
    transition: box-shadow var(--app-transition), transform var(--app-transition), filter var(--app-transition);
}

.filter-apply:active {
    transform: scale(0.99);
    box-shadow: 0 12px 24px rgba(79, 125, 242, 0.25);
}

/* In-app notifications */
.app-toast-stack {
    position: fixed;
    bottom: calc(1.5rem + var(--safe-bottom));
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
    width: calc(100% - 2rem);
    max-width: 24rem;
    z-index: 120;
    pointer-events: none;
}

.app-toast {
    position: relative;
    display: flex;
    gap: 0.85rem;
    align-items: center;
    background: #fff;
    border-radius: 1.25rem;
    padding: 0.95rem 1.15rem 1.25rem;
    box-shadow: 0 12px 20px rgba(15, 23, 42, 0.12);
    border: 1px solid #e2e8f0;
    opacity: 0;
    transform: translateY(12px) scale(0.97);
    transition: opacity 0.25s ease, transform 0.25s ease;
    pointer-events: auto;
}

.app-toast--visible {
    opacity: 1;
    transform: translateY(0) scale(1);
}

.app-toast--hiding {
    opacity: 0;
    transform: translateY(6px) scale(0.97);
}

.app-toast__icon {
    width: 2.75rem;
    height: 2.75rem;
    border-radius: 999px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 1.2rem;
    color: #fff;
    flex-shrink: 0;
    box-shadow: 0 8px 18px rgba(15, 23, 42, 0.15);
}

.app-toast__content {
    flex: 1;
}

.app-toast__title {
    margin: 0;
    font-weight: 700;
    color: #0f172a;
    font-size: 0.95rem;
}

.app-toast__message {
    margin: 0.1rem 0 0;
    color: #475569;
    font-size: 0.9rem;
    line-height: 1.3;
}

.app-toast__close {
    border: none;
    background: transparent;
    color: #94a3b8;
    width: 28px;
    height: 28px;
    border-radius: 999px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    flex-shrink: 0;
    transition: background 0.2s ease, color 0.2s ease;
}

.app-toast__close:hover {
    background: rgba(148, 163, 184, 0.2);
    color: #0f172a;
}

.app-toast__progress {
    position: absolute;
    left: 1.15rem;
    right: 1.15rem;
    bottom: 0.7rem;
    height: 4px;
    border-radius: 999px;
    transform-origin: left center;
    background: currentColor;
    animation-name: toast-progress;
    animation-timing-function: linear;
    animation-fill-mode: forwards;
}

.app-toast--success {
    border-color: rgba(34, 197, 94, 0.25);
}

.app-toast--success .app-toast__icon {
    background: #22c55e;
}

.app-toast--error {
    border-color: rgba(239, 68, 68, 0.25);
}

.app-toast--error .app-toast__icon {
    background: #ef4444;
}

.app-toast--info {
    border-color: rgba(59, 130, 246, 0.25);
}

.app-toast--info .app-toast__icon {
    background: #3b82f6;
}

.app-toast--warning {
    border-color: rgba(249, 115, 22, 0.4);
}

.app-toast--warning .app-toast__icon {
    background: #f97316;
}

.app-toast__progress--success {
    color: #22c55e;
}

.app-toast__progress--error {
    color: #ef4444;
}

.app-toast__progress--info {
    color: #3b82f6;
}

.app-toast__progress--warning {
    color: #f97316;
}

@keyframes toast-progress {
    from {
        transform: scaleX(1);
    }
    to {
        transform: scaleX(0);
    }
}

@media (prefers-reduced-motion: reduce) {
    .app-toast {
        transition: none;
    }
}

/* Shell layout to keep footer fixed and content scrollable */
.app-shell {
    min-height: var(--app-height);
    height: var(--app-height);
    display: flex;
    flex-direction: column;
    position: relative;
    overflow: hidden;
}

.app-shell main {
    flex: 1 1 auto;
    min-height: 0;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
    overscroll-behavior-y: contain;
}

.app-main {
    padding-top: calc(var(--safe-top) + var(--header-height));
    padding-bottom: calc(var(--footer-height) + var(--safe-bottom));
    padding-left: calc(1.25rem + var(--safe-left));
    padding-right: calc(1.25rem + var(--safe-right));
}

.home-page main {
    padding-top: 0;
    padding-bottom: calc(var(--footer-height) + var(--safe-bottom));
}


.fade-in {
    opacity: 0;
    animation: fadeIn var(--app-fade) forwards;
}

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(8px); }
    to   { opacity: 1; transform: translateY(0); }
}

@keyframes app-fade-in {
    from { opacity: 0; transform: translateY(10px); }
    to { opacity: 1; transform: translateY(0); }
}
