﻿.seat-overlay {
    position: fixed;
    inset: 0;
    display: flex;
    justify-content: center;
    align-items: center;
    background: rgba(0, 0, 0, 0.25);
    backdrop-filter: blur(5px);
    z-index: 9999;
    animation: seatFadeIn 0.3s ease;
    padding: 24px;
    box-sizing: border-box;
}

.seat-modal {
    font-family: -apple-system, "Segoe UI", Helvetica, Arial, sans-serif;
    width: min(600px, 90vw);
    max-width: 90%;
    height: auto;
    max-height: 90%;
    background: #fff;
    border-radius: 14px;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    box-shadow: 0 12px 40px rgba(0, 0, 0, 0.18);
    animation: seatPopup 0.3s ease;
}

/* ===== Header ===== */
.seat-modal-header {
    flex-shrink: 0;
    background: #0d6dbf;
    color: #fff;
    padding: 10px 24px 8px;
    display: flex;
    flex-direction: column;
    gap: 5px;
    box-sizing: border-box;
    border-top-left-radius: 12px;
    border-top-right-radius: 12px;
}

.seat-modal-header-top {
    display: flex;
    align-items: center;
    justify-content: space-between;
}

#seatSelectionModal {
    border-radius: 24px;
}

.seat-modal-title {
    font-size: 17px;
    font-weight: 500;
}

.seat-close-btn {
    width: 26px;
    height: 26px;
    border: none;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.15);
    color: #fff;
    font-size: 14px;
    line-height: 1;
    cursor: pointer;
    transition: 0.2s;
}

    .seat-close-btn:hover {
        background: rgba(255, 255, 255, 0.3);
    }

/* ===== Step indicator ===== */
.seat-steps {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
}

.seat-step {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 3px;
}

.step-circle {
    width: 17px;
    height: 17px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.25);
    color: #fff;
    font-size: 10px;
    font-weight: 700;
    display: flex;
    align-items: center;
    justify-content: center;
    
}

.seat-step.active .step-circle {
    background: #ffb020;
    color: #1a1a1a;
}

.step-label {
    font-size: 12px;
    color: rgba(255, 255, 255, 0.85);
    font-weight: 500;
}

.seat-step.active .step-label {
    color: #fff;
}

.step-line {
    width: 52px;
    height: 2px;
    background: rgba(255, 255, 255, 0.3);
    margin-top: -11px;
}

/* ===== Body ===== */
.seat-modal-body {
    padding: 10px 20px 14px;
    flex: 1;
    display: flex;
    flex-direction: column;
    min-height: 0;
    overflow-y: auto;
    box-sizing: border-box;
}

.seat-section-title {
    font-size: 18px;
    font-weight: 500;
    color: #1a1a1a;
    margin: 0 0 10px;
    flex-shrink: 0;
}

/* ===== Trip summary bar ===== */
.trip-summary-bar {
    flex-shrink: 0;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    flex-wrap: wrap;
    background: #f7f8fa;
    border-radius: 10px;
    padding: 11px 18px;
    margin-bottom: 8px;
    box-sizing: border-box;
}

.trip-summary-left {
    display: flex;
    flex-direction: column;
    gap: 3px;
}

.trip-summary-route {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 17px;
    font-weight: 500;
    color: #1a1a1a;
}

.trip-arrow {
    color: #0d6dbf;
}

.trip-meta {
    font-size: 13px;
    font-weight: 500;
    color: #666;
}

.trip-selected-count {
    font-size: 13px;
    font-weight: 600;
    color: #0d6dbf;
}

.trip-summary-price {
    font-size: 19px;
    font-weight: 500;
    color: #0d6dbf;
}

/* ===== Seat + legend row ===== */
.seat-layout-wrap {
    display: flex;
    justify-content: flex-start;
    align-items: flex-start;
    gap: 20px;
    flex-shrink: 0;
}

/* ===== Main seat window: fixed standard height, scrolls internally ===== */
.seat-grid {
    width: 310px;
    max-width: 310px;
    height: 300px;
    flex-shrink: 0;
    background: #f7f8fa;
    border: 2px solid #0d6dbf;
    border-radius: 12px;
    padding: 8px 14px;
    display: flex;
    flex-direction: column;
    gap: 5px;
    overflow-y: auto;
    box-sizing: border-box;
    scrollbar-width: none;
    -ms-overflow-style: none;
}


.seat-row-driver,
.seat-row-middle,
.seat-row-last {
    flex-shrink: 0;
}

.seat-row-driver,
.seat-row-middle {
    display: grid;
    grid-template-columns: 38px 38px 26px 38px 38px;
    column-gap: 7px;
    justify-content: center;
    align-items: center;
}

.seat-row-driver {
    padding-bottom: 2px;
}

.seat-row-last {
    display: grid;
    grid-template-columns: repeat(5, 38px);
    column-gap: 11px;
    justify-content: center;
    align-items: center;
    margin-top: 2px;
}

.seat-aisle-right {
    grid-column: 2;
}

.seat-row-middle > .seat:nth-child(3) {
    grid-column: 4;
}

.seat-row-middle > .seat:nth-child(4) {
    grid-column: 5;
}

