/* ==================================================
   ENHANCED BOOKING CALENDAR & SLOT SELECTION
   ================================================== */

/* Make slot selection more visible and easier to use */
.slot-table {
    width: 100%;
    border-collapse: separate;
    border-spacing: 0;
    margin-top: 20px;
}

.slot-table thead th {
    background: linear-gradient(135deg, #2e7d32 0%, #1b5e20 100%);
    color: var(--chalk-white);
    padding: 12px 8px;
    text-align: left;
    font-weight: 700;
    font-size: 0.85rem;
    text-transform: uppercase;
    letter-spacing: 0.3px;
    border-bottom: 3px solid var(--turf-light);
}

.slot-table thead th:first-child {
    width: 30%;
    /* Time column */
}

.slot-table thead th:nth-child(2) {
    width: 20%;
    /* Price column */
}

.slot-table thead th:nth-child(3) {
    width: 35%;
    /* Type column */
}

.slot-table thead th:nth-child(4) {
    width: 8%;
    /* Status column */
    text-align: center;
}

.slot-table thead th:last-child {
    width: 7%;
    /* Select column */
    text-align: center;
}

.slot-table tbody tr {
    background: var(--bg-card);
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    cursor: pointer;
}

.slot-table tbody tr:hover {
    background: rgba(46, 125, 50, 0.1);
    transform: translateX(5px);
    box-shadow: 0 4px 15px rgba(46, 125, 50, 0.2);
    border-left: 4px solid var(--turf-light);
}

.slot-table tbody tr.selected {
    background: linear-gradient(90deg, rgba(46, 125, 50, 0.2) 0%, rgba(46, 125, 50, 0.05) 100%);
    border-left: 4px solid var(--turf-light);
    box-shadow: 0 4px 20px rgba(46, 125, 50, 0.3);
}

.slot-table tbody td {
    padding: 22px 8px;
    /* Increased from 14px for taller rows */
    color: var(--text-primary);
    font-size: 0.9rem;
    vertical-align: middle;
    white-space: normal;
    /* Allow text to wrap */
    overflow: visible;
    line-height: 1.6;
    /* More space between lines */
}

.slot-table tbody td:first-child {
    font-weight: 600;
    /* Time - bold */
    white-space: nowrap;
    /* Keep time on one line */
}

.slot-table tbody td:nth-child(2) {
    white-space: nowrap;
    /* Keep price on one line */
}

.slot-table tbody td:nth-child(3) {
    white-space: normal;
    /* Allow type to wrap */
    font-size: 0.85rem;
    line-height: 1.6;
}

/* Enhanced Radio Buttons */
.slot-table input[type="radio"] {
    appearance: none;
    -webkit-appearance: none;
    width: 28px;
    height: 28px;
    border: 3px solid var(--turf-green);
    border-radius: 50%;
    outline: none;
    cursor: pointer;
    position: relative;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    background: var(--bg-dark);
}

.slot-table input[type="radio"]:hover {
    border-color: var(--turf-light);
    transform: scale(1.15);
    box-shadow: 0 0 15px rgba(46, 125, 50, 0.5);
}

.slot-table input[type="radio"]:checked {
    border-color: var(--turf-light);
    background: linear-gradient(135deg, var(--turf-green) 0%, var(--turf-light) 100%);
    box-shadow: 0 0 20px rgba(46, 125, 50, 0.6), inset 0 0 10px rgba(255, 255, 255, 0.2);
    animation: radioSelect 0.4s cubic-bezier(0.68, -0.55, 0.265, 1.55);
}

.slot-table input[type="radio"]:checked::after {
    content: '✓';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    color: white;
    font-size: 16px;
    font-weight: bold;
    animation: checkIn 0.3s ease-out 0.1s both;
}

.slot-table input[type="radio"]:disabled {
    border-color: #555;
    background: #2a2a2a;
    cursor: not-allowed;
    opacity: 0.5;
}

@keyframes radioSelect {
    0% {
        transform: scale(1);
    }

    50% {
        transform: scale(1.3);
    }

    100% {
        transform: scale(1);
    }
}

@keyframes checkIn {
    0% {
        opacity: 0;
        transform: translate(-50%, -50%) scale(0);
    }

    100% {
        opacity: 1;
        transform: translate(-50%, -50%) scale(1);
    }
}

/* Status Dots */
.status-dot {
    display: inline-block;
    width: 14px;
    height: 14px;
    border-radius: 50%;
    animation: pulse 2s infinite;
}

.status-available {
    background: linear-gradient(135deg, #4caf50, #81c784);
    box-shadow: 0 0 10px rgba(76, 175, 80, 0.5);
}

.status-booked {
    background: linear-gradient(135deg, #f44336, #e57373);
    box-shadow: 0 0 10px rgba(244, 67, 54, 0.5);
    animation: none;
}

/* Make row clickable */
.slot-table tbody tr {
    position: relative;
}

.slot-table tbody tr td:last-child {
    text-align: right;
    padding-right: 20px;
}

/* Highlight selected row */
.slot-row:has(input[type="radio"]:checked) {
    background: linear-gradient(90deg, rgba(46, 125, 50, 0.25) 0%, rgba(46, 125, 50, 0.08) 100%) !important;
    border-left: 5px solid var(--turf-light) !important;
    box-shadow: 0 6px 25px rgba(46, 125, 50, 0.4) !important;
}

.slot-row:has(input[type="radio"]:checked) td {
    color: var(--chalk-white);
    font-weight: 600;
}

/* Floating slots section animation */
.slots-modal {
    display: none !important;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(135deg,
            rgba(0, 0, 0, 0.92) 0%,
            rgba(26, 28, 32, 0.95) 50%,
            rgba(0, 0, 0, 0.92) 100%);
    backdrop-filter: blur(15px) saturate(180%);
    -webkit-backdrop-filter: blur(15px) saturate(180%);
    z-index: 2000;
    justify-content: center;
    align-items: center;
    padding: 20px;
    animation: fadeIn 0.3s ease-out;
}

.slots-modal::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: radial-gradient(circle at 50% 50%,
            rgba(46, 125, 50, 0.15) 0%,
            transparent 70%);
    pointer-events: none;
}

.slots-modal.active {
    display: flex !important;
}

.slots-modal-content {
    background: var(--bg-card);
    border-radius: 20px;
    max-width: 1000px;
    width: 100%;
    max-height: 90vh;
    overflow: hidden;
    box-shadow: 0 20px 80px rgba(0, 0, 0, 0.5), 0 0 0 1px rgba(46, 125, 50, 0.3);
    animation: slideDown 0.4s cubic-bezier(0.68, -0.55, 0.265, 1.55);
    display: flex;
    flex-direction: column;
}

.slots-modal-header {
    background: linear-gradient(135deg, var(--turf-green) 0%, var(--turf-light) 100%);
    padding: 20px 25px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 15px;
    border-bottom: 3px solid var(--accent-orange);
}

.slots-modal-header #selected-date-display {
    color: white;
    font-weight: 700;
    font-size: 1.2rem;
    display: flex;
    align-items: center;
    gap: 10px;
    margin: 0;
    padding: 0;
    background: transparent;
    border: none;
}

.slots-modal-header #selected-date-display::before {
    content: '📅';
    font-size: 1.5rem;
}

