﻿/* ============================================================
   booking.css — Future Trainings Table
   Designed to work alongside Bootstrap 4/5 and Themify Icons
   ============================================================ */


/* ----------------------------------------------------------
   CSS Variables — edit these to retheme the whole table
   ---------------------------------------------------------- */
:root {
    --booking-accent: #3b82f6; /* calendar badge top border & day number */
    --booking-accent-dark: #185fa5; /* day number text */
    --booking-header-bg: #3b82f6; /* thead background (amber/warning) */
    --booking-header-text: #ffffff;
    --booking-row-hover: #f8fafc;
    --booking-border: #e2e8f0;
    --booking-border-light: #f1f5f9;
    --booking-text-primary: #1e293b;
    --booking-text-muted: #64748b;
    --booking-text-subtle: #94a3b8;
    /* Places badge colours */
    --booking-ok-bg: #e1f5ee;
    --booking-ok-text: #0f6e56;
    --booking-low-bg: #faeeda;
    --booking-low-text: #854f0b;
    --booking-full-bg: #fcebeb;
    --booking-full-text: #791f1f;
    /* Book Now button */
    --booking-btn-bg: #16a34a;
    --booking-btn-hover: #15803d;
    --booking-btn-text: #ffffff;
}


/* ----------------------------------------------------------
   Table wrapper — optional scroll container for small screens
   ---------------------------------------------------------- */
.booking-table-wrapper {
    width: 100%;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    border-radius: 8px;
    border: 1px solid var(--booking-border);
}


/* ----------------------------------------------------------
   Base table
   ---------------------------------------------------------- */
#tbFutureTrainings {
    width: 100%;
    border-collapse: collapse;
    font-size: 13.5px;
    color: var(--booking-text-primary);
    background: #ffffff;
}


    /* ----------------------------------------------------------
   Header
   ---------------------------------------------------------- */
    #tbFutureTrainings thead {
        background-color: var(--booking-header-bg);
    }

        #tbFutureTrainings thead th {
            padding: 11px 14px;
            font-size: 12px;
            font-weight: 600;
            text-transform: uppercase;
            letter-spacing: 0.05em;
            color: var(--booking-header-text);
            border: none;
            white-space: nowrap;
            background-color: var(--booking-header-bg);
        }


    /* ----------------------------------------------------------
   Body cells
   ---------------------------------------------------------- */
    #tbFutureTrainings tbody td {
        padding: 12px 14px;
        border-bottom: 1px solid var(--booking-border-light);
        vertical-align: middle;
        color: var(--booking-text-primary);
    }

    #tbFutureTrainings tbody tr:last-child td {
        border-bottom: none;
    }

    #tbFutureTrainings tbody tr:hover td {
        background-color: var(--booking-row-hover);
    }


/* ----------------------------------------------------------
   Column: Course name
   ---------------------------------------------------------- */
.booking-course-name {
    font-weight: 600;
    font-size: 14px;
    color: var(--booking-text-primary);
    line-height: 1.4;
}


/* ----------------------------------------------------------
   Column: Date — calendar badge
   ---------------------------------------------------------- */
.booking-date-badge {
    display: inline-flex;
    flex-direction: column;
    align-items: center;
    background: #f8fafc;
    border: 1px solid var(--booking-border);
    border-top: 3px solid var(--booking-accent);
    border-radius: 6px;
    padding: 6px 14px;
    min-width: 80px;
    line-height: 1.3;
    text-align: center;
}

.booking-date-day {
    font-size: 24px;
    font-weight: 700;
    color: var(--booking-accent-dark);
    line-height: 1;
}

.booking-date-month {
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: var(--booking-text-muted);
    margin-top: 1px;
}

.booking-date-time {
    font-size: 11px;
    color: var(--booking-text-muted);
    margin-top: 5px;
    padding-top: 5px;
    border-top: 1px solid var(--booking-border);
    width: 100%;
    text-align: center;
    white-space: nowrap;
}


/* ----------------------------------------------------------
   Column: Location + postcode
   ---------------------------------------------------------- */
.booking-location-name {
    font-size: 13.5px;
    color: var(--booking-text-primary);
    line-height: 1.4;
}

.booking-location-postcode {
    display: flex;
    align-items: center;
    gap: 3px;
    font-size: 11.5px;
    color: var(--booking-text-muted);
    margin-top: 3px;
}

    .booking-location-postcode .ti-location-pin {
        font-size: 11px;
        color: var(--booking-text-subtle);
    }


/* ----------------------------------------------------------
   Column: Duration
   ---------------------------------------------------------- */
.booking-duration {
    font-size: 13px;
    color: var(--booking-text-muted);
    white-space: nowrap;
}


/* ----------------------------------------------------------
   Column: Places — availability badge
   ---------------------------------------------------------- */
.booking-places {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 3px 10px;
    border-radius: 99px;
    font-size: 12px;
    font-weight: 600;
    white-space: nowrap;
}

.booking-places--ok {
    background-color: var(--booking-ok-bg);
    color: var(--booking-ok-text);
}

.booking-places--low {
    background-color: var(--booking-low-bg);
    color: var(--booking-low-text);
}

.booking-places--full {
    background-color: var(--booking-full-bg);
    color: var(--booking-full-text);
}


/* ----------------------------------------------------------
   Column: Price
   ---------------------------------------------------------- */
.booking-price {
    font-size: 14px;
    font-weight: 600;
    color: var(--booking-text-primary);
    white-space: nowrap;
}


/* ----------------------------------------------------------
   Column: Actions
   ---------------------------------------------------------- */
.booking-btn-book {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    background-color: var(--booking-btn-bg);
    color: var(--booking-btn-text);
    border: none;
    border-radius: 6px;
    padding: 7px 14px;
    font-size: 13px;
    font-weight: 500;
    cursor: pointer;
    text-decoration: none;
    white-space: nowrap;
    transition: background-color 0.15s ease, transform 0.1s ease;
}

    .booking-btn-book:hover {
        background-color: var(--booking-btn-hover);
        color: var(--booking-btn-text);
        text-decoration: none;
    }

    .booking-btn-book:active {
        transform: scale(0.97);
    }

.booking-fully-booked {
    font-size: 12px;
    font-weight: 500;
    color: var(--booking-full-text);
    background-color: var(--booking-full-bg);
    padding: 4px 10px;
    border-radius: 99px;
    white-space: nowrap;
}


/* ----------------------------------------------------------
   Empty state row
   ---------------------------------------------------------- */
#tbFutureTrainings .booking-empty td {
    padding: 28px 14px;
    text-align: center;
    color: var(--booking-text-muted);
    font-size: 14px;
    font-style: italic;
}


/* ----------------------------------------------------------
   Responsive — stack date badge on very small screens
   ---------------------------------------------------------- */
@media (max-width: 640px) {
    #tbFutureTrainings thead th,
    #tbFutureTrainings tbody td {
        padding: 8px 10px;
        font-size: 12px;
    }

    .booking-date-day {
        font-size: 18px;
    }

    .booking-date-badge {
        min-width: 64px;
        padding: 5px 10px;
    }
}
