/* Global styles for the wedding seating planner */

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
    font-family: "Segoe UI", Tahoma, Geneva, Verdana, sans-serif;
}

html, body {
    height: 100%;
}

body {
    background-color: #f4f1ea;
    color: #3a3226;
}

.container {
    display: flex;
    height: 100vh;
    overflow: hidden;
}

/* --- Sidebar --- */

#control-panel {
    width: 340px;
    flex-shrink: 0;
    padding: 18px;
    overflow-y: auto;
    background: #fffdf7;
    border-right: 1px solid #e2dbc9;
}

#control-panel h2 {
    font-size: 1.4rem;
    margin-bottom: 14px;
    color: #7a4a3a;
}

#control-panel h3 {
    font-size: 0.95rem;
    text-transform: uppercase;
    letter-spacing: 0.03em;
    color: #6b6045;
    margin-bottom: 8px;
}

#control-panel section {
    margin-bottom: 20px;
    padding-bottom: 16px;
    border-bottom: 1px solid #ece5d3;
}

#control-panel section:last-child {
    border-bottom: none;
}

/* --- Canvas --- */

#canvas-wrap {
    flex-grow: 1;
    position: relative;
    overflow: hidden;
}

#seating-canvas {
    display: block;
    width: 100%;
    height: 100%;
    cursor: grab;
    background: #f6f2ea;
}

/* --- Buttons --- */

.btn-row {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    margin-bottom: 8px;
}

button {
    padding: 7px 12px;
    font-size: 0.85rem;
    border: 1px solid #cbbf9e;
    border-radius: 6px;
    background: #fff;
    color: #3a3226;
    cursor: pointer;
    transition: background-color 0.15s, transform 0.05s;
}

button:hover {
    background: #f1ead9;
}

button:active {
    transform: scale(0.97);
}

button.primary {
    background: #7a4a3a;
    border-color: #7a4a3a;
    color: #fff;
}

button.primary:hover {
    background: #653d30;
}

button.danger {
    color: #b32323;
    border-color: #e0b5b0;
}

button.danger:hover {
    background: #fbeceb;
}

button.icon-btn {
    padding: 4px 8px;
    font-size: 0.85rem;
    line-height: 1;
}

/* --- Inputs --- */

input[type="text"],
input[type="number"] {
    padding: 6px 8px;
    border: 1px solid #cbbf9e;
    border-radius: 6px;
    font-size: 0.85rem;
    background: #fff;
    width: 100%;
}

#add-guest-form {
    margin-bottom: 10px;
}

#add-guest-form input {
    flex: 1;
}

.field-label {
    display: block;
    font-size: 0.78rem;
    color: #6b6045;
    margin-bottom: 8px;
}

.field-label input {
    margin-top: 3px;
}

/* --- Table properties panel --- */

#table-properties {
    margin-top: 10px;
    padding: 10px;
    background: #f8f4e9;
    border: 1px solid #e2dbc9;
    border-radius: 8px;
}

#table-properties h4 {
    font-size: 0.9rem;
    margin-bottom: 8px;
    color: #7a4a3a;
}

.rotation-row {
    display: flex;
    align-items: center;
    gap: 10px;
    margin: 8px 0;
    font-size: 0.85rem;
}

.warning {
    font-size: 0.78rem;
    color: #b32323;
    background: #fbeceb;
    border-radius: 6px;
    padding: 6px 8px;
    margin: 6px 0;
}

/* --- Guest list --- */

#guest-list {
    list-style: none;
    max-height: 320px;
    overflow-y: auto;
}

.guest-group {
    margin-bottom: 12px;
}

.guest-group-heading {
    font-size: 0.72rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.03em;
    color: #7a4a3a;
    padding: 3px 2px;
    border-bottom: 1px solid #e2dbc9;
    margin-bottom: 5px;
}

.guest-group-list {
    list-style: none;
}

.guest-chip {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 6px 8px;
    border-radius: 6px;
    margin-bottom: 4px;
    background: #fff;
    border: 1px solid #ece5d3;
}

