/* Booking History Page Styles */

.page-content {
    padding: 40px 0;
}

/* Page Header */
.page-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 40px;
    flex-wrap: wrap;
    gap: 20px;
}

.page-header h1 {
    font-size: 42px;
    font-weight: 800;
    margin-bottom: 8px;
    color: #000000;
    letter-spacing: -1px;
}

.subtitle {
    font-size: 16px;
    color: #666666;
    font-weight: 400;
}

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

/* Filter Tabs */
.filter-tabs {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
    margin-bottom: 30px;
    border-bottom: 2px solid #e0e0e0;
    padding-bottom: 10px;
}

.filter-tab {
    padding: 12px 20px;
    border: none;
    background: transparent;
    border-radius: 8px 8px 0 0;
    cursor: pointer;
    font-weight: 600;
    font-size: 14px;
    transition: all 0.2s;
    display: flex;
    align-items: center;
    gap: 8px;
    color: #666666;
    font-family: 'Inter', sans-serif;
}

.filter-tab:hover {
    background: #f5f5f5;
    color: #000000;
}

.filter-tab.active {
    background: #000000;
    color: white;
    border-bottom: 2px solid #000000;
}

.filter-tab i {
    font-size: 16px;
}

/* Search and Sort Section */
.search-sort-section {
    display: flex;
    gap: 15px;
    margin-bottom: 30px;
    flex-wrap: wrap;
}

.search-box {
    flex: 1;
    min-width: 250px;
    position: relative;
    display: flex;
    align-items: center;
}

.search-box i {
    position: absolute;
    left: 16px;
    color: #666666;
    font-size: 18px;
}

.search-box input {
    width: 100%;
    padding: 14px 16px 14px 45px;
    border: 1px solid #e0e0e0;
    border-radius: 8px;
    font-size: 15px;
    font-family: 'Inter', sans-serif;
    transition: all 0.3s;
}

.search-box input:focus {
    outline: none;
    border-color: #000000;
    box-shadow: 0 0 0 3px rgba(0,0,0,0.05);
}

.sort-select {
    padding: 14px 16px;
    border: 1px solid #e0e0e0;
    border-radius: 8px;
    font-size: 15px;
    font-family: 'Inter', sans-serif;
    background: white;
    cursor: pointer;
    min-width: 180px;
}

.sort-select:focus {
    outline: none;
    border-color: #000000;
}

/* Stats Section */
.stats-section {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 20px;
    margin-bottom: 40px;
}

.stat-card {
    background: white;
    padding: 24px;
    border-radius: 12px;
    border: 1px solid #e0e0e0;
    display: flex;
    align-items: center;
    gap: 16px;
    transition: all 0.2s;
}

.stat-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0,0,0,0.08);
}

.stat-icon {
    width: 56px;
    height: 56px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 24px;
}

