
@import url('https://fonts.googleapis.com/css2?family=Poppins:wght@300;400;600&display=swap');

:root {
    --accent: #06b6d4;
    --bg-start: #0f172a;
    --bg-end: #1e293b;
}

body {
    font-family: 'Poppins', sans-serif;
    text-align: center;
    color: #e2e8f0;
    background: radial-gradient(circle at 25% 25%, var(--bg-start), var(--bg-end) 60%, var(--bg-start));
    background-size: 400% 400%;
    animation: gradient-shift 15s ease infinite;
}

@keyframes gradient-shift {
    0% { background-position: 0% 50%; }
    50% { background-position: 100% 50%; }
    100% { background-position: 0% 50%; }
}

header {
    background: rgba(30, 64, 175, 0.85);
    backdrop-filter: blur(6px);
    color: white;
    padding: 20px;
    font-size: 24px;
    font-weight: bold;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    border-radius: 12px 12px 12px 12px;
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.4);
    border: 1px solid rgba(255,255,255,0.1);
}

.glass-card {
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 1rem;
    backdrop-filter: blur(12px);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.glass-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 10px 15px rgba(0, 0, 0, 0.3), 0 0 15px rgba(14, 165, 233, 0.5);
}

.glow-button {
    background: linear-gradient(90deg, var(--accent), #2563eb);
    color: white;
    padding: 0.75rem 1.5rem;
    border-radius: 0.75rem;
    box-shadow: 0 0 10px rgba(6, 182, 212, 0.5);
    transition: box-shadow 0.3s ease, transform 0.3s ease;
}

.glow-button:hover {
    box-shadow: 0 0 20px rgba(37, 99, 235, 0.7);
    transform: translateY(-2px);
}

#datePicker {
    padding: 12px;
    font-size: 18px;
    margin: 10px;
    border-radius: 8px;
    border: 1px solid #475569; /* gray-600 */
    background-color: #1e293b; /* gray-800 */
    color: white;
    box-shadow: 2px 2px 8px rgba(0, 0, 0, 0.3);
}

#reservation-grid {
    width: 90%;
    margin: auto;
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    grid-gap: 12px;
    padding: 20px;
    background: #1f2937; /* Tailwind gray-800 */
    box-shadow: 0px 4px 8px rgba(0, 0, 0, 0.4);
    border-radius: 10px;
}

.slot:hover {
    transform: scale(1.07);
    box-shadow: 3px 3px 10px rgba(0, 0, 0, 0.4);
}

.slot {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 1px;
    background: #4ade80; /* green-400 */
    color: white;
    font-size: 18px;
    font-weight: bold;
    border-radius: 8px;
    text-align: center;
    cursor: pointer;
    transition: all 0.3s ease-in-out;
    box-shadow: 2px 2px 6px rgba(0, 0, 0, 0.3);
}

.slot-content {
    display: flex;
    width: 100%;
    height: 100%;
}

.slot-image {
    width: 47%;
    height: 100%;
    background-size: cover;
    background-position: center;
    border-radius: 8px 0 0 8px;
}

.slot-text {
    width: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 10px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    margin-left: 10px;
}

.slot:not(.junior):not(.bapadel):not(.x7) .slot-content {
    justify-content: center;
    text-align: center;
    width: 100%;
}

.available {
    background-color: #22c55e; /* green-500 */
    color: white;
}
.available:hover {
    background-color: #16a34a; /* green-600 */
}

.reserved {
    background-color: #ef4444; /* red-500 */
    color: white;
}

.disabled {
    background-color: #64748b; /* gray-500 */
    color: white;
    pointer-events: none;
    text-decoration: line-through;
}

.selected {
    background-color: #facc15; /* yellow-400 */
    color: black;
}

.slot-cell {
    cursor: pointer;
}

.slot-cell.disabled {
    cursor: default;
}

.slot-cell.selected {
    background-color: #facc15 !important;
    color: black !important;
}