.guest-chip.picked {
    border-color: #2f6fd1;
    background: #eaf1fc;
}

.guest-chip .swatch {
    width: 12px;
    height: 12px;
    border-radius: 50%;
    flex-shrink: 0;
}

.guest-info {
    flex-grow: 1;
    cursor: pointer;
    min-width: 0;
}

.guest-name {
    font-size: 0.88rem;
    font-weight: 600;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.guest-seat {
    font-size: 0.72rem;
    color: #6b6045;
}

.guest-actions {
    display: flex;
    gap: 2px;
    flex-shrink: 0;
}

/* --- Conflicts --- */

#conflict-list {
    list-style: none;
    max-height: 160px;
    overflow-y: auto;
}

.conflict-item {
    font-size: 0.8rem;
    color: #b32323;
    padding: 5px 6px;
    border-radius: 5px;
    cursor: pointer;
}

.conflict-item:hover {
    background: #fbeceb;
}

.conflict-empty {
    font-size: 0.8rem;
    color: #6b6045;
    padding: 5px 6px;
}

/* --- Seat-assign popup --- */

#seat-popup {
    position: absolute;
    background: #fffdf7;
    border: 1px solid #cbbf9e;
    border-radius: 8px;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.2);
    padding: 10px;
    width: 220px;
    max-height: 280px;
    overflow-y: auto;
    z-index: 50;
}

#seat-popup h5 {
    font-size: 0.82rem;
    color: #7a4a3a;
    margin-bottom: 8px;
}

.seat-popup-current {
    padding-bottom: 8px;
    margin-bottom: 8px;
    border-bottom: 1px solid #ece5d3;
}

.seat-popup-current-label {
    font-size: 0.7rem;
    color: #6b6045;
    text-transform: uppercase;
    letter-spacing: 0.03em;
}

.seat-popup-current-name {
    font-size: 0.88rem;
    font-weight: 600;
    padding: 4px 0;
    cursor: pointer;
    border-radius: 4px;
}

.seat-popup-current-name:hover {
    color: #2f6fd1;
}

.seat-popup-vacate {
    width: 100%;
    margin-top: 4px;
}

.seat-popup-list-heading {
    font-size: 0.72rem;
    color: #6b6045;
    text-transform: uppercase;
    letter-spacing: 0.03em;
    margin-bottom: 4px;
}

.seat-popup-list {
    list-style: none;
}

.seat-popup-list li {
    padding: 5px 6px;
    border-radius: 5px;
    cursor: pointer;
    font-size: 0.85rem;
}

.seat-popup-list li:hover {
    background: #f1ead9;
}

.seat-popup-empty {
    font-size: 0.8rem;
    color: #6b6045;
    padding: 4px 0;
}

/* --- Demand editor modal --- */

#demand-editor-overlay {
    position: fixed;
    inset: 0;
    background: rgba(58, 50, 38, 0.45);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 100;
}

.demand-panel {
    background: #fffdf7;
    border-radius: 10px;
    padding: 20px;
    width: 380px;
    max-height: 85vh;
    overflow-y: auto;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.25);
}

.demand-panel h3 {
    margin-bottom: 14px;
    color: #7a4a3a;
}

.multi-select {
    margin-bottom: 14px;
    max-height: 160px;
    overflow-y: auto;
    border: 1px solid #ece5d3;
    border-radius: 6px;
    padding: 8px;
}

.multi-select-label {
    font-size: 0.78rem;
    color: #6b6045;
    margin-bottom: 6px;
    font-weight: 600;
}

.checkbox-row {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 0.85rem;
    padding: 3px 0;
    cursor: pointer;
}

.checkbox-row input {
    width: auto;
}

/* --- Utility --- */

.hidden {
    display: none !important;
}

/* --- Responsive --- */

@media (max-width: 720px) {
    .container {
        flex-direction: column;
    }

    #control-panel {
        width: 100%;
        max-height: 45vh;
        border-right: none;
        border-bottom: 1px solid #e2dbc9;
    }

    #canvas-wrap {
        flex-grow: 1;
        min-height: 40vh;
    }
}
