/* ================================
   BOOKING HISTORY PAGE STYLES
   ================================ */

/* Wrapper */
.booking-history-wrapper {
    min-height: 100vh;
    background-color: var(--bs-gray-200);
    padding-bottom: var(--px-80);
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

/* Header */
.booking-history-header {
    background-color: var(--bg-card);
    position: sticky;
    top: 0;
    z-index: 100;
    border-bottom: 1px solid var(--border-color);
}

.header-content {
    padding: var(--px-16) var(--px-20);
    display: flex;
    align-items: center;
    justify-content: center;
    max-width: var(--px-800);
    margin: 0 auto;
    height: var(--px-80);
    padding-top: var(--px-36);
}

.btn-back-history {
    display: flex;
    align-items: center;
    color: var(--bg-btn);
    background: none;
    border: none;
    font-size: var(--px-15, 15px);
    font-weight: 500;
    cursor: pointer;
    padding: 0;
    transition: color var(--transition-fast);
    position: absolute;
    left: var(--px-12);
}

    .btn-back-history:hover {
        color: var(--hotel-primary);
    }

    .btn-back-history svg {
        width: var(--px-20);
        height: var(--px-20);
        margin-right: var(--px-4);
    }

.history-title {
    font-size: var(--px-18);
    font-weight: 600;
    color: var(--text-primary);
    margin: 0;
}

.header-spacer {
    width: var(--px-20);
    display: none;
}

/* Tabs */
.history-tabs {
    background-color: var(--bg-card);
    border-bottom: 1px solid var(--border-color);
    position: sticky;
    top: 0;
    z-index: 99;
    display: flex;
    max-width: var(--px-800);
    margin: 0 auto;
    width: 100%;
}

.history-tab {
    flex: 1;
    padding: var(--px-20) var(--px-12);
    font-size: var(--px-16);
    font-weight: 600;
    color: var(--text-secondary);
    background: none;
    border: none;
    border-bottom: 2px solid transparent;
    cursor: pointer;
    transition: all var(--transition-fast);
}

    .history-tab:hover {
        color: var(--text-primary);
        background: linear-gradient(180deg, transparent 0%, var(--bs-main-50) 100%);
    }

    .history-tab.active {
        color: var(--bg-btn);
        border-bottom-color: var(--bg-btn);
    }

/* Content Area */
.history-content {
    padding: var(--px-16) var(--px-12);
    max-width: var(--px-800);
    margin: 0 auto;
    width: 100%;
    flex: 1;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.tab-content {
    display: none;
}

    .tab-content.active {
        display: flex;
        flex-direction: column;
        gap: var(--px-16);
        overflow: hidden;
    }

.bookings-list {
    display: flex;
    flex-direction: column;
    gap: var(--px-16);
    overflow: auto;
}

/* Booking Card */
.booking-card {
    position: relative;
    background: var(--bg-card);
    border: 1px solid var(--border-light);
    border-radius: var(--px-16);
    overflow: hidden;
    box-shadow: none;
    transition: transform var(--transition-fast), box-shadow var(--transition-fast), border-color var(--transition-fast);
    min-height: max-content;
    border-width: 0 2px 0 2px;
}

    .booking-card::before {
        content: '';
        position: absolute;
        right: 0;
        top: 0;
        bottom: 0;
        width: var(--px-140);
        background: var(--bg-card);
    }

    .booking-card::after {
        content: '';
        position: absolute;
        top: var(--px-14);
        bottom: var(--px-14);
        right: var(--px-140);
        border-right: 1px dashed var(--border-light);
    }

    .booking-card:hover {
        box-shadow: var(--shadow-sm);
        transform: translateY(calc(-1 * var(--px-1)));
        border-color: var(--border-color);
    }

    .booking-card.current {
        background: var(--bg-card);
        border-color: var(--bs-gray-300);
    }

        .booking-card.current::before {
            background: var(--bg-card);
        }

    .booking-card.upcoming {
        background: var(--bg-card);
        border-color: var(--border-light);
    }

        .booking-card.upcoming::before {
            background: var(--bg-card);
        }

    .booking-card.complete {
        background: var(--bg-card);
        border-color: var(--border-light);
        opacity: 0.96;
    }

        .booking-card.complete::before {
            background: var(--bg-card);
        }

        .booking-card.complete .booking-room-type,
        .booking-card.complete .detail-value,
        .booking-card.complete .booking-room-number {
            text-decoration: line-through;
            text-decoration-thickness: var(--px-1);
            color: var(--text-secondary);
        }

.booking-card-content {
    position: relative;
    display: grid;
    grid-template-columns: 1fr var(--px-140);
    align-items: stretch;
    padding: var(--px-16) var(--px-20);
}

.booking-main-content {
    min-width: 0;
}

.booking-card-content::before,
.booking-card-content::after {
    content: '';
    position: absolute;
    right: calc(var(--px-140) - var(--px-10));
    width: var(--px-20);
    height: var(--px-20);
    border-radius: var(--radius-full);
    background: var(--bs-gray-200);
    z-index: 2;
}

.booking-card-content::before {
    top: calc(-1 * var(--px-10));
}

.booking-card-content::after {
    bottom: calc(-1 * var(--px-10));
}

/* Booking Header */
.booking-header {
    display: flex;
    justify-content: flex-start;
    align-items: flex-start;
    margin-bottom: var(--px-10);
}

.booking-info h3 {
    font-size: var(--px-18);
    font-weight: 600;
    color: var(--text-primary);
    margin: 0 0 var(--px-4) 0;
}

.booking-room-number {
    font-size: var(--px-14);
    color: var(--text-secondary);
    margin: 0;
}

/* Status Badge */
.status-badge {
    padding: var(--px-4) var(--px-8);
    border-radius: var(--radius-md);
    font-size: var(--px-12);
    font-weight: 600;
    white-space: nowrap;
    border: 1px solid var(--border-light);
}

    .status-badge.current {
        background-color: var(--bg-card);
        color: var(--hotel-primary-light);
        border-color: var(--bs-main-100);
    }

    .status-badge.upcoming {
        background-color: var(--bg-card);
        color: var(--text-secondary);
        border-color: var(--border-color);
    }

    .status-badge.complete {
        background-color: var(--bg-card);
        color: var(--text-secondary);
        border-color: var(--border-light);
    }

    .status-badge.cancel-requested {
        background: #fef2f2;
        color: #b91c1c;
        border-color: #fecaca;
        height: max-content;
        word-wrap: break-word;
        white-space: break-spaces;
    }

.booking-card.cancel-requested {
    border-left-color: #ef4444;
    background: linear-gradient(180deg, #fff1f2 0%, #fff5f5 100%);
}

    .booking-card.cancel-requested::before {
        background: linear-gradient(180deg, #fff1f2 0%, #fff5f5 100%);
    }

/* Booking Details Grid */
.booking-details-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: var(--px-12);
    margin-bottom: var(--px-16);
}

.detail-item .detail-label {
    font-size: var(--px-12);
    font-weight: 500;
    color: var(--text-secondary);
    margin: 0 0 var(--px-4) 0;
}

.detail-item .detail-value {
    font-size: var(--px-14);
    font-weight: 600;
    color: var(--text-primary);
    margin: 0;
}

/* Booking Footer */
.booking-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding-top: var(--px-12);
    border-top: 1px solid var(--border-light);
    gap: var(--px-10);
}

.booking-footer-amount-only {
    justify-content: flex-start;
}

.booking-side-panel {
    position: relative;
    z-index: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: space-between;
    min-height: 100%;
    padding-left: var(--px-44);
}

    .booking-side-panel .status-badge {
        max-width: 100%;
        text-align: center;
    }

    .booking-side-panel .btn-view-details {
        width: 100%;
    }

.booking-amount .amount-label {
    font-size: var(--px-12);
    font-weight: 500;
    color: var(--text-secondary);
    margin: 0 0 var(--px-4) 0;
}

.booking-amount .amount-value {
    font-size: var(--px-16);
    font-weight: 700;
    color: var(--text-primary);
    margin: 0;
}

.btn-view-details {
    padding: var(--px-8) var(--px-16);
    background-color: var(--bg-btn);
    color: var(--txt-btn);
    font-size: var(--px-14);
    font-weight: 500;
    border: none;
    border-radius: var(--radius-md);
    cursor: pointer;
    box-shadow: var(--shadow-sm);
    transition: all var(--transition-fast);
}

    .btn-view-details:hover {
        background-color: var(--hotel-primary);
        box-shadow: var(--shadow-soft);
        transform: translateY(calc(-1 * var(--px-1)));
    }

    .btn-view-details:active {
        transform: translateY(0);
    }

    .btn-view-details:focus-visible,
    .btn-retry:focus-visible,
    .history-tab:focus-visible,
    .btn-back-history:focus-visible {
        outline: 2px solid var(--hotel-primary-light);
        outline-offset: 2px;
    }

/* Loading State */
.loading-state {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: var(--px-60) var(--px-20);
    text-align: center;
}

.spinner {
    width: var(--px-40);
    height: var(--px-40);
    border: 3px solid var(--border-light);
    border-top-color: var(--bg-btn);
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
    margin-bottom: var(--px-16);
}

@keyframes spin {
    to {
        transform: rotate(360deg);
    }
}

.loading-state p {
    font-size: var(--px-14);
    color: var(--text-secondary);
    margin: 0;
}

/* Empty State */
.empty-state {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: var(--px-60) var(--px-20);
    text-align: center;
}

.empty-icon {
    width: var(--px-64);
    height: var(--px-64);
    color: var(--text-placeholder);
    margin-bottom: var(--px-16);
}

    .empty-icon svg {
        width: 100%;
        height: 100%;
    }

.empty-message {
    font-size: var(--px-16);
    font-weight: 600;
    color: var(--text-primary);
    margin: 0 0 var(--px-8) 0;
}

.empty-submessage {
    font-size: var(--px-14);
    color: var(--text-disabled);
    margin: 0;
}

/* Error State */
.error-state {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: var(--px-60) var(--px-20);
    text-align: center;
}

    .error-state svg {
        width: var(--px-64);
        height: var(--px-64);
        color: var(--color-error);
        margin-bottom: var(--px-16);
    }

.error-message {
    font-size: var(--px-16);
    font-weight: 600;
    color: var(--text-primary);
    margin: 0 0 var(--px-16) 0;
}

.btn-retry {
    padding: var(--px-10) var(--px-24);
    background-color: var(--bg-btn);
    color: var(--txt-btn);
    font-size: var(--px-14);
    font-weight: 500;
    border: none;
    border-radius: var(--radius-md);
    cursor: pointer;
    box-shadow: var(--shadow-sm);
    transition: all var(--transition-fast);
}

    .btn-retry:hover {
        background-color: var(--hotel-primary);
        box-shadow: var(--shadow-soft);
    }

/* ================================
   RESPONSIVE DESIGN
   ================================ */

/* Tablet */
@media (min-width: 640px) {
    .booking-history-header,
    .history-tabs,
    .history-content {
        padding-left: var(--px-24);
        padding-right: var(--px-24);
    }

    .history-title {
        font-size: var(--px-22);
    }

    .booking-card-content {
        grid-template-columns: 1fr var(--px-160);
        padding: var(--px-20) var(--px-20);
    }

    .booking-card::before {
        width: var(--px-160);
    }

    .booking-card::after {
        right: var(--px-160);
    }

    .booking-card-content::before,
    .booking-card-content::after {
        right: calc(var(--px-160) - var(--px-10));
    }

    .booking-info h3 {
        font-size: var(--px-20);
    }

    .booking-amount .amount-value {
        font-size: var(--px-18);
    }
}

/* Desktop */
@media (min-width: 768px) {
    .booking-history-wrapper {
        padding-bottom: 0;
    }

    .history-content {
        padding: var(--px-32) var(--px-24);
    }

    .bookings-list {
        gap: var(--px-20);
    }
}