@media (max-width: 768px) {
    #reservation-grid {
        grid-template-columns: repeat(2, 1fr);
        grid-gap: 8px;
        padding: 10px;
    }

    .slot {
        padding: 10px;
        font-size: 16px;
    }

    .slot-image {
        width: 40%;
    }

    .slot-text {
        width: 60%;
        font-size: 14px;
    }
}

@media (max-width: 480px) {
    #reservation-grid {
        grid-template-columns: repeat(1, 1fr);
        grid-gap: 6px;
        padding: 5px;
    }

    .slot {
        padding: 8px;
        font-size: 14px;
    }

    .slot-image {
        width: 50%;
    }

    .slot-text {
        width: 50%;
        font-size: 12px;
    }
}

/* === Coach schedule table === */
#coachScheduleContainer {
    box-shadow: 0 6px 12px rgba(0, 0, 0, 0.4);
    border-radius: 8px;
    overflow: hidden;
    margin-top: 10px;
}

.schedule-table {
    border-collapse: separate;
    border-spacing: 6px;
    width: 100%;
    table-layout: fixed;
}

.schedule-table th,
.schedule-table td {
    border: none;
    padding: 6px 8px;
}

.schedule-table th {
    background: linear-gradient(90deg, #1e3a8a, #2563eb); /* gradient blue */
    color: #fff;
    text-transform: uppercase;
    font-size: 0.875rem;
    border-radius: 0.5rem;
}

.schedule-table tbody td {
    position: relative;
    border-radius: 0.5rem;
    overflow: hidden;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
    transition: transform 0.2s, box-shadow 0.2s;
    aspect-ratio: 1 / 1;
}

.schedule-table tbody td:hover {
    transform: scale(1.03);
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.3);
}

/* Status color variables and bar widths */
.schedule-table td.available {
    border: 2px solid #22c55e; /* green-500 */
    cursor: pointer;
    --status-color: #22c55e;
    --status-bar-width: 25%;
}

.schedule-table td.reserved {
    border: 2px solid #ef4444; /* red-500 */
    background-color: #ef4444;
    cursor: not-allowed;
    --status-color: #ef4444;
    --status-bar-width: 0;
}

.schedule-table td.disabled {
    border: 2px solid #64748b; /* gray-500 */
    filter: grayscale(1);
    cursor: not-allowed;
    --status-color: #64748b;
    --status-bar-width: 100%;
}

.schedule-table td.exception {
    border: 2px solid #b91c1c; /* red-700 */
    background-color: #b91c1c;
    color: #fff;
    cursor: not-allowed;
    --status-color: #b91c1c;
    --status-bar-width: 0;
}

.schedule-table td.selected {
    border: 2px solid #facc15 !important; /* yellow-400 */
    filter: none;
    --status-color: #facc15;
    --status-bar-width: 25%;
}

/* Center image occupying middle 50% with side color bars */
.schedule-table tbody td .slot-photo {
    position: absolute;
    top: 50%;
    left: 50%;
    width: 50%;
    transform: translate(-50%, -50%);
    object-fit: cover;
    border-radius: 0.25rem;
    pointer-events: none;
    z-index: 1;
}

/* Left and right color strips */
.schedule-table tbody td::before,
.schedule-table tbody td::after {
    content: "";
    position: absolute;
    top: 0;
    width: var(--status-bar-width, 0);
    height: 100%;
    background-color: var(--status-color, transparent);
    pointer-events: none;
    z-index: 0;
}

.schedule-table tbody td::before {
    left: 0;
    border-radius: 0.5rem 0 0 0.5rem;
}

.schedule-table tbody td::after {
    right: 0;
    border-radius: 0 0.5rem 0.5rem 0;
}

@media (max-width: 640px) {
    /* Keep cells usable on narrow screens by forcing a minimum width
       and allowing the table to scroll horizontally */
    .schedule-table {
        min-width: 575px;
    }

    .schedule-table th,
    .schedule-table td {
        padding: 10px 12px;
    }

    .schedule-table tbody td {
        font-size: 0.65rem;
        font-size: 0.8rem;
    }
}