body {
    font-family: 'Inter', sans-serif;
    background-color: var(--color-bg-gray);
    margin: 0;
    padding: 0;
}

/* Header Verde */
.header-green {
    background: var(--color-primary-green);
    padding: 2rem 1.5rem 4rem;
    color: white;
    clip-path: polygon(0 0, 100% 0, 100% 75%, 0 100%);
    margin-bottom: -2rem;
    position: relative;
    z-index: 1;
}

.header-title {
    font-family: 'Inter', sans-serif;
    font-weight: 800;
    font-size: 28px;
    line-height: 1.2;
    margin-top: 1rem;
}

.main-content {
    padding: 0 1.5rem 1.5rem;
    position: relative;
    z-index: 2;
}

.selection-card {
    background: var(--color-white);
    box-shadow: 0px 2px 8px rgba(0, 0, 0, 0.1);
    border-radius: 15px;
    padding: 1.25rem 1rem;
    margin-bottom: 1rem;
    display: flex;
    align-items: center;
    cursor: pointer;
    transition: all 0.2s ease;
}

.selection-card:active {
    transform: scale(0.98);
    box-shadow: 0px 1px 4px rgba(0, 0, 0, 0.15);
}

.selection-icon {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: var(--color-bg-gray);
    display: flex;
    align-items: center;
    justify-content: center;
    margin-right: 1rem;
    font-size: 20px;
}

.selection-content {
    flex-grow: 1;
}

.selection-label {
    font-size: 12px;
    color: var(--color-text-gray);
    margin-bottom: 0.25rem;
}

.selection-value {
    font-family: 'SF Pro', sans-serif;
    font-weight: 700;
    font-size: 16px;
    color: var(--color-black);
}

.swap-button {
    background: var(--color-accent-blue);
    color: white;
    border: none;
    border-radius: 50%;
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    margin: 0.5rem auto;
    font-size: 18px;
}

.datetime-section {
    margin-top: 1.5rem;
}

.section-label {
    font-family: 'SF Pro', sans-serif;
    font-weight: 600;
    font-size: 14px;
    color: var(--color-black);
    margin-bottom: 0.5rem;
}

.datetime-inputs {
    display: flex;
    gap: 0.5rem;
    margin-bottom: 1rem;
}

.datetime-input {
    flex: 1;
    padding: 0.875rem;
    border: 1px solid var(--color-border-gray);
    border-radius: 12px;
    font-family: 'Inter', sans-serif;
    font-size: 15px;
    background: var(--color-white);
    box-shadow: 0px 1px 4px rgba(0, 0, 0, 0.08);
    transition: all 0.2s ease;
}

.datetime-input:focus {
    outline: none;
    border-color: var(--color-primary-green);
    box-shadow: 0px 2px 8px rgba(0, 158, 97, 0.2);
}

.toggle-container {
    display: flex;
    align-items: center;
    margin-bottom: 1rem;
}

.toggle-label {
    font-family: 'SF Pro', sans-serif;
    font-size: 14px;
    margin-right: 0.5rem;
}

.toggle-switch {
    position: relative;
    width: 50px;
    height: 28px;
}

.toggle-switch input {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    margin: 0;
    opacity: 0;
    cursor: pointer;
    z-index: 2;
}

.toggle-slider {
    position: absolute;
    cursor: pointer;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: var(--color-light-gray);
    transition: 0.4s;
    border-radius: 28px;
}

.toggle-slider:before {
    position: absolute;
    content: "";
    height: 20px;
    width: 20px;
    left: 4px;
    bottom: 4px;
    background-color: var(--color-white);
    transition: 0.4s;
    border-radius: 50%;
}

input:checked+.toggle-slider {
    background-color: var(--color-primary-green);
}

input:checked+.toggle-slider:before {
    transform: translateX(22px);
}

.search-button {
    background: var(--color-primary-blue);
    color: white;
    border: none;
    border-radius: 12px;
    padding: 1rem;
    width: 100%;
    font-family: 'SF Pro', sans-serif;
    font-weight: 700;
    font-size: 16px;
    cursor: pointer;
    margin-top: 1.5rem;
    transition: all 0.2s ease;
}

.search-button:active {
    transform: scale(0.98);
    background: var(--color-primary-blue-dark);
}

/* Optimization Pills */
.optimize-pills {
    display: flex;
    gap: 0.5rem;
    margin-bottom: 1rem;
}

.optimize-pill {
    flex: 1;
    padding: 0.6rem 0;
    border: 2px solid var(--color-border-gray);
    border-radius: 25px;
    background: var(--color-white);
    font-family: 'SF Pro', sans-serif;
    font-weight: 600;
    font-size: 13px;
    color: var(--color-text-gray);
    cursor: pointer;
    transition: all 0.2s ease;
    text-align: center;
}

.optimize-pill.active {
    background: var(--color-primary-green);
    border-color: var(--color-primary-green);
    color: white;
}