.modal-close-btn {
    background: rgba(255, 255, 255, 0.2);
    border: 2px solid rgba(255, 255, 255, 0.3);
    color: white;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.2rem;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    flex-shrink: 0;
}

.modal-close-btn:hover {
    background: rgba(255, 255, 255, 0.3);
    transform: rotate(90deg) scale(1.1);
    box-shadow: 0 0 20px rgba(255, 255, 255, 0.4);
}

.slots-modal-body {
    padding: 30px;
    overflow-y: auto;
    overflow-x: hidden;
    flex: 1;
    -webkit-overflow-scrolling: touch;
    /* Smooth scrolling on iOS */
    position: relative;
}

@keyframes fadeIn {
    from {
        opacity: 0;
    }

    to {
        opacity: 1;
    }
}

@keyframes slideDown {
    from {
        opacity: 0;
        transform: translateY(-50px) scale(0.9);
    }

    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

/* Mobile modal adjustments */
@media (max-width: 768px) {
    .slots-modal {
        padding: 10px;
    }

    .slots-modal-content {
        max-height: 95vh;
        border-radius: 15px;
    }

    .slots-modal-header {
        padding: 15px 20px;
    }

    .slots-modal-header #selected-date-display {
        font-size: 1rem;
    }

    .modal-close-btn {
        width: 36px;
        height: 36px;
        font-size: 1rem;
    }

    .slots-modal-body {
        padding: 20px 15px;
        overflow-y: auto;
        overflow-x: hidden;
        /* No horizontal scroll */
        -webkit-overflow-scrolling: touch;
    }

    /* Table fits naturally without horizontal scroll */
    .slot-table {
        width: 100%;
        table-layout: fixed;
    }
}

