/* ====== PLAN DE TABLE ====== */

/* Settings card */
.pdt-settings-card {
    background: var(--color-card, #fff);
    border-radius: 12px;
    padding: 20px 24px;
    margin-bottom: 24px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.07);
}

.pdt-settings-row {
    display: flex;
    flex-wrap: wrap;
    gap: 24px;
    align-items: flex-end;
}

.pdt-field {
    display: flex;
    flex-direction: column;
    gap: 6px;
    min-width: 160px;
}

.pdt-label {
    font-size: 0.78rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: #888;
}

.pdt-input {
    width: 100px;
}

.pdt-dropdown {
    min-width: 160px;
}

.pdt-mariage-badge {
    display: flex;
    align-items: center;
    gap: 6px;
    background: #fdf6e3;
    border: 1px solid #d4a843;
    border-radius: 8px;
    padding: 6px 12px;
    color: #b8860b;
    font-weight: 500;
    width: fit-content;
}

.pdt-mariage-icon {
    font-size: 16px;
    color: #d4a843;
}

/* Wrapper scrollable autour de la salle */
.pdt-salle-wrapper {
    overflow: auto;
    width: 100%;
    border: 2px dashed #e0d5c5;
    border-radius: 12px;
    background: #fafaf8;
}

/* Salle en état drop-target (shape survolée) */
.pdt-salle-wrapper.pdt-salle-drop-target {
    border-color: #d4a843;
    background: #fdf9f0;
}

/* Salle virtuelle */
.pdt-salle {
    position: relative;
    width: 100%;
    min-width: 1250px;
    height: 650px;
    overflow: hidden;
}

/* Palette de formes */
.pdt-settings-divider {
    width: 1px;
    background: #e8e0d5;
    align-self: stretch;
    margin: 0 4px;
}

.pdt-field-palette {
    flex: 1;
}

.pdt-shapes-palette {
    display: flex;
    gap: 16px;
    align-items: flex-end;
}

.pdt-shape-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 6px;
    cursor: grab;
    user-select: none;
    opacity: 0.85;
    transition: opacity 0.15s, transform 0.1s;
}

.pdt-shape-item:hover {
    opacity: 1;
    transform: translateY(-2px);
}

.pdt-shape-item:active {
    cursor: grabbing;
}

.pdt-shape-preview {
    background: #fff;
    border: 2px solid #d4a843;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.1);
}

.pdt-shape-preview-ronde {
    width: 40px;
    height: 40px;
    border-radius: 50%;
}

.pdt-shape-preview-carre {
    width: 38px;
    height: 38px;
    border-radius: 4px;
}

.pdt-shape-preview-rectangle {
    width: 54px;
    height: 34px;
    border-radius: 4px;
}

.pdt-shape-label {
    font-size: 0.7rem;
    color: #888;
    font-weight: 500;
}

/* ── Table cards (conteneur transparent, chaises + forme en absolu) ── */
.pdt-table-card {
    position: absolute;
    cursor: move;
    user-select: none;
    z-index: 5;
}

.pdt-table-card.pdt-table-moving {
    z-index: 20;
}

/* Tailles du wrapper (espace total incluant les chaises) */
.pdt-table-ronde,
.pdt-table-carre {
    width: 290px;
    height: 290px;
}

.pdt-table-rectangle {
    width: 300px;
    height: 290px;
}

/* ── Forme centrale de la table ── */
.pdt-table-shape {
    position: absolute;
    background: #fff;
    border: 2.5px solid #d4a843;
    box-shadow: 0 3px 10px rgba(0, 0, 0, 0.12);
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    z-index: 2;
    transition: box-shadow 0.15s;
}

.pdt-table-card:hover .pdt-table-shape {
    box-shadow: 0 5px 16px rgba(0, 0, 0, 0.18);
}

.pdt-table-card.pdt-table-moving .pdt-table-shape {
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.25);
}

/* Position et taille de la forme selon le type */
.pdt-table-ronde .pdt-table-shape {
    width: 135px;
    height: 135px;
    border-radius: 50%;
    left: 78px;
    top: 78px;
}

.pdt-table-carre .pdt-table-shape {
    width: 135px;
    height: 135px;
    border-radius: 6px;
    left: 78px;
    top: 78px;
}

.pdt-table-rectangle .pdt-table-shape {
    width: 210px;
    height: 112px;
    border-radius: 6px;
    left: 45px;
    top: 89px;
}

/* Table des mariés */
.pdt-table-mariage .pdt-table-shape {
    border-color: #c0392b;
    border-width: 3px;
}

/* Nom de la table centré dans la forme */
.pdt-table-numero {
    font-size: 1.3rem;
    font-weight: 700;
    color: #b8860b;
    text-align: center;
    line-height: 1.2;
    padding: 4px;
    word-break: break-word;
    max-width: 90%;
    pointer-events: none;
    user-select: none;
}