.pending-bg { background: #fef3c7; }
.pending-color { color: #92400e; }
.confirmed-bg { background: #dbeafe; }
.confirmed-color { color: #1e40af; }
.delivered-bg { background: #d1fae5; }
.delivered-color { color: #065f46; }
.total-bg { background: #f3f4f6; }
.total-color { color: #1f2937; }

.stat-info {
    flex: 1;
}

.stat-value {
    font-size: 28px;
    font-weight: 800;
    color: #000000;
    line-height: 1;
    margin-bottom: 6px;
}

.stat-label {
    font-size: 13px;
    color: #666666;
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

/* Loading State */
.loading-state {
    text-align: center;
    padding: 80px 20px;
}

.spinner {
    border: 3px solid #f3f3f3;
    border-top: 3px solid #000000;
    border-radius: 50%;
    width: 50px;
    height: 50px;
    animation: spin 1s linear infinite;
    margin: 0 auto 20px;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

.loading-state p {
    font-size: 16px;
    color: #666666;
    font-weight: 500;
}

/* Empty State */
.empty-state {
    text-align: center;
    padding: 80px 20px;
}

/* FIX: Targets ONLY the top level icon, leaves button icons alone */
.empty-state > i {
    font-size: 80px;
    color: #e0e0e0;
    margin-bottom: 24px;
    display: block;
}

/* FIX: Reset button icons */
.empty-state a i, 
.empty-state button i {
    font-size: inherit;
    color: inherit;
    margin-bottom: 0;
    display: inline-block;
}

/* FIX: Ensure empty state buttons use flexbox */
.empty-state .btn-primary,
.empty-state .btn-secondary {
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
    gap: 8px !important;
    margin-top: 15px;
    width: auto;
}

.empty-state h2 {
    font-size: 28px;
    font-weight: 700;
    color: #000000;
    margin-bottom: 12px;
}

.empty-state p {
    font-size: 16px;
    color: #666666;
    margin-bottom: 30px;
}

/* Bookings List */
.bookings-list {
    display: grid;
    gap: 20px;
}

.booking-card {
    background: white;
    padding: 28px;
    border-radius: 12px;
    border: 1px solid #e0e0e0;
    transition: all 0.2s;
}

.booking-card:hover {
    box-shadow: 0 6px 20px rgba(0,0,0,0.08);
    transform: translateY(-2px);
}

.booking-card-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 20px;
    flex-wrap: wrap;
    gap: 15px;
}

.booking-card-title h3 {
    font-size: 22px;
    font-weight: 700;
    color: #000000;
    margin-bottom: 6px;
}

.booking-reference {
    font-size: 13px;
    color: #666666;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 6px;
}

.booking-reference i {
    font-size: 14px;
}

.booking-status {
    padding: 8px 16px;
    border-radius: 6px;
    font-size: 12px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    display: inline-block;
}

.status-pending {
    background: #fef3c7;
    color: #92400e;
}

.status-confirmed {
    background: #dbeafe;
    color: #1e40af;
}

.status-processing {
    background: #e0e7ff;
    color: #3730a3;
}

.status-delivered {
    background: #d1fae5;
    color: #065f46;
}

.status-cancelled {
    background: #fee2e2;
    color: #991b1b;
}

.booking-card-body {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 20px;
    margin-bottom: 20px;
}

.booking-detail-item {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.detail-label {
    font-size: 12px;
    color: #666666;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    display: flex;
    align-items: center;
    gap: 6px;
}

.detail-label i {
    font-size: 16px;
    color: #000000;
}

.detail-value {
    font-size: 15px;
    color: #000000;
    font-weight: 600;
}

.booking-special-message {
    background: #f9fafb;
    padding: 16px;
    border-radius: 8px;
    border-left: 4px solid #000000;
    margin-bottom: 20px;
}

.booking-special-message .message-label {
    font-size: 12px;
    color: #666666;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 8px;
    display: flex;
    align-items: center;
    gap: 6px;
}

.booking-special-message .message-text {
    font-size: 14px;
    color: #000000;
    font-style: italic;
    line-height: 1.6;
}

.booking-card-actions {
    display: flex;
    gap: 12px;
    flex-wrap: wrap;
}

.btn-view {
    background: #000000;
    color: white;
    padding: 12px 24px;
    border: none;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
    display: flex;
    align-items: center;
    gap: 8px;
    font-family: 'Inter', sans-serif;
}

.btn-view:hover {
    background: #333333;
    transform: translateY(-1px);
}

.btn-cancel-booking {
    background: #dc2626;
    color: white;
    padding: 12px 24px;
    border: none;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
    display: flex;
    align-items: center;
    gap: 8px;
    font-family: 'Inter', sans-serif;
}

.btn-cancel-booking:hover {
    background: #b91c1c;
    transform: translateY(-1px);
}

/* Modal Styles */
.modal-small {
    max-width: 500px;
}

.modal-header {
    display: flex;
    align-items: center;
    gap: 16px;
    margin-bottom: 20px;
}

.warning-icon {
    font-size: 48px;
    color: #dc2626;
}

.modal-header h2 {
    font-size: 28px;
    font-weight: 700;
    color: #000000;
    margin: 0;
}

.modal-text {
    font-size: 16px;
    color: #666666;
    margin-bottom: 20px;
    line-height: 1.6;
}

.alert-warning {
    background: #fef3c7;
    border: 1px solid #fde68a;
    padding: 16px;
    border-radius: 8px;
    display: flex;
    gap: 12px;
    align-items: flex-start;
    margin-bottom: 24px;
}

.alert-warning i {
    font-size: 24px;
    color: #92400e;
    flex-shrink: 0;
}

.alert-warning strong {
    display: block;
    color: #92400e;
    font-weight: 700;
    margin-bottom: 6px;
}

.alert-warning p {
    font-size: 14px;
    color: #78350f;
    margin: 0;
    line-height: 1.5;
}

.modal-actions {
    display: flex;
    gap: 12px;
    justify-content: flex-end;
    flex-wrap: wrap;
}

/* Booking Details Modal */
#bookingDetails h2 {
    font-size: 32px;
    font-weight: 700;
    color: #000000;
    margin-bottom: 30px;
    display: flex;
    align-items: center;
    gap: 12px;
}

.details-section {
    background: #f9fafb;
    padding: 24px;
    border-radius: 12px;
    margin-bottom: 24px;
}

.details-section-title {
    font-size: 18px;
    font-weight: 700;
    color: #000000;
    margin-bottom: 20px;
    padding-bottom: 12px;
    border-bottom: 2px solid #e0e0e0;
}

.details-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 20px;
}

.detail-row {
    display: flex;
    justify-content: space-between;
    padding: 12px 0;
    border-bottom: 1px solid #e0e0e0;
}

.detail-row:last-child {
    border-bottom: none;
}

.detail-row-label {
    font-size: 14px;
    color: #666666;
    font-weight: 600;
}

.detail-row-value {
    font-size: 14px;
    color: #000000;
    font-weight: 600;
    text-align: right;
}

.total-amount {
    background: #000000;
    color: white;
    padding: 20px;
    border-radius: 8px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: 24px;
    font-size: 24px;
    font-weight: 800;
}

/* Responsive */
@media (max-width: 768px) {
    .page-header {
        flex-direction: column;
        align-items: stretch;
    }

    .header-actions {
        width: 100%;
        flex-direction: column;
    }

    .header-actions button,
    .header-actions a {
        width: 100%;
        justify-content: center;
    }

    .filter-tabs {
        overflow-x: auto;
        flex-wrap: nowrap;
        scrollbar-width: thin;
    }

    .filter-tab {
        white-space: nowrap;
    }

    .search-sort-section {
        flex-direction: column;
    }

    .search-box,
    .sort-select {
        width: 100%;
    }

    .stats-section {
        grid-template-columns: repeat(2, 1fr);
    }

    .booking-card {
        padding: 20px;
    }

    .booking-card-body {
        grid-template-columns: 1fr;
    }

    .booking-card-actions {
        flex-direction: column;
    }

    .btn-view,
    .btn-cancel-booking {
        width: 100%;
        justify-content: center;
    }

    .modal-actions {
        flex-direction: column;
    }

    .modal-actions button {
        width: 100%;
    }
}

@media (max-width: 480px) {
    .page-header h1 {
        font-size: 32px;
    }

    .stats-section {
        grid-template-columns: 1fr;
    }

    .stat-value {
        font-size: 24px;
    }
}