@media (max-width: 575.98px) {
    .slots-modal {
        padding: 0;
    }

    .slots-modal-content {
        max-height: 100vh;
        height: 100vh;
        border-radius: 0;
        display: flex;
        flex-direction: column;
    }

    .slots-modal-header {
        padding: 15px;
        flex-shrink: 0;
        position: sticky;
        top: 0;
        z-index: 10;
    }

    .slots-modal-header #selected-date-display {
        font-size: 0.95rem;
    }

    .slots-modal-header #selected-date-display::before {
        font-size: 1.2rem;
    }

    .modal-close-btn {
        width: 34px;
        height: 34px;
    }

    .slots-modal-body {
        padding: 15px;
        overflow-y: auto;
        overflow-x: hidden;
        /* No horizontal scroll */
        -webkit-overflow-scrolling: touch;
        flex: 1;
        height: auto;
    }

    /* Table fits without horizontal scroll */
    .slot-table {
        width: 100%;
        table-layout: fixed;
        display: table;
    }
}


/* Book button enhancement */
#book-btn {
    margin-top: 25px;
    padding: 15px 40px;
    font-size: 1.1rem;
    font-weight: 700;
    background: linear-gradient(135deg, var(--turf-light) 0%, var(--turf-green) 100%);
    border: none;
    border-radius: 12px;
    color: white;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: 0 8px 25px rgba(46, 125, 50, 0.4);
    text-transform: uppercase;
    letter-spacing: 1px;
}

#book-btn:disabled {
    background: linear-gradient(135deg, #555 0%, #333 100%);
    cursor: not-allowed;
    opacity: 0.6;
    box-shadow: none;
}

#book-btn:not(:disabled):hover {
    transform: translateY(-3px);
    box-shadow: 0 12px 35px rgba(46, 125, 50, 0.6);
}

#book-btn:not(:disabled):active {
    transform: translateY(-1px);
}

/* Loading spinner */
.loading-spinner {
    display: inline-block;
    color: var(--turf-light);
    animation: spin 1s linear infinite;
}

@keyframes spin {
    0% {
        transform: rotate(0deg);
    }

    100% {
        transform: rotate(360deg);
    }
}

/* Responsive enhancements */
@media (max-width: 768px) {
    .slot-table {
        font-size: 0.85rem;
    }

    .slot-table thead th {
        padding: 10px 6px;
        font-size: 0.75rem;
    }

    .slot-table tbody td {
        padding: 12px 6px;
        font-size: 0.85rem;
    }

    .slot-table input[type="radio"] {
        width: 22px;
        height: 22px;
    }

    #selected-date-display {
        font-size: 1rem;
        padding: 12px 15px;
    }

    #book-btn {
        width: 100%;
        padding: 14px 30px;
    }

    /* Make table fit without horizontal scroll */
    .slot-table tbody td:nth-child(3) {
        font-size: 0.75rem;
        /* Smaller type text */
        line-height: 1.3;
    }
}

