/* ========================================================================
   Travel Planner Modal & Overlay
   ======================================================================== */
#travel-planner-modal {
    position: fixed;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
}

.tp-overlay {
    position: absolute;
    inset: 0;
    background: rgba(0, 0, 0, 0.6);
    backdrop-filter: blur(4px);
}

/* ========================================================================
   Dialog Container
   ======================================================================== */
.tp-dialog {
    position: relative;
    background: #ffffff;
    width: 90%;
    max-width: 640px;
    max-height: 85vh;
    overflow-y: auto;
    border-radius: 12px;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.2);
    padding: 1.5rem 2rem;
    display: flex;
    flex-direction: column;
}

/* Close button */
.tp-dialog .tp-close {
    position: absolute;
    top: 1rem;
    right: 1rem;
    background: none;
    border: none;
    font-size: 1.25rem;
    cursor: pointer;
    color: #666;
}

/* ========================================================================
   Headings & Text
   ======================================================================== */
.tp-dialog h2 {
    font-size: 1.75rem;
    margin: 0 0 0.5rem;
    word-break: break-word;
}

.tp-dialog h3 {
    font-size: 1.25rem;
    margin: 1.5rem 0 0.75rem;
}

.tp-dialog p {
    margin: 0 0 1.25rem;
    color: #333;
    line-height: 1.4;
}

/* ========================================================================
   Controls (From/To selects + Plan/Cancel buttons)
   ======================================================================== */
.tp-dialog .tp-controls {
    display: grid !important;
    grid-template-columns: 1fr 1fr auto auto !important;
    grid-column-gap: 2rem !important;
    align-items: center !important;
    margin-bottom: 1.5rem;
}

.tp-dialog .tp-controls label {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.95rem;
    color: #333;
}

.tp-dialog .tp-controls select {
    appearance: none;
    padding: 0.5rem 0.75rem;
    border: 1px solid #ccc;
    border-radius: 6px;
    font-size: 1rem;
    background: #fff url("data:image/svg+xml;charset=US-ASCII,<svg%20width='10'%20height='5'%20viewBox='0%200%2010%205'%20xmlns='http://www.w3.org/2000/svg'><path%20d='M0%200l5%205%205%200z'%20fill='%23666'/></svg>") no-repeat right 0.75rem center;
    background-size: 10px 5px;
    margin-right: 2rem !important;
}

/* Plan Route button */
.tp-dialog .tp-controls .plan-route {
    background: #2a9d8f !important;
    color: #fff !important;
    border: none;
    padding: 0.5rem 1rem;
    font-size: 1rem;
    border-radius: 6px;
    cursor: pointer;
    transition: background 0.2s ease;
    margin-left: 0 !important;
}

.tp-dialog .tp-controls .plan-route:hover {
    background: #21867a !important;
}

/* Cancel button */
.tp-dialog .tp-controls .tp-close {
    background: transparent;
    color: #666;
    border: none;
    padding: 0.5rem 1rem;
    font-size: 1rem;
    border-radius: 6px;
    cursor: pointer;
    transition: color 0.2s ease;
}

.tp-dialog .tp-controls .tp-close:hover {
    color: #333;
}

@media (max-width: 480px) {
    .tp-dialog .tp-controls {
        grid-template-columns: 1fr !important;
        row-gap: 1rem !important;
    }

    .tp-dialog .tp-controls select,
    .tp-dialog .tp-controls button {
        width: 100%;
        margin: 0 !important;
    }
}

/* ========================================================================
   Map Container
   ======================================================================== */
#tp-map {
    width: 100%;
    height: 300px;
    border-radius: 8px;
    border: 1px solid #e0e0e0;
    margin-bottom: 1.25rem;
    flex: none;
}

/* ========================================================================
   Results Table
   ======================================================================== */
#tp-results table {
    width: 100%;
    border-collapse: separate;
    border-spacing: 0 0.5rem;
    margin-top: 1rem;
}

#tp-results th {
    text-align: left;
    font-weight: 600;
    padding-bottom: 0.5rem;
    border-bottom: 2px solid #e0e0e0;
}

#tp-results td {
    background: #fafafa;
    padding: 0.75rem 1rem;
    border-radius: 4px;
    color: #444;
}

/* ========================================================================
   Start/End Labels
   ======================================================================== */
.tp-endpoints {
    font-size: 0.95rem;
    margin: 0.5rem 0;
    color: #555;
}

.tp-endpoints--top {
    border-bottom: 1px solid #ddd;
    padding-bottom: 0.5rem;
}

.tp-endpoints--bottom {
    border-top: 1px solid #ddd;
    padding-top: 0.5rem;
    margin-top: 1rem;
}

/* ========================================================================
   Confirmation Toast
   ======================================================================== */
.tp-confirm {
    position: fixed;
    bottom: 1.5rem;
    left: 50%;
    transform: translateX(-50%) translateY(100px);
    opacity: 0;
    pointer-events: none;
    transition: transform .3s ease, opacity .3s ease;
    z-index: 9999;
}

.tp-confirm--visible {
    transform: translateX(-50%) translateY(0);
    opacity: 1;
    pointer-events: auto;
}

.tp-confirm__inner {
    background: #2a9d8f;
    color: #fff;
    padding: 0.75rem 1.25rem;
    border-radius: 0.25rem;
    display: flex;
    align-items: center;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    max-width: 90vw;
}

.tp-confirm__inner span {
    flex: 1;
}

.tp-confirm__close {
    background: transparent;
    border: none;
    color: #fff;
    font-size: 1.2rem;
    cursor: pointer;
    margin-left: 0.75rem;
}
/* Force spacing between dropdowns and buttons in the planner */
#travel-planner-modal .tp-dialog .tp-controls {
    display: flex !important;
    flex-wrap: wrap !important;
    align-items: center !important;
    gap: 1.5rem !important;
}