.pdt-table-shape {
    cursor: move;
}

.pdt-table-mariage .pdt-table-numero {
    color: #c0392b;
}

/* Zone poubelle (apparaît pendant le déplacement d'une table) */
#pdt-trash-zone {
    position: fixed;
    bottom: -80px;
    left: 50%;
    transform: translateX(-50%);
    width: 260px;
    height: 60px;
    background: #fee2e2;
    border: 2px dashed #f87171;
    border-radius: 14px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    color: #dc2626;
    font-weight: 600;
    font-size: 0.88rem;
    transition: bottom 0.22s ease, background 0.15s, border-color 0.15s, color 0.15s;
    z-index: 1000;
    pointer-events: none;
    user-select: none;
}

#pdt-trash-zone.pdt-trash-visible {
    bottom: 24px;
}

#pdt-trash-zone.pdt-trash-hot {
    background: #dc2626;
    border-color: #dc2626;
    color: #fff;
}

.pdt-trash-icon {
    font-size: 22px;
}

/* Input inline pour renommer la table */
.pdt-table-name-input {
    font-size: 1.3rem;
    font-weight: 700;
    color: #b8860b;
    border: none;
    border-bottom: 2px solid #d4a843;
    background: transparent;
    outline: none;
    width: 80%;
    text-align: center;
    padding: 0;
    font-family: inherit;
    cursor: text;
}

.pdt-table-mariage .pdt-table-name-input {
    color: #c0392b;
    border-bottom-color: #c0392b;
}

/* ── Chaises ── */
.pdt-chair-slot {
    position: absolute;
    width: 60px;
    height: 60px;
    border-radius: 50%;
    z-index: 3;
    box-sizing: border-box;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: transform 0.15s, border-color 0.15s, background 0.15s;
    overflow: hidden;
}

.pdt-chair-empty {
    border: 2px dashed #ccc;
    background: #f5f5f5;
    cursor: pointer;
}

.pdt-chair-empty:hover {
    border-color: #b8a070;
    background: #faf0d8;
}

.pdt-chair-occupied {
    border: 2px solid #d4a843;
    background: #fdf6e3;
    cursor: default;
}

/* Nom de l'invité dans la chaise */
.pdt-chair-name {
    font-size: 0.62rem;
    font-weight: 600;
    color: #5a4a2a;
    text-align: center;
    line-height: 1.2;
    max-width: 56px;
    overflow: hidden;
    word-break: break-word;
    display: block;
    padding: 2px;
    pointer-events: none;
}

/* Overlay × au hover sur chaise occupée */
.pdt-chair-unassign {
    position: absolute;
    inset: 0;
    border-radius: 50%;
    background: rgba(192, 57, 43, 0.82);
    color: #fff;
    font-size: 16px;
    font-weight: bold;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    transition: opacity 0.15s;
    cursor: pointer;
    line-height: 1;
}

.pdt-chair-occupied:hover .pdt-chair-unassign {
    opacity: 1;
}

/* Chaise en état drop-target */
.pdt-chair-slot.pdt-chair-drop-target {
    border-color: #22c55e !important;
    border-style: solid !important;
    background: #dcfce7 !important;
    transform: scale(1.12);
}

/* Body layout */
.pdt-body {
    display: flex;
    gap: 24px;
    align-items: flex-start;
}

.pdt-left-col {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 24px;
    min-width: 0;
}

.pdt-main-area {
    min-height: 400px;
}

/* Guest panel */
.pdt-guest-panel {
    width: 20%;
    min-width: 200px;
    background: var(--color-card, #fff);
    border-radius: 12px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.07);
    overflow: hidden;
    flex-shrink: 0;
    position: sticky;
    top: calc(50vh - 200px);
}

.pdt-guest-list-header {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 14px 16px;
    background: #d4a843;
    color: #fff;
}

.pdt-guest-list-icon {
    font-size: 18px;
}

.pdt-guest-list-title {
    font-weight: 600;
    font-size: 0.9rem;
}

.pdt-guest-list-body {
    max-height: 65vh;
    overflow-y: auto;
    padding: 8px 0;
}

.pdt-guest-item {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 16px;
    cursor: grab;
    transition: background 0.15s, opacity 0.15s;
    user-select: none;
}

.pdt-guest-item:active {
    cursor: grabbing;
}

.pdt-guest-item.pdt-dragging {
    opacity: 0.35;
    background: #fdf6e3;
}

.pdt-guest-item:hover {
    background: #fdf6e3;
}

.pdt-guest-icon {
    font-size: 16px;
    color: #d4a843;
    flex-shrink: 0;
}

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