body {
    font-family: Arial, sans-serif;
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 100vh;
    margin: 0;
    padding: 20px 0;
    box-sizing: border-box;
    background-color: #f0f0f0;
}

.container {
    text-align: center;
    display: flex;
    flex-direction: column;
    align-items: center;
}

h1 {
    margin-bottom: 5px;
    color: #333;
    font-size: 1.2em;
    font-style: italic;
    max-width: 100%;
    padding: 0 20px;
}

#quoteAuthor {
    color: #999;
    font-size: 0.85em;
    margin: 0 auto 20px;
}

.name-input-section {
    margin-bottom: 40px;
}

#nameField {
    padding: 10px 15px;
    border: 2px solid #ddd;
    border-radius: 5px;
    font-size: 16px;
    width: 250px;
    text-align: center;
}

#nameField:focus {
    outline: none;
    border-color: #4CAF50;
}

.table-layout {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 10px;
}

.top-seat, .bottom-seat {
    display: flex;
    justify-content: center;
}

.middle-section {
    display: flex;
    align-items: stretch;
    gap: 20px;
}

.side-seats {
    display: flex;
    flex-direction: column;
    gap: 8px;
    justify-content: center;
    width: 100px;
}

.left-seats {
    align-items: flex-end;
}

.right-seats {
    align-items: flex-start;
}

.table-rectangle {
    width: 80px;
    border: 3px solid #8B4513;
    background-color: #D2B48C;
    border-radius: 10px;
    flex-shrink: 0;
    /* Height will be set by the side seats - it should match their total height */
    align-self: stretch;
}

.seat {
    width: 40px;
    height: 40px;
    border: 2px solid #333;
    border-radius: 50%;
    background-color: #90EE90;
    cursor: pointer;
    transition: background-color 0.3s;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 12px;
    font-weight: bold;
}

.seat:hover {
    opacity: 0.8;
}

.seat.selected {
    background-color: #FF6B6B;
}

.seat-wrapper {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 5px;
}

.seat-name {
    font-size: 12px;
    color: #333;
    background-color: rgba(255, 255, 255, 0.9);
    padding: 2px 6px;
    border-radius: 3px;
    border: 1px solid #ddd;
    white-space: nowrap;
    max-width: 80px;
    overflow: hidden;
    text-overflow: ellipsis;
}

.top-seat .seat-wrapper {
    flex-direction: column-reverse;
}

.left-seats .seat-wrapper {
    flex-direction: row-reverse;
}

.right-seats .seat-wrapper {
    flex-direction: row;
}

.legend {
    margin-top: 40px;
    display: flex;
    justify-content: center;
    gap: 20px;
}

.legend-item {
    display: flex;
    align-items: center;
    gap: 5px;
}

.legend-seat {
    width: 20px;
    height: 20px;
    border: 2px solid #333;
    border-radius: 50%;
}

.available {
    background-color: #90EE90;
}

.booked {
    background-color: #FF6B6B;
}

/* Horizontal layout for wide screens */
@media (min-width: 700px) {
    .table-layout {
        flex-direction: row;
        align-items: center;
    }

    .middle-section {
        flex-direction: column;
        align-items: stretch;
    }

    .side-seats {
        flex-direction: row;
        width: auto;
        justify-content: center;
    }

    .left-seats {
        align-items: flex-end;
    }

    .right-seats {
        align-items: flex-start;
    }

    .left-seats .seat-wrapper {
        flex-direction: column-reverse;
    }

    .right-seats .seat-wrapper {
        flex-direction: column;
    }

    .table-rectangle {
        width: auto;
        height: 80px;
    }

    /* End seats: name floats to the side, vertically centered */
    .top-seat .seat-wrapper,
    .bottom-seat .seat-wrapper {
        position: relative;
    }

    .top-seat .seat-name {
        position: absolute;
        right: calc(100% + 5px);
        top: 50%;
        transform: translateY(-50%);
    }

    .bottom-seat .seat-name {
        position: absolute;
        left: calc(100% + 5px);
        top: 50%;
        transform: translateY(-50%);
    }
}
