/* ===================================================================
   Wizard Components – Shared styles for public wizard & dashboard wizard
   Used by: wizard.blade.php, dashboard-wizard.blade.php
   =================================================================== */

/* ===== Passenger Counter ===== */
.passenger-counter {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 24px;
    padding: 24px;
    background: var(--gray-50);
    border-radius: var(--radius-lg);
    margin-bottom: 32px;
}

.counter-btn {
    width: 56px;
    height: 56px;
    border-radius: 50%;
    border: 2px solid var(--gray-300);
    background: white;
    font-size: 1.5rem;
    cursor: pointer;
    transition: var(--transition-fast);
    display: flex;
    align-items: center;
    justify-content: center;
}

.counter-btn:hover:not(:disabled) {
    border-color: var(--primary-500);
    color: var(--primary-600);
}

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

.counter-value {
    font-size: 3rem;
    font-weight: 800;
    color: var(--primary-600);
    min-width: 80px;
    text-align: center;
}

.counter-label {
    font-size: 0.9rem;
    color: var(--gray-500);
    text-align: center;
    margin-top: -16px;
}

/* ===== Vehicle Grid & Cards ===== */
.vehicle-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 12px;
    margin-bottom: 32px;
}

.vehicle-card {
    padding: 16px;
    border: 2px solid var(--gray-200);
    border-radius: var(--radius-md);
    cursor: pointer;
    transition: var(--transition-medium);
    position: relative;
    background: white;
    text-align: center;
}

.vehicle-card:hover {
    border-color: var(--primary-300);
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.08);
}

.vehicle-card.selected {
    border-color: var(--primary-500);
    background: var(--primary-50);
}

.vehicle-card.recommended {
    border-color: var(--primary-400);
}

.vehicle-card.recommended::before {
    content: '\2713';
    position: absolute;
    top: -8px;
    right: 10px;
    background: var(--gradient-primary);
    color: white;
    width: 20px;
    height: 20px;
    border-radius: 50%;
    font-size: 0.7rem;
    font-weight: 600;
    display: flex;
    align-items: center;
    justify-content: center;
}

.vehicle-card.not-suitable {
    opacity: 0.5;
    cursor: not-allowed;
}

.vehicle-icon {
    font-size: 1.8rem;
    margin-bottom: 6px;
}

.vehicle-name {
    font-size: 0.9rem;
    font-weight: 700;
    color: var(--gray-800);
    margin-bottom: 2px;
}

.vehicle-capacity {
    font-size: 0.75rem;
    color: var(--primary-600);
    font-weight: 500;
}

.vehicle-luggage {
    font-size: 0.7rem;
    color: var(--gray-500);
    margin-top: 2px;
}

/* Vehicle info wrapper — used on mobile for horizontal card layout */
.vehicle-info {
    flex: 1;
    min-width: 0;
}

/* ===== Timeline ===== */
.timeline-container {
    position: relative;
    padding-left: 10px;
    margin-bottom: 32px;
}

.timeline-container::before {
    content: '';
    position: absolute;
    top: 20px;
    bottom: 40px;
    left: 26px;
    width: 2px;
    background: var(--gray-300);
    z-index: 1;
}

.timeline-item {
    display: flex;
    gap: 20px;
    position: relative;
    padding-bottom: 24px;
}

.timeline-item:last-child {
    padding-bottom: 0;
}

.timeline-action {
    display: flex;
    gap: 20px;
    position: relative;
    padding-bottom: 24px;
}

.timeline-marker {
    display: flex;
    flex-direction: column;
    align-items: center;
    width: 32px;
    flex-shrink: 0;
    position: relative;
    z-index: 2;
}

.marker-icon {
    width: 32px;
    height: 32px;
    background: white;
    border: 2px solid var(--primary-500);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.1rem;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
}

.marker-dot {
    width: 16px;
    height: 16px;
    background: var(--primary-500);
    border-radius: 50%;
    border: 3px solid white;
    box-shadow: 0 0 0 2px var(--primary-500);
    margin-top: 8px;
}

/* Hide individual lines since we use global line */
.marker-line {
    display: none;
}

.timeline-content {
    flex: 1;
}

.timeline-label {
    display: block;
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--gray-500);
    margin-bottom: 8px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

/* ===== Stop Input Row ===== */
.stop-row-container {
    background: var(--gray-50);
    padding: 16px;
    border-radius: var(--radius-md);
    position: relative;
    border: 1px solid var(--gray-200);
    margin-bottom: 24px;
}

.intermediate-stop {
    padding-bottom: 36px;
}

.stop-inputs {
    display: flex;
    gap: 12px;
}

.stop-inputs .location-input {
    flex: 2;
}