/* Custom Date/Time Picker Triggers */
.datetime-trigger {
    flex: 1;
    padding: 1rem;
    background: var(--color-white);
    border-radius: 12px;
    box-shadow: 0px 1px 4px rgba(0, 0, 0, 0.08);
    display: flex;
    justify-content: space-between;
    align-items: center;
    cursor: pointer;
    font-family: 'SF Pro', sans-serif;
    font-weight: 600;
    font-size: 16px;
}

.chevron {
    color: var(--color-light-gray);
    font-size: 20px;
    transform: rotate(90deg);
}

/* Calendar Styles */
.calendar-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1rem;
    font-weight: 700;
}

.calendar-grid {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    gap: 5px;
    text-align: center;
}

.calendar-day {
    padding: 10px;
    border-radius: 50%;
    cursor: pointer;
}

.calendar-day.selected {
    background: var(--color-primary-blue);
    color: white;
}

/* Time Picker Styles */
.time-picker-container {
    display: flex;
    justify-content: center;
    align-items: center;
    height: 200px;
    position: relative;
    overflow: hidden;
    background: var(--color-white);
    border-radius: 15px;
}

.time-picker-wheel {
    height: 100%;
    overflow-y: scroll;
    scroll-snap-type: y mandatory;
    width: 60px;
    text-align: center;
    padding-top: 80px;
    padding-bottom: 80px;
    scrollbar-width: none;
}

.time-picker-wheel::-webkit-scrollbar {
    display: none;
}

.time-item {
    height: 40px;
    line-height: 40px;
    scroll-snap-align: center;
    font-size: 24px;
    color: var(--color-light-gray);
}

.time-item.active {
    color: var(--color-black);
    font-weight: bold;
    font-size: 28px;
}

.time-picker-highlight {
    position: absolute;
    top: 50%;
    left: 0;
    right: 0;
    height: 40px;
    margin-top: -20px;
    background: rgba(0, 0, 0, 0.05);
    pointer-events: none;
    border-top: 1px solid var(--color-border-gray);
    border-bottom: 1px solid var(--color-border-gray);
}

.time-picker-separator {
    font-size: 24px;
    font-weight: bold;
    margin: 0 10px;
}

.modal-handle {
    width: 40px;
    height: 5px;
    background: var(--color-handle-gray);
    border-radius: 3px;
    margin: 0 auto 1.5rem;
}

.modal-actions {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
    margin-top: 2rem;
}

.btn-outline {
    background: transparent;
    color: var(--color-primary-blue);
    border: 2px solid var(--color-primary-blue);
    border-radius: 12px;
    padding: 0.8rem;
    font-weight: 700;
    font-size: 16px;
    width: 100%;
}

/* Modal Styles */
.modal-overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    z-index: 1000;
    justify-content: center;
    align-items: flex-end;
    backdrop-filter: blur(2px);
    /* Bottom sheet style */
}

.modal-content {
    background: var(--color-white);
    width: 100%;
    max-width: 500px;
    /* Limit width on desktop */
    border-top-left-radius: 20px;
    border-top-right-radius: 20px;
    padding: 1.5rem;
    box-shadow: 0 -4px 10px rgba(0, 0, 0, 0.1);
    animation: slideUp 0.3s ease-out;
    position: relative;
}

@keyframes slideUp {
    from {
        transform: translateY(100%);
    }

    to {
        transform: translateY(0);
    }
}

/* Adjust for larger screens if needed */
@media (min-width: 768px) {
    .modal-overlay {
        align-items: center;
    }

    .modal-content {
        border-radius: 20px;
        width: 90%;
    }
}

/* Tragitti preferiti */
.favorite-routes-section { margin-bottom: 1rem; }
.favorite-route-row {
    display: flex;
    align-items: center;
    gap: 8px;
    background: var(--color-white);
    border-radius: 12px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.06);
    padding: 6px 10px;
    margin-bottom: 8px;
}
.fav-route-main {
    flex: 1;
    display: flex;
    align-items: center;
    gap: 8px;
    border: none;
    background: transparent;
    text-align: left;
    cursor: pointer;
    font-size: 15px;
    color: var(--color-black);
    padding: 6px 0;
}
.fav-route-line {
    background: var(--color-primary-blue);
    color: #fff;
    font-weight: 700;
    font-size: 13px;
    border-radius: 6px;
    padding: 2px 8px;
    flex-shrink: 0;
}
.fav-route-text { line-height: 1.2; }
.fav-route-bell, .fav-route-del {
    border: none;
    background: transparent;
    cursor: pointer;
    font-size: 18px;
    width: 34px; height: 34px;
    border-radius: 50%;
    opacity: 0.55;
    flex-shrink: 0;
}
.fav-route-bell.active { opacity: 1; }
.fav-route-bell:hover, .fav-route-del:hover { background: rgba(0,0,0,0.06); opacity: 1; }
