/* * Multi-City Ride Booking Stylesheet
 * Redesigned to match horizontal widget layout
 */

.ride-booking-wrapper {
    max-width: 100%; /* Allow it to fill its container */
    margin: 0 auto;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
}

/* --- Step 1: Horizontal Widget --- */

.ride-booking-form-widget {
    background: #fff;
    padding: 20px;
    border-radius: 8px;
    /* Matching the shadow from the user's image */
    box-shadow: 0 4px 12px rgba(0,0,0,0.08); 
    border: 1px solid #e0e0e0;
}

.widget-form-row {
    display: grid;
    /* *** LAYOUT FIX: Use explicit 5 columns for desktop/large tablet *** */
    grid-template-columns: repeat(5, 1fr);
    gap: 15px;
    align-items: flex-end; /* Align items to the bottom */
}

.form-group.widget-group {
    margin-bottom: 0;
}

.form-group.widget-group-btn {
    margin-bottom: 0;
}

.form-group label {
    display: block;
    margin-bottom: 8px;
    font-weight: 500;
    font-size: 14px;
    color: #333;
}

/* Common styles for all inputs/selects in the widget */
.ride-booking-form-widget input[type="text"],
.ride-booking-form-widget select {
    width: 100%;
    height: 48px; /* Taller height to match image */
    padding: 0 12px;
    border: 1px solid #ced4da; /* Light border */
    border-radius: 6px;
    font-size: 15px;
    transition: border-color 0.3s, box-shadow 0.3s;
    background-color: #fff;
    -webkit-appearance: none;
    -moz-appearance: none;
    appearance: none;
}

.ride-booking-form-widget select {
    /* Add dropdown arrow for selects */
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'%3E%3Cpath fill='none' stroke='%23333' stroke-linecap='round' stroke-linejoin='round' stroke-width='2' d='m2 5 6 6 6-6'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 12px center;
    background-size: 16px;
    padding-right: 40px; /* Make space for arrow */
}

.ride-booking-form-widget input:focus,
.ride-booking-form-widget select:focus {
    outline: none;
    border-color: var(--ride-primary-color);
    box-shadow: 0 0 0 2px rgba(13, 110, 253, 0.25); /* Blue focus ring */
}


/* --- Buttons --- */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    height: 48px;
    padding: 12px 24px;
    border: none;
    border-radius: 6px;
    font-size: 16px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s;
    text-decoration: none;
    white-space: nowrap;
}

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

.btn-primary {
    background: var(--ride-primary-color);
    color: white;
}

.btn-primary:hover:not(:disabled) {
    /* Darken the blue on hover */
    filter: brightness(90%);
}

.btn-secondary {
    background: #6c757d;
    color: white;
}

.btn-secondary:hover:not(:disabled) {
    background: #5a6268;
}

.btn-large {
    font-size: 16px;
    font-weight: 600;
}

.btn-loader {
    margin-left: 8px;
    font-size: 18px;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    from { transform: rotate(0deg); }
    to { transform: rotate(360deg); }
}

/* --- Step 2 & 3 (Fare & Details) --- */

.booking-step {
    display: none;
}
.booking-step.active {
    display: block;
}

/* Fade-in animation */
.booking-step.active {
    animation: fadeIn 0.5s;
}
@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

/* Styles for the detail form (Step 3) */
.ride-booking-form-details {
    background: #fff;
    padding: 30px;
    border-radius: 8px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.05);
    margin-top: 20px;
}

.form-section {
    margin-bottom: 30px;
    padding-bottom: 20px;
    border-bottom: 1px solid #e0e0e0;
}
.form-section:last-of-type { border-bottom: none; }

.form-section h3 {
    margin-top: 0;
    margin-bottom: 20px;
    color: #333;
    font-size: 20px;
}

.ride-booking-form-details .form-group {
    margin-bottom: 20px;
}

.ride-booking-form-details input[type="text"],
.ride-booking-form-details input[type="email"],
.ride-booking-form-details input[type="tel"],
.ride-booking-form-details input[type="number"],
.ride-booking-form-details input[type="datetime-local"],
.ride-booking-form-details select,
.ride-booking-form-details textarea {
    width: 100%;
    padding: 12px;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 14px;
    transition: border-color 0.3s;
}

