/* Modern Floating Modal Styles */

/* Overlay with blur effect */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.4);
    backdrop-filter: blur(4px);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 2000;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s cubic-bezier(0.16, 1, 0.3, 1), visibility 0.3s;
}

.modal-overlay.open {
    opacity: 1;
    visibility: visible;
}

/* Modal Container */
.modal-container {
    background: #ffffff;
    width: 100%;
    max-width: 520px;
    border-radius: 16px;
    box-shadow: 0 12px 32px rgba(0, 0, 0, 0.15), 0 4px 12px rgba(0, 0, 0, 0.08);
    display: flex;
    flex-direction: column;
    max-height: 75vh;
    transform: translateY(40px) scale(0.98);
    transition: transform 0.4s cubic-bezier(0.16, 1, 0.3, 1);
    overflow: hidden;
}

.modal-overlay.open .modal-container {
    transform: translateY(0) scale(1);
}

/* Header */
.modal-header {
    padding: 12px 20px;
    border-bottom: 1px solid #f0f0f0;
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: #fff;
    z-index: 10;
}

.modal-title {
    font-size: 1.15rem;
    font-weight: 700;
    color: #222;
    margin: 0;
    letter-spacing: -0.01em;
}

.close-modal {
    background: transparent;
    border: none;
    cursor: pointer;
    padding: 8px;
    margin-right: -8px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #222;
    transition: background 0.2s;
}

.close-modal:hover {
    background: #f7f7f7;
}

.close-modal svg {
    width: 20px;
    height: 20px;
    stroke-width: 2.5;
}

/* Body Content */
.modal-body {
    padding: 12px 16px;
    overflow-y: auto;
    background: #fff;
}

/* Sections */
.confirm-section {
    margin-bottom: 12px;
    padding-bottom: 12px;
    border-bottom: 1px solid #f0f0f0;
}

.confirm-section:last-child {
    border-bottom: none;
    margin-bottom: 0;
    padding-bottom: 0;
}

.confirm-section-title {
    font-size: 1.1rem;
    font-weight: 600;
    margin-bottom: 8px;
    color: #222;
}

/* Trip Details Summary */
.trip-summary-card {
    border: 1px solid #dddddd;
    border-radius: 12px;
    padding: 10px 14px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: #fff;
}

.trip-info-group {
    display: flex;
    flex-direction: column;
}

.trip-label {
    font-size: 0.85rem;
    font-weight: 600;
    color: #222;
    margin-bottom: 2px;
}

.trip-value {
    font-size: 0.9rem;
    color: #717171;
}

.trip-edit-link {
    font-size: 0.9rem;
    font-weight: 600;
    text-decoration: underline;
    color: #222;
    cursor: pointer;
    background: none;
    border: none;
    padding: 0;
}

/* Price Breakdown */
.price-details-container {
    background: #f8f9fa; /* Slight grey background for differentiation */
    border-radius: 12px;
    padding: 12px 16px;
}

.price-row {
    display: flex;
    justify-content: space-between;
    margin-bottom: 6px;
    font-size: 0.95rem;
    color: #444;
}

.price-row span:first-child {
    text-decoration: underline;
    text-decoration-color: #ddd; /* Subtle underline for "help" feel */
}

.price-row.total {
    font-weight: 800;
    border-top: 1px solid #e0e0e0;
    padding-top: 10px;
    margin-bottom: 0;
    margin-top: 10px;
    font-size: 1.1rem;
    color: #222;
}

.price-row.total span:first-child {
    text-decoration: none;
}

/* Payment Method */
.payment-selection {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.payment-option-card {
    border: 1px solid #ddd;
    border-radius: 8px;
    padding: 16px;
    cursor: pointer;
    transition: all 0.2s;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.payment-option-card:hover {
    border-color: #222;
}

.payment-option-card.selected {
    border: 2px solid #222;
    background-color: #fafafa;
}

.payment-option-header {
    display: flex;
    align-items: center;
    gap: 12px;
}

.payment-icon {
    width: 24px;
    height: 24px;
    color: #717171;
}

.payment-label {
    font-weight: 600;
    color: #222;
    font-size: 1rem;
}

/* Styled Select (Fallback) */
.payment-method-select {
    appearance: none;
    width: 100%;
    padding: 14px 16px;
    border: 1px solid #b0b0b0;
    border-radius: 8px;
    font-size: 1rem;
    background-color: #fff;
    background-image: url("data:image/svg+xml;charset=US-ASCII,%3Csvg%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%20width%3D%22292.4%22%20height%3D%22292.4%22%3E%3Cpath%20fill%3D%22%23333%22%20d%3D%22M287%2069.4a17.6%2017.6%200%200%200-13-5.4H18.4c-5%200-9.3%201.8-12.9%205.4A17.6%2017.6%200%200%200%200%2082.2c0%205%201.8%209.3%205.4%2012.9l128%20127.9c3.6%203.6%207.8%205.4%2012.8%205.4s9.2-1.8%2012.8-5.4L287%2095c3.5-3.5%205.4-7.8%205.4-12.8%200-5-1.9-9.2-5.5-12.8z%22%2F%3E%3C%2Fsvg%3E");
    background-repeat: no-repeat;
    background-position: right 16px top 50%;
    background-size: 12px auto;
    cursor: pointer;
    margin-bottom: 16px;
    transition: border-color 0.2s;
}

.payment-method-select:focus {
    border-color: #222;
    outline: none;
}

/* Payment Inputs */
.payment-details {
    background: #fff;
    border: 1px solid #ddd;
    border-radius: 8px;
    padding: 16px;
    margin-top: 12px;
    display: none;
    animation: fadeIn 0.3s ease;
}

.payment-details.visible {
    display: block;
}

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

.card-input-row {
    display: flex;
    gap: 12px;
    margin-bottom: 12px;
}

.card-input-row:last-child {
    margin-bottom: 0;
}

.card-input {
    width: 100%;
    padding: 12px;
    border: 1px solid #b0b0b0;
    border-radius: 8px;
    font-size: 0.95rem;
    transition: border-color 0.2s;
}

.card-input:focus {
    border-color: #222;
    outline: none;
}

.card-input::placeholder {
    color: #717171;
}

/* Confirm Button */
.btn-confirm {
    width: 100%;
    background: linear-gradient(90deg, #E61E4D 0%, #D32F2F 100%);
    color: white;
    padding: 14px;
    border: none;
    border-radius: 8px;
    font-size: 1.1rem;
    font-weight: 600;
    cursor: pointer;
    margin-top: 24px;
    transition: transform 0.1s ease, box-shadow 0.2s ease;
}

.btn-confirm:hover {
    box-shadow: 0 4px 12px rgba(230, 30, 77, 0.25);
}

.btn-confirm:active {
    transform: scale(0.98);
}

/* Responsive */
@media (max-width: 600px) {
    .modal-container {
        width: 100%;
        height: 100%;
        max-height: 100%;
        border-radius: 0;
        transform: none;
    }
    
    .modal-body {
        padding: 20px;
    }
}