/* ===== Seat button ===== */
.seat {
    width: 40px;
    height: 40px;
    border-radius: 0;
    border: none;
    background: none;
    padding: 0;
    cursor: pointer;
    transition: transform 0.12s ease, opacity 0.12s ease;
    flex-shrink: 0;
    display: flex;
    align-items: center;
    justify-content: center;
}

    .seat:hover:not(:disabled) {
        transform: scale(1.08);
    }

    .seat:disabled {
        cursor: not-allowed;
    }

.seat-icon-wrap {
    position: relative;
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
}

.seat-icon-img {
    width: 100%;
    height: 100%;
    object-fit: contain;
    display: block;
}

.seat-available .seat-icon-img {
    filter: invert(45%);
}

/* number overlay — white badge guarantees contrast on ANY seat icon color
   (available, selected, male, female) instead of relying on text color alone */
.seat-number {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 14px;
    height: 14px;
    border-radius: 50%;
    background: #f7f8fa;
    /* box-shadow: 0 0 0 1px rgba(0, 0, 0, 0.15); */
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 9px;
    font-weight: 750;
    color: #1a1a1a;
    pointer-events: none;
}

/* seat #2 — conductor seat, shows a small icon instead of a number */
.seat-conductor-icon {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 14px;
    height: 14px;
    object-fit: contain;
    pointer-events: none;
}

/* ===== Driver icon ===== */
.driver-icon-img {
    width: 26px;
    height: 26px;
    object-fit: contain;
    grid-column: 5;
}

/* ===== Right side panel ===== */
.seat-side-panel {
    width: 210px;
    height: 300px;
    overflow-y: auto;
    justify-content: space-between;
    flex-shrink: 0;
    background: #f7f8fa;
    border-radius: 12px;
    padding: 12px;
    box-sizing: border-box;
    display: flex;
    flex-direction: column;
    gap: 14px;
    align-self: flex-start;
}

.seat-legend-card,
.seat-totals-card {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.legend-title {
    font-size: 15px;
    font-weight: 600;
    color: #1a1a1a;
    margin-bottom: 2px;
}

.legend-grid {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.legend-item {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 14px;
    color: #444;
    font-weight: 500;
}

.legend-dot {
    width: 12px;
    height: 12px;
    border-radius: 3px;
    flex-shrink: 0;
}

.legend-female {
    background: #ec1e79;
}

.legend-male {
    background: #0d6dbf;
}

.legend-selected {
    background: #ffb020;
}

.legend-available {
    background: #b9bfc8;
}

.seat-totals {
    margin-top: 4px;
    background: #fff;
    border-radius: 8px;
    padding: 9px 11px;
    display: flex;
    flex-direction: column;
    gap: 5px;
}

.seat-totals-row {
    display: flex;
    justify-content: space-between;
    font-size: 13px;
    color: #444;
    font-weight: 500;
}

.seat-totals-grand {
    font-size: 14px;
    font-weight: 500;
    color: #0d6dbf;
    border-top: 1px solid #e2e6ea;
    padding-top: 5px;
}

.confirm-booking-btn {
    width: 100%;
    padding: 9px;
    border: none;
    border-radius: 8px;
    background: #0d6dbf;
    color: #fff;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: 0.2s;
}

    .confirm-booking-btn:hover:not(:disabled) {
        opacity: 0.9;
    }

    .confirm-booking-btn:disabled {
        background: #c7ccd1;
        cursor: not-allowed;
    }

/* ===== Responsive ===== */
@media (max-width: 800px) {
    .seat-layout-wrap {
        flex-direction: column;
        align-items: center;
    }

    /* aside khud "disappear" ho jata hai (box nahi banta), taake iske andar
       ke dono cards (legend / totals) grid ke sath direct flex items ban k
       order se upar-neeche ho saken */
    .seat-side-panel {
        display: contents;
    }

    .seat-legend-card {
        order: -1;
        width: 100%;
        background: #f7f8fa;
        border-radius: 12px;
        padding: 12px;
        box-sizing: border-box;
    }

    .seat-totals-card {
        order: 1;
        width: 100%;
        background: #f7f8fa;
        border-radius: 12px;
        padding: 12px;
        box-sizing: border-box;
    }

    /* Female+Male aik row, Selected+Available doosri row */
    .legend-grid {
        flex-direction: row;
        flex-wrap: wrap;
        gap: 8px 20px;
    }

    .legend-item {
        flex: 1 1 calc(50% - 10px);
    }

    .seat-grid {
        width: 100%;
        max-width: 100%;
        height: 250px;
    }
}

@media (max-width: 480px) {
    .seat-row-driver,
    .seat-row-middle {
        grid-template-columns: 32px 32px 22px 32px 32px;
        column-gap: 5px;
    }

    .seat-row-last {
        grid-template-columns: repeat(5, 32px);
        column-gap: 7px;
    }

    .seat {
        width: 32px;
        height: 32px;
    }
}

@keyframes seatFadeIn {
    from {
        opacity: 0;
    }

    to {
        opacity: 1;
    }
}

@keyframes seatPopup {
    from {
        opacity: 0;
        transform: translateY(15px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}