.ride-booking-form-details input:focus,
.ride-booking-form-details select:focus,
.ride-booking-form-details textarea:focus {
    outline: none;
    border-color: var(--ride-primary-color);
}

.form-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
}

/* Step 2: Fare Result */
.fare-result {
    background: #f8f9fa;
    border-radius: 8px;
    padding: 30px;
    margin-top: 20px;
    border: 1px solid #e0e0e0;
}
.fare-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
    border-bottom: 1px solid #ddd;
    padding-bottom: 15px;
}
.fare-header h2 { margin: 0; }
.btn-back {
    background: none;
    border: none;
    color: var(--ride-primary-color);
    cursor: pointer;
    font-size: 14px;
    font-weight: 500;
}
.trip-summary { margin-bottom: 20px; }
.summary-item {
    display: flex;
    justify-content: space-between;
    font-size: 15px;
    margin-bottom: 8px;
}
.summary-item .label { color: #555; }
.summary-item .value { color: #111; font-weight: 500; text-align: right; }
.fare-display {
    text-align: center;
    padding: 20px;
    background: #fff;
    border-radius: 6px;
    margin-bottom: 20px;
}
.fare-amount {
    font-size: 42px;
    font-weight: 700;
    color: var(--ride-primary-color);
}
.fare-note { font-size: 14px; color: #666; }

/* Step 3: Checkboxes, Summary, etc */
.checkbox-field {
    display: flex;
    align-items: center;
    padding-top: 20px; /* Align with input field */
}
.checkbox-label {
    display: flex;
    align-items: center;
    cursor: pointer;
}
.checkbox-label input[type="checkbox"] {
    width: 16px;
    height: 16px;
    margin-right: 10px;
    cursor: pointer;
}
.booking-summary-box {
    background: #f8f9fa;
    padding: 20px;
    border-radius: 6px;
    margin: 20px 0;
}
.booking-summary-box h4 { margin: 0 0 10px 0; }
.summary-row {
    display: flex;
    justify-content: space-between;
    font-size: 18px;
    font-weight: 600;
}
.summary-fare { color: var(--ride-primary-color); }
.step-progress {
    display: flex;
    justify-content: space-between;
    margin-bottom: 20px;
}
.progress-step {
    flex: 1;
    text-align: center;
    padding: 10px;
    background: #f0f0f0;
    color: #888;
    font-weight: 500;
}
.progress-step.active {
    background: var(--ride-primary-color);
    color: #fff;
}
.progress-step.completed {
    background: #e0e0e0;
    color: #555;
}
.ride-booking-form-details .btn-secondary {
    margin-top: 10px;
}

/* --- Messages & Errors --- */
.error-message {
    display: none;
    padding: 15px;
    border-radius: 4px;
    margin-top: 20px;
    font-weight: 500;
    background: #f8d7da;
    color: #721c24;
    border: 1px solid #f5c6cb;
}

.booking-message {
    display: none;
    padding: 15px;
    border-radius: 4px;
    margin-top: 20px;
    font-weight: 500;
}
.booking-message.success {
    background: #d4edda;
    color: #155724;
    border: 1px solid #c3e6cb;
}
.booking-message.error {
    background: #f8d7da;
    color: #721c24;
    border: 1px solid #f5c6cb;
}

/* --- Responsive --- */

@media (max-width: 992px) {
    .widget-form-row {
        /* *** LAYOUT FIX: Stack to 2 columns on tablet *** */
        grid-template-columns: 1fr 1fr;
    }
}

@media (max-width: 768px) {
    .form-row {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 576px) {
    .widget-form-row {
        /* *** LAYOUT FIX: Stack to 1 column on mobile *** */
        grid-template-columns: 1fr;
    }
    .ride-booking-form-widget {
        padding: 15px;
    }
    .ride-booking-form-details {
        padding: 15px;
    }
}

/* --- Autocomplete --- */
.pac-container {
    z-index: 10000;
    border-radius: 4px;
    margin-top: 2px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.2);
}