.stop-inputs .nights-input {
    flex: 1;
    max-width: 100px;
}

.nights-wrapper {
    display: flex;
    flex-direction: column;
    flex: 0 0 auto;
    min-width: 80px;
    max-width: 100px;
}

.nights-label {
    font-size: 11px;
    font-weight: 600;
    color: var(--gray-500);
    margin-bottom: 4px;
    white-space: nowrap;
}

.nights-wrapper input {
    width: 100%;
    text-align: center;
}

/* Stop inputs — dashboard uses generic child selectors */
.stop-inputs > input:first-child,
.stop-inputs > .location-input {
    flex: 2;
}

.stop-inputs > input:last-child,
.stop-inputs > .nights-input,
.stop-inputs > .nights-wrapper {
    flex: 0 0 auto;
    max-width: 100px;
}

.btn-remove-stop {
    position: absolute;
    top: -10px;
    right: -10px;
    width: 24px;
    height: 24px;
    background: white;
    border: 1px solid var(--gray-300);
    border-radius: 50%;
    color: var(--gray-500);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    font-size: 1.2rem;
    line-height: 1;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
    transition: var(--transition-fast);
}

.btn-remove-stop:hover {
    color: #ef4444;
    border-color: #ef4444;
}

/* ===== Add Stop Button ===== */
.btn-add-stop {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
    margin-top: 12px;
    background: var(--primary-50);
    border: 2px dashed var(--primary-300);
    padding: 16px 20px;
    border-radius: var(--radius-md);
    color: var(--primary-700);
    font-weight: 600;
    cursor: pointer;
    width: 100%;
    transition: all 0.2s ease;
    margin-bottom: 24px;
}

.btn-add-stop:hover {
    background: var(--primary-100);
    border-color: var(--primary-500);
    transform: translateY(-2px);
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.05);
}

.btn-add-stop .plus-icon {
    width: 24px;
    height: 24px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--primary-200);
    color: var(--primary-700);
    border-radius: 50%;
    font-size: 1.1rem;
    font-weight: 700;
    line-height: 1;
}

/* ===== Summary Grid ===== */
.summary-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 20px;
    margin-top: 24px;
}

.trip-summary-card {
    background: var(--primary-50);
    color: var(--gray-800);
    padding: 24px;
    border-radius: var(--radius-lg);
    border: 1px solid var(--primary-200);
}

.summary-item {
    display: flex;
    flex-direction: column;
}

.summary-item .summary-label {
    font-size: 0.85rem;
    color: var(--gray-600);
    margin-bottom: 4px;
    text-transform: uppercase;
    font-weight: 600;
}

.summary-item .summary-value {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--gray-900);
}

.summary-row {
    display: flex;
    justify-content: space-between;
    margin-bottom: 12px;
}

.summary-label {
    color: var(--gray-600);
}

.summary-value {
    font-weight: 700;
}

.summary-value.highlight {
    color: var(--primary-600);
    font-size: 1.5rem;
}

/* ===== Skeleton / Shimmer ===== */
.skeleton-loader {
    color: var(--gray-300);
}

@keyframes shimmer {
    0% { background-position: 200% 0; }
    100% { background-position: -200% 0; }
}

.shimmer-bar {
    display: inline-block;
    width: 70px;
    height: 22px;
    border-radius: 6px;
    background: linear-gradient(90deg, var(--primary-100) 25%, var(--primary-50) 50%, var(--primary-100) 75%);
    background-size: 200% 100%;
    animation: shimmer 1.5s infinite;
}

/* ===== Preference Toggles ===== */
.preference-toggle {
    display: flex;
    gap: 16px;
    margin-bottom: 24px;
}

.toggle-option {
    flex: 1;
    padding: 20px;
    border: 2px solid var(--gray-200);
    border-radius: var(--radius-md);
    cursor: pointer;
    transition: var(--transition-fast);
    text-align: center;
}

.toggle-option:hover {
    border-color: var(--primary-300);
}

.toggle-option.selected {
    border-color: var(--primary-500);
    background: var(--primary-50);
}

.toggle-icon {
    font-size: 2rem;
    margin-bottom: 8px;
}

.toggle-label {
    font-weight: 600;
    color: var(--gray-700);
}

.toggle-desc {
    font-size: 0.85rem;
    color: var(--gray-500);
    margin-top: 4px;
}

/* ===== Conditional Fields ===== */
.conditional-fields {
    padding: 24px;
    background: var(--gray-50);
    border-radius: var(--radius-md);
    margin-bottom: 24px;
    display: none;
}

.conditional-fields.visible {
    display: block;
    animation: fadeIn 0.3s ease;
}

