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

body {
    font-family: 'Inter', sans-serif;
    background: linear-gradient(135deg, #1a1a2e 0%, #16213e 50%, #0f3460 100%);
    min-height: 100vh;
    color: #fff;
}

header {
    text-align: center;
    padding: 2rem;
    background: rgba(0, 0, 0, 0.3);
    backdrop-filter: blur(10px);
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

header h1 {
    font-family: 'Playfair Display', serif;
    font-size: 2.5rem;
    color: #ffd700;
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.5);
}

header .subtitle {
    color: #aaa;
    margin-top: 0.5rem;
}

main {
    padding: 2rem;
    max-width: 1400px;
    margin: 0 auto;
}

.controls {
    display: flex;
    gap: 2rem;
    flex-wrap: wrap;
    align-items: center;
    margin-bottom: 2rem;
    padding: 1.5rem;
    background: rgba(255, 255, 255, 0.05);
    border-radius: 16px;
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.add-table-form {
    display: flex;
    gap: 1rem;
    align-items: center;
    flex-wrap: wrap;
}

.add-table-form h3 {
    width: 100%;
    font-size: 1rem;
    color: #aaa;
    margin-bottom: 0.5rem;
}

.add-table-form input {
    padding: 0.75rem 1rem;
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 8px;
    background: rgba(255, 255, 255, 0.1);
    color: #fff;
    font-size: 1rem;
}

.add-table-form input::placeholder {
    color: #888;
}

.add-table-form button {
    padding: 0.75rem 1.5rem;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: #fff;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    font-weight: 600;
    transition: transform 0.2s, box-shadow 0.2s;
}

.add-table-form button:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 15px rgba(102, 126, 234, 0.4);
}

.legend {
    display: flex;
    gap: 1.5rem;
    margin-left: auto;
}

.legend span {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.legend .available {
    color: #4ade80;
}

.legend .reserved {
    color: #f87171;
}

.date-picker {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.date-picker input {
    padding: 0.5rem;
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 8px;
    background: rgba(255, 255, 255, 0.1);
    color: #fff;
}

.floor-plan {
    position: relative;
    width: 100%;
    height: 600px;
    background:
        linear-gradient(90deg, rgba(139, 90, 43, 0.1) 1px, transparent 1px),
        linear-gradient(rgba(139, 90, 43, 0.1) 1px, transparent 1px),
        linear-gradient(135deg, #2d1f14 0%, #1a1209 100%);
    background-size: 50px 50px, 50px 50px, 100% 100%;
    border-radius: 16px;
    border: 4px solid #4a3728;
    overflow: hidden;
    box-shadow: inset 0 0 50px rgba(0, 0, 0, 0.5);
}

/* Realistic Table Container */
.table-container {
    position: absolute;
    cursor: grab;
    transition: transform 0.2s;
    user-select: none;
}

.table-container:hover {
    transform: scale(1.05);
    z-index: 100;
}

.table-container:active {
    cursor: grabbing;
}

/* Table Surface */
.table-surface {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-direction: column;
    border-radius: 8px;
    box-shadow:
        0 4px 8px rgba(0, 0, 0, 0.3),
        inset 0 2px 4px rgba(255, 255, 255, 0.1);
    z-index: 10;
}

.table-surface.available {
    background: linear-gradient(135deg, #2d5a3d 0%, #1f4a2d 100%);
    border: 3px solid #3d7a4d;
}

.table-surface.reserved {
    background: linear-gradient(135deg, #7a2d2d 0%, #5a1f1f 100%);
    border: 3px solid #9a3d3d;
}

.table-surface .tablecloth {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 80%;
    height: 80%;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 4px;
}

.table-surface .name {
    font-weight: 600;
    font-size: 0.85rem;
    color: #fff;
    text-shadow: 1px 1px 2px rgba(0, 0, 0, 0.5);
    z-index: 2;
}

.table-surface .seats-info {
    font-size: 0.7rem;
    color: rgba(255, 255, 255, 0.8);
    z-index: 2;
}

/* Chairs */
.chair {
    position: absolute;
    width: 24px;
    height: 24px;
    border-radius: 50%;
    background: linear-gradient(135deg, #8b5a2b 0%, #654321 100%);
    border: 2px solid #a0522d;
    box-shadow:
        0 2px 4px rgba(0, 0, 0, 0.3),
        inset 0 1px 2px rgba(255, 255, 255, 0.2);
}

.chair.available {
    background: linear-gradient(135deg, #4a7c59 0%, #3d6b4a 100%);
    border-color: #5a9c69;
}

.chair.reserved {
    background: linear-gradient(135deg, #8b4a4a 0%, #6b3a3a 100%);
    border-color: #9c5a5a;
}

/* Round table (2-4 seats) */
.table-container.round .table-surface {
    width: 80px;
    height: 80px;
    border-radius: 50%;
}

/* Rectangular table (5+ seats) */
.table-container.rect .table-surface {
    width: 120px;
    height: 70px;
}

/* Delete button */
.delete-btn {
    position: absolute;
    top: -10px;
    right: -10px;
    width: 24px;
    height: 24px;
    border-radius: 50%;
    background: #dc2626;
    color: #fff;
    border: 2px solid #fff;
    cursor: pointer;
    font-size: 14px;
    font-weight: bold;
    display: none;
    z-index: 20;
    line-height: 18px;
}

.table-container:hover .delete-btn {
    display: block;
}

.reservations-panel {
    margin-top: 2rem;
    padding: 1.5rem;
    background: rgba(255, 255, 255, 0.05);
    border-radius: 16px;
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.reservations-panel h3 {
    margin-bottom: 1rem;
    color: #ffd700;
}

.reservations-panel ul {
    list-style: none;
}

.reservations-panel li {
    padding: 0.75rem;
    background: rgba(255, 255, 255, 0.05);
    border-radius: 8px;
    margin-bottom: 0.5rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.reservations-panel li .time {
    color: #ffd700;
    font-weight: 600;
}

.no-reservations {
    color: #888;
    font-style: italic;
}