* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
    background: #f5f5f5;
    color: #333;
    min-height: 100vh;
}

header {
    background: #1a1a2e;
    color: #fff;
    padding: 1rem 1.5rem;
}

#header-top {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 0.75rem;
}

header h1 {
    font-size: 1.3rem;
}

#reserve-btn {
    padding: 0.5rem 1.25rem;
    background: #e94560;
    color: #fff;
    border: none;
    border-radius: 4px;
    font-size: 0.9rem;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.15s, transform 0.1s;
}

#reserve-btn:hover {
    background: #d63350;
}

#reserve-btn:active {
    transform: scale(0.97);
}

#reserve-btn.hidden {
    display: none;
}

#controls {
    display: flex;
    flex-wrap: wrap;
    gap: 0.75rem;
    align-items: center;
    justify-content: space-between;
}

#location-tabs {
    display: flex;
    gap: 0.5rem;
}

.loc-tab {
    padding: 0.4rem 1rem;
    border: 1px solid rgba(255,255,255,0.3);
    border-radius: 4px;
    background: transparent;
    color: #fff;
    cursor: pointer;
    font-size: 0.85rem;
    transition: background 0.15s;
}

.loc-tab:hover {
    background: rgba(255,255,255,0.1);
}

.loc-tab.active {
    background: #e94560;
    border-color: #e94560;
}

#duration-filters {
    display: flex;
    gap: 0.35rem;
}

.dur-btn {
    padding: 0.35rem 0.75rem;
    border: 1px solid rgba(255,255,255,0.3);
    border-radius: 4px;
    background: transparent;
    color: #fff;
    cursor: pointer;
    font-size: 0.8rem;
    transition: background 0.15s;
}

.dur-btn:hover {
    background: rgba(255,255,255,0.1);
}

.dur-btn.active {
    background: #0f3460;
    border-color: #0f3460;
}

/* Day navigation */
#day-nav {
    display: flex;
    overflow-x: auto;
    gap: 0.25rem;
    padding: 0.75rem 1.5rem;
    background: #fff;
    border-bottom: 1px solid #ddd;
}

.day-btn {
    flex-shrink: 0;
    padding: 0.4rem 0.75rem;
    border: 1px solid #ddd;
    border-radius: 4px;
    background: #fff;
    cursor: pointer;
    font-size: 0.8rem;
    text-align: center;
    line-height: 1.3;
    transition: background 0.15s;
}

.day-btn:hover {
    background: #f0f0f0;
}

.day-btn.active {
    background: #1a1a2e;
    color: #fff;
    border-color: #1a1a2e;
}

.day-btn .day-name {
    display: block;
    font-weight: 600;
    font-size: 0.75rem;
}

.day-btn .day-date {
    display: block;
    font-size: 0.7rem;
    opacity: 0.7;
}

/* Error banner */
#error-banner {
    background: #ffe0e0;
    color: #c00;
    padding: 0.75rem 1.5rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

#error-banner.hidden {
    display: none;
}

#error-retry {
    padding: 0.3rem 0.75rem;
    background: #c00;
    color: #fff;
    border: none;
    border-radius: 4px;
    cursor: pointer;
}

/* Loading */
#loading {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.75rem;
    padding: 3rem;
    color: #888;
}

#loading.hidden {
    display: none;
}

.spinner {
    width: 24px;
    height: 24px;
    border: 3px solid #ddd;
    border-top-color: #1a1a2e;
    border-radius: 50%;
    animation: spin 0.7s linear infinite;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

/* Availability grid */
#grid-container {
    padding: 1rem 1.5rem;
    overflow-x: auto;
}

.availability-table {
    border-collapse: collapse;
    width: 100%;
    min-width: 600px;
    font-size: 0.8rem;
}

.availability-table th,
.availability-table td {
    border: 1px solid #ddd;
    text-align: center;
    padding: 0.3rem 0.2rem;
    white-space: nowrap;
}

.availability-table thead th {
    background: #1a1a2e;
    color: #fff;
    position: sticky;
    top: 0;
    z-index: 2;
    font-weight: 500;
    font-size: 0.75rem;
}

.availability-table tbody th {
    background: #f8f8f8;
    font-weight: 600;
    position: sticky;
    left: 0;
    z-index: 1;
    min-width: 100px;
    text-align: left;
    padding-left: 0.5rem;
}

.slot {
    min-width: 55px;
    font-size: 0.7rem;
    transition: opacity 0.15s;
}

.slot.available {
    background: #d4edda;
    color: #155724;
    font-weight: 500;
    cursor: pointer;
}

.slot.available:hover {
    background: #b8e6c8;
}

.slot.selected {
    background: #e94560;
    color: #fff;
    outline: 2px solid #e94560;
    outline-offset: -1px;
}

.slot.selected .price {
    color: rgba(255,255,255,0.85);
}

.slot.booked {
    background: #e9e9e9;
    color: #999;
}

.slot.dim {
    opacity: 0.15;
}

.slot .price {
    display: block;
    font-size: 0.65rem;
}

/* Responsive */
@media (max-width: 640px) {
    header h1 {
        font-size: 1.1rem;
    }

    #controls {
        flex-direction: column;
        align-items: flex-start;
    }

    #grid-container {
        padding: 0.5rem;
    }
}