.checkbox-group {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.checkbox-item {
    display: flex;
    align-items: center;
    gap: 12px;
    cursor: pointer;
}

.checkbox-item input {
    width: 22px;
    height: 22px;
    accent-color: var(--primary-500);
}

.checkbox-item label {
    font-weight: 500;
    color: var(--gray-700);
    cursor: pointer;
}

/* ===== Loading Overlay ===== */
.loading-overlay {
    position: fixed;
    inset: 0;
    background: rgba(255, 255, 255, 0.9);
    display: none;
    align-items: center;
    justify-content: center;
    z-index: 1000;
}

.loading-overlay.visible {
    display: flex;
}

.loading-spinner {
    width: 48px;
    height: 48px;
    border: 4px solid var(--gray-200);
    border-top-color: var(--primary-500);
    border-radius: 50%;
    animation: wc-spin 1s linear infinite;
}

@keyframes wc-spin {
    to { transform: rotate(360deg); }
}


/* =====================================================================
   RESPONSIVE — Shared component breakpoints
   ===================================================================== */

/* ---- Tablet (≤ 768px) ---- */
@media (max-width: 768px) {

    /* Passenger counter */
    .passenger-counter {
        padding: 20px 16px;
        gap: 20px;
        border-radius: 16px;
        margin-bottom: 24px;
    }

    .counter-btn {
        width: 50px;
        height: 50px;
        font-size: 1.3rem;
        -webkit-tap-highlight-color: transparent;
    }

    .counter-value {
        font-size: 2.8rem;
        min-width: 60px;
    }

    .counter-label {
        font-size: 0.85rem;
        margin-top: -10px;
    }

    /* Vehicle grid */
    .vehicle-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 10px;
        margin-bottom: 24px;
    }

    .vehicle-card {
        padding: 14px 10px;
        border-radius: 12px;
        -webkit-tap-highlight-color: transparent;
    }

    .vehicle-card:hover {
        transform: none;
    }

    .vehicle-card.selected {
        box-shadow: 0 0 0 1px var(--primary-500);
    }

    .vehicle-icon {
        font-size: 1.6rem;
        margin-bottom: 6px;
    }

    .vehicle-name {
        font-size: 0.82rem;
    }

    .vehicle-capacity {
        font-size: 0.72rem;
    }

    .vehicle-luggage {
        font-size: 0.68rem;
    }

    /* Preference toggles — stacked grid layout */
    .preference-toggle {
        flex-direction: column;
        gap: 10px;
    }

    .toggle-option {
        padding: 16px;
        display: grid;
        grid-template-columns: auto 1fr;
        grid-template-rows: auto auto;
        gap: 2px 14px;
        align-items: center;
        text-align: left;
        border-radius: 12px;
        -webkit-tap-highlight-color: transparent;
    }

    .toggle-option:hover {
        transform: none;
    }

    .toggle-icon {
        font-size: 1.8rem;
        margin-bottom: 0;
        grid-row: 1 / 3;
        display: flex;
        align-items: center;
    }

    .toggle-label {
        font-size: 0.95rem;
        font-weight: 700;
        grid-column: 2;
        grid-row: 1;
    }

    .toggle-desc {
        font-size: 0.8rem;
        grid-column: 2;
        grid-row: 2;
        margin-top: 0;
    }

    /* Timeline */
    .timeline-container {
        padding-left: 0;
    }

    .timeline-container::before {
        left: 15px;
    }

    .timeline-item {
        gap: 12px;
    }

    /* Stop Row */
    .stop-row-container {
        padding: 12px;
        border-radius: 10px;
    }

    .stop-inputs {
        flex-direction: column;
        gap: 10px;
    }

    .stop-inputs .nights-input,
    .stop-inputs > input:last-child,
    .stop-inputs .nights-wrapper {
        max-width: 100%;
    }

    .nights-wrapper {
        flex-direction: row;
        align-items: center;
        gap: 8px;
        max-width: 100% !important;
    }

    .nights-wrapper input {
        flex: 1;
    }

    .btn-add-stop {
        padding: 14px 16px;
        font-size: 0.88rem;
        gap: 8px;
        border-radius: 12px;
        -webkit-tap-highlight-color: transparent;
    }

    .btn-add-stop:hover {
        transform: none;
    }

    /* Summary */
    .summary-grid {
        grid-template-columns: 1fr;
        gap: 10px;
    }

    .trip-summary-card {
        padding: 16px;
        border-radius: 12px;
    }

    .summary-item .summary-value {
        font-size: 1.3rem;
    }

    /* Conditional fields */
    .conditional-fields {
        padding: 16px;
        border-radius: 12px;
    }

    .checkbox-group {
        gap: 14px;
    }

    .checkbox-item {
        gap: 10px;
        min-height: 44px;
        align-items: flex-start;
        padding: 4px 0;
    }

    .checkbox-item input {
        width: 22px;
        height: 22px;
        flex-shrink: 0;
        margin-top: 1px;
    }

    .checkbox-item label {
        font-size: 0.88rem;
        line-height: 1.5;
    }

    /* Loading */
    .loading-spinner {
        width: 40px;
        height: 40px;
    }

    /* Google autocomplete touch targets */
    .pac-container {
        z-index: 9999 !important;
        max-width: calc(100vw - 24px) !important;
        border-radius: 8px !important;
        box-shadow: 0 4px 20px rgba(0, 0, 0, 0.15) !important;
        margin-top: 4px !important;
    }

    .pac-item {
        padding: 12px 14px !important;
        min-height: 44px !important;
    }
}

