/* create-trip-drawer — stessa shell del profilo (#profile-card-overlay / #profile-card) */

.mc-sheet-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    display: none;
    align-items: center;
    justify-content: center;
    z-index: 10080;
    padding: 20px 20px var(--mc-nav-mobile-h);
    overflow-y: auto;
    animation: fadeIn 0.3s ease;
}

.mc-sheet-card {
    background: var(--mc-bg-elevated, #0a0a0a);
    border-radius: 20px;
    padding: 0;
    max-width: 600px;
    width: 100%;
    max-height: 90vh;
    overflow-y: auto;
    position: relative;
    box-shadow:
        0 0 0 1px var(--mc-border, rgba(255, 255, 255, 0.12)),
        var(--mc-shadow-md, 0 10px 40px rgba(0, 0, 0, 0.4));
    animation: slideUp 0.3s ease;
    color: var(--mc-text, white);
}

.mc-sheet-close {
    position: sticky;
    top: 12px;
    float: right;
    margin: 12px 12px -52px 0;
    background: rgba(255, 255, 255, 0.95);
    border: none;
    border-radius: 50%;
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: background 0.25s ease, color 0.25s ease, transform 0.25s ease;
    z-index: 100;
    color: #333;
    font-size: 1.2rem;
    -webkit-tap-highlight-color: transparent;
}

.mc-sheet-close:hover {
    background: #FF7601;
    color: #fff;
    transform: rotate(90deg);
}

/* Mobile: stessa shell del drawer profilo (sopra tab bar, sotto status bar) */
@media (max-width: 768px) {
    .mc-sheet-overlay {
        padding: max(44px, env(safe-area-inset-top, 0px)) 0 var(--mc-nav-mobile-h, 56px);
        align-items: stretch;
        justify-content: stretch;
        overflow: hidden;
        top: 0;
        right: 0;
        left: 0;
        bottom: 0;
        height: auto;
        min-height: 0;
        box-sizing: border-box;
        background: var(--mc-bg-elevated, #0a0a0a);
        z-index: 10080;
    }

    .mc-sheet-card {
        max-width: 100%;
        width: 100%;
        max-height: none;
        height: 100%;
        border-radius: 0;
        box-shadow: none;
        box-sizing: border-box;
        padding-bottom: 0;
        padding-top: 0;
    }

    .mc-sheet-close {
        display: flex !important;
        position: sticky;
        top: 10px;
        float: right;
        margin: 10px 12px -40px 0;
        width: 40px;
        height: 40px;
        background: rgba(255, 255, 255, 0.95);
        color: #333;
        border: none;
        z-index: 100;
    }
}

/* Desktop: pannello destro flottante (stesso di profilo / viaggio) */
@media (min-width: 769px) {
    .mc-sheet-overlay.profile-side-panel {
        top: 62px;
        left: 0;
        right: 0;
        bottom: 0;
        width: 100%;
        max-width: none;
        padding: 16px 16px 16px 0;
        align-items: stretch;
        justify-content: flex-end;
        background: transparent;
        pointer-events: auto;
        overflow: visible;
        z-index: 10080;
        animation: none;
    }

    .mc-sheet-overlay.profile-side-panel .mc-sheet-card {
        pointer-events: auto;
        width: min(480px, 42vw);
        max-width: 480px;
        height: auto;
        max-height: calc(100vh - 94px);
        border-radius: 20px;
        border: 1px solid var(--mc-border, rgba(255, 255, 255, 0.1));
        box-shadow: var(--mc-shadow-md, 0 12px 40px rgba(0, 0, 0, 0.5));
        overflow: hidden;
        overflow-y: auto;
        animation: mapProfilePanelIn 0.36s cubic-bezier(0.32, 0.72, 0, 1);
    }

    .mc-sheet-overlay.profile-side-panel .mc-sheet-close {
        position: sticky;
        top: 12px;
        float: right;
        margin: 12px 12px -48px 0;
        width: 36px;
        height: 36px;
        font-size: 1rem;
        background: rgba(0, 0, 0, 0.5);
        color: #fff;
        backdrop-filter: blur(8px);
        -webkit-backdrop-filter: blur(8px);
        border: 1px solid rgba(255, 255, 255, 0.12);
        z-index: 120;
        pointer-events: auto;
    }

    .mc-sheet-overlay.profile-side-panel .mc-sheet-close:hover {
        background: rgba(255, 255, 255, 0.15);
        color: #fff;
        transform: none;
    }
}

.create-trip-hero {
    width: 100%;
    height: 180px;
    min-height: 180px;
    flex-shrink: 0;
}

.create-trip-hero[hidden] {
    display: none !important;
}

.mc-sheet-card .create-trip-hero.event-modal-hero {
    border-radius: 0;
}

/* Hero drawer: sempre cover + center (override contain di map-eventi) */
.create-trip-hero .event-hero-img,
.mc-sheet-card .create-trip-hero .event-hero-img {
    object-fit: cover;
    object-position: center center;
}

.create-trip-body {
    padding: 20px 20px calc(28px + env(safe-area-inset-bottom, 0px));
    clear: both;
}

.create-trip-title {
    font-family: 'Agrandir Grand Heavy', sans-serif;
    font-size: 1.55rem;
    margin: 0 0 6px;
    color: var(--mc-text, #fff);
    padding-right: 48px;
}

.create-trip-subtitle {
    margin: 0 0 20px;
    font-size: 0.92rem;
    line-height: 1.45;
    color: var(--mc-text-muted, rgba(255, 255, 255, 0.65));
}

.mc-sheet-card .form-group {
    margin-bottom: 16px;
}

.mc-sheet-card .form-group label {
    display: block;
    margin-bottom: 6px;
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--mc-text, #fff);
}

.mc-sheet-card .form-control {
    width: 100%;
    box-sizing: border-box;
    background: var(--mc-overlay-06, rgba(255, 255, 255, 0.06));
    border: 1px solid var(--mc-border, rgba(255, 255, 255, 0.12));
    color: var(--mc-text, #fff);
    border-radius: 10px;
    padding: 12px 14px;
    font-size: 15px;
}

.mc-sheet-card .form-control:focus {
    outline: none;
    border-color: #FF7601;
    box-shadow: 0 0 0 2px rgba(255, 118, 1, 0.25);
}

.mc-sheet-card textarea.form-control {
    resize: vertical;
    min-height: 96px;
}

.create-trip-dates {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
}

.mc-sheet-card .date-input-wrapper {
    position: relative;
}

.mc-sheet-card .date-input-icon {
    position: absolute;
    right: 12px;
    top: 50%;
    transform: translateY(-50%);
    color: #FF7601;
    pointer-events: none;
}

.create-trip-actions {
    display: flex;
    flex-direction: column;
    gap: 10px;
    margin-top: 8px;
    padding-bottom: var(--mc-nav-mobile-h, 0px);
}

.create-trip-stops-head {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 12px;
}

.create-trip-stops-title {
    display: block;
    margin-bottom: 4px;
}

.create-trip-stops-helper {
    margin: 0;
    font-size: 0.85rem;
    line-height: 1.45;
    color: var(--mc-text-muted, rgba(255, 255, 255, 0.65));
}

.create-trip-stop-add-btn {
    flex-shrink: 0;
    white-space: nowrap;
}

.create-trip-stops-list {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.create-trip-stops-list[data-empty="1"] {
    display: none;
}

.create-trip-stop-row {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto auto;
    gap: 10px;
    align-items: end;
}

.create-trip-stop-field label {
    display: block;
    margin-bottom: 6px;
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--mc-text, #fff);
}

.create-trip-stop-actions {
    display: flex;
    flex-direction: column;
    gap: 2px;
    align-self: end;
    padding-bottom: 2px;
}

.create-trip-stop-move-btn {
    width: 32px;
    height: 20px;
    min-width: 32px;
    min-height: 20px;
    padding: 0;
    border: 1px solid var(--mc-border, rgba(255, 255, 255, 0.12));
    border-radius: 6px;
    background: var(--mc-overlay-06, rgba(255, 255, 255, 0.06));
    color: var(--mc-text-muted, rgba(255, 255, 255, 0.75));
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 0.65rem;
    line-height: 1;
}

.create-trip-stop-move-btn:hover:not(:disabled) {
    background: var(--mc-overlay-10, rgba(255, 255, 255, 0.12));
    color: var(--mc-text, #fff);
}

.create-trip-stop-move-btn:disabled {
    opacity: 0.35;
    cursor: default;
}

.create-trip-stop-remove-btn {
    min-width: 44px;
    min-height: 44px;
    padding-inline: 12px;
    align-self: end;
}

.create-trip-stop-remove-btn:disabled {
    opacity: 0.35;
    cursor: not-allowed;
}

@media (max-width: 480px) {
    .create-trip-dates {
        grid-template-columns: 1fr;
    }

    .create-trip-stops-head {
        grid-template-columns: 1fr;
    }

    .create-trip-stop-row {
        grid-template-columns: minmax(0, 1fr) auto;
        grid-template-areas:
            "field field"
            "reorder remove";
    }

    .create-trip-stop-field {
        grid-area: field;
    }

    .create-trip-stop-actions {
        grid-area: reorder;
        flex-direction: row;
        align-self: center;
    }

    .create-trip-stop-remove-btn {
        grid-area: remove;
        width: auto;
    }

    .create-trip-stop-add-btn {
        width: 100%;
    }
}