@media (max-width: 575.98px) {
    .slot-table {
        font-size: 0.8rem;
        width: 100%;
    }

    .slot-table thead th {
        padding: 10px 4px;
        font-size: 0.7rem;
    }

    .slot-table thead th:first-child {
        width: 32%;
        /* Time */
    }

    .slot-table thead th:nth-child(2) {
        width: 22%;
        /* Price */
    }

    .slot-table thead th:nth-child(3) {
        width: 30%;
        /* Type */
    }

    .slot-table thead th:nth-child(4) {
        width: 8%;
        /* Status */
    }

    .slot-table thead th:last-child {
        width: 8%;
        /* Select */
    }

    .slot-table tbody td {
        padding: 10px 4px;
        font-size: 0.75rem;
    }

    .slot-table tbody td:first-child {
        font-size: 0.75rem;
        /* Time */
    }

    .slot-table tbody td:nth-child(2) {
        font-size: 0.8rem;
        /* Price */
        font-weight: 600;
    }

    .slot-table tbody td:nth-child(3) {
        font-size: 0.65rem;
        /* Type - smallest */
        line-height: 1.2;
        white-space: normal;
    }

    .slot-table input[type="radio"] {
        width: 20px;
        height: 20px;
    }

    #slots-section {
        padding: 20px 15px;
    }

    /* MOBILE CARD LAYOUT */
    /* Hide table structure */
    .slot-table thead {
        display: none;
    }

    .slot-table,
    .slot-table tbody {
        display: block;
    }

    /* Transform rows into cards */
    .slot-table tbody tr {
        display: block;
        background: var(--bg-card);
        border: 2px solid rgba(46, 125, 50, 0.2);
        border-radius: 12px;
        margin-bottom: 15px;
        padding: 15px;
        padding-right: 50px;
        /* Space for radio */
        position: relative;
    }

    .slot-table tbody tr:hover,
    .slot-table tbody tr.selected {
        background: linear-gradient(135deg, rgba(46, 125, 50, 0.15), rgba(46, 125, 50, 0.05));
        border-color: var(--turf-light);
        box-shadow: 0 8px 25px rgba(46, 125, 50, 0.3);
        transform: none !important;
    }

    /* Reset table cells to blocks */
    .slot-table tbody td {
        display: block;
        padding: 0;
        margin: 0;
        border: none;
        text-align: left;
    }

    /* TIME - Large at top */
    .slot-table tbody td:first-child {
        font-size: 1.05rem !important;
        font-weight: 700 !important;
        color: var(--turf-light) !important;
        margin-bottom: 10px;
        padding-bottom: 10px;
        border-bottom: 1px solid rgba(46, 125, 50, 0.2);
        white-space: normal !important;
    }

    /* PRICE - Prominent */
    .slot-table tbody td:nth-child(2) {
        font-size: 1.2rem !important;
        font-weight: 800 !important;
        color: var(--chalk-white) !important;
        margin-bottom: 8px;
    }

    /* TYPE - Description */
    .slot-table tbody td:nth-child(3) {
        font-size: 0.85rem !important;
        color: var(--text-secondary) !important;
        line-height: 1.5 !important;
        margin-bottom: 10px;
    }

    /* STATUS - With label */
    .slot-table tbody td:nth-child(4) {
        display: inline-flex !important;
        align-items: center;
        gap: 8px;
        font-size: 0.85rem;
        margin-bottom: 0;
    }

    .slot-table tbody td:nth-child(4)::before {
        content: 'Status: ';
        color: var(--text-secondary);
    }

    /* RADIO - Top right corner */
    .slot-table tbody td:last-child {
        position: absolute;
        top: 15px;
        right: 15px;
    }

    .slot-table tbody td:last-child input[type="radio"] {
        width: 28px !important;
        height: 28px !important;
    }

    /* DISABLED/BOOKED SLOTS - Make it obvious they can't be selected */
    .slot-table tbody tr:has(input[type="radio"]:disabled) {
        opacity: 0.6;
        background: rgba(30, 30, 30, 0.5);
        border-color: rgba(244, 67, 54, 0.3);
        /* Red tint */
        cursor: not-allowed !important;
    }

    .slot-table tbody tr:has(input[type="radio"]:disabled):hover {
        background: rgba(30, 30, 30, 0.5);
        border-color: rgba(244, 67, 54, 0.3);
        box-shadow: none;
        transform: none !important;
    }

    /* Add BOOKED label to disabled slots */
    .slot-table tbody tr:has(input[type="radio"]:disabled) td:nth-child(4)::before {
        content: 'Status: ';
        color: var(--text-secondary);
    }

    .slot-table tbody tr:has(input[type="radio"]:disabled) td:nth-child(4)::after {
        content: ' BOOKED';
        color: #f44336;
        font-weight: 700;
        margin-left: 5px;
    }

    /* Dim text in booked slots */
    .slot-table tbody tr:has(input[type="radio"]:disabled) td {
        opacity: 0.7;
    }

    /* Hide radio button in booked slots or show disabled */
    .slot-table tbody tr:has(input[type="radio"]:disabled) td:last-child input {
        opacity: 0.4;
        cursor: not-allowed;
    }
}

/* Add click effect to entire row */
.slot-table tbody tr:not(:has(input[disabled])):active {
    transform: scale(0.98);
}

/* Peak time badge enhancement */
.slot-table tbody td span[style*="neon-pink"] {
    animation: glow 2s ease-in-out infinite;
}

@keyframes glow {

    0%,
    100% {
        box-shadow: 0 0 5px rgba(255, 0, 110, 0.5);
    }

    50% {
        box-shadow: 0 0 15px rgba(255, 0, 110, 0.8);
    }
}