/* ---- Small phone (≤ 480px) ---- */
@media (max-width: 480px) {

    /* Passenger counter compact */
    .passenger-counter {
        padding: 16px 12px;
        gap: 16px;
    }

    .counter-value {
        font-size: 2.2rem;
        min-width: 50px;
    }

    .counter-btn {
        width: 46px;
        height: 46px;
        font-size: 1.2rem;
    }

    .counter-label {
        font-size: 0.8rem;
    }

    /* Vehicle grid — single column horizontal card layout */
    .vehicle-grid {
        grid-template-columns: 1fr;
        gap: 8px;
    }

    .vehicle-card {
        padding: 12px 14px;
        display: flex;
        align-items: center;
        gap: 12px;
        text-align: left;
    }

    .vehicle-card.recommended::before {
        top: 50%;
        transform: translateY(-50%);
        right: 10px;
    }

    .vehicle-icon {
        font-size: 1.5rem;
        margin-bottom: 0;
        flex-shrink: 0;
        width: 36px;
        text-align: center;
    }

    .vehicle-info {
        flex: 1;
        min-width: 0;
        display: flex;
        flex-direction: column;
        gap: 1px;
    }

    .vehicle-name {
        font-size: 0.88rem;
    }

    .vehicle-capacity {
        font-size: 0.72rem;
    }

    .vehicle-luggage {
        font-size: 0.68rem;
    }

    /* Ensure tick badge doesn't overlap text in horizontal layout */
    .vehicle-card.recommended {
        padding-right: 36px;
    }

    /* Toggle compact */
    .toggle-option {
        padding: 12px;
        gap: 2px 10px;
        border-radius: 10px;
    }

    .toggle-icon {
        font-size: 1.5rem;
    }

    .toggle-label {
        font-size: 0.88rem;
    }

    .toggle-desc {
        font-size: 0.75rem;
    }

    /* Timeline compact */
    .timeline-container::before {
        left: 14px;
    }

    .timeline-item {
        gap: 10px;
    }

    .marker-icon {
        width: 28px;
        height: 28px;
        font-size: 0.95rem;
    }

    .timeline-marker {
        width: 28px;
    }

    .timeline-label {
        font-size: 0.78rem;
        margin-bottom: 6px;
    }

    .stop-row-container {
        padding: 10px;
    }

    .btn-add-stop {
        padding: 12px 14px;
        font-size: 0.84rem;
    }

    .btn-add-stop .plus-icon {
        width: 22px;
        height: 22px;
        font-size: 1rem;
    }

    /* Summary compact */
    .trip-summary-card {
        padding: 14px;
    }

    .summary-item .summary-label {
        font-size: 0.78rem;
    }

    .summary-item .summary-value {
        font-size: 1.15rem;
    }

    /* Conditional fields compact */
    .conditional-fields {
        padding: 14px;
    }

    .checkbox-item label {
        font-size: 0.84rem;
    }

    .checkbox-item input {
        width: 20px;
        height: 20px;
    }
}

/* ---- Extra small (≤ 360px) ---- */
@media (max-width: 360px) {

    .counter-value {
        font-size: 1.8rem;
    }

    .counter-btn {
        width: 42px;
        height: 42px;
    }

    .toggle-option {
        padding: 10px;
        gap: 2px 8px;
    }

    .toggle-icon {
        font-size: 1.3rem;
    }

    .toggle-label {
        font-size: 0.82rem;
    }

    .toggle-desc {
        font-size: 0.72rem;
    }

    .vehicle-card {
        padding: 10px 12px;
        gap: 10px;
    }
}

/* ---- Landscape phone ---- */
@media (max-width: 768px) and (orientation: landscape) {

    .passenger-counter {
        padding: 12px 16px;
    }

    .counter-value {
        font-size: 2rem;
    }
}
