/**
 * Seating Management - Additional Styles
 */

/* Inherits from suite.css - this file contains seating-specific overrides */

/* ── Page width ────────────────────────────────────────────────────────────── */
/* Push past WP admin's default content padding so tables can breathe */
.cer-seating-page {
    max-width: 100%;
    margin-right: -20px; /* reclaim WP admin right padding */
}

/* Event selection dropdown */
.cer-seating-page select[name="event_id"] {
    min-width: 300px;
    padding: 8px 12px;
    font-size: 14px;
    border: 1px solid #d1d5db;
    border-radius: 6px;
}

/* Load layout section */
#cer-load-layout {
    min-width: 250px;
    padding: 6px 10px;
    border: 1px solid #d1d5db;
    border-radius: 6px;
}

#cer-load-btn {
    margin-left: 8px;
}

/* Generate button */
#cer-seating-generate {
    margin-left: 8px;
}

/* ── Table controls: number inputs (scoped to table cards only) ────────────── */
.cer-table-card .cer-add input[type="number"] {
    padding: 3px 4px;
    border: 1px solid #d1d5db;
    border-radius: 4px;
    font-size: 12px;
    width: 36px !important;
    min-width: 36px;
    box-sizing: border-box;
}

/* ── Table header: two-row layout ──────────────────────────────────────────── */
/* Row 1: "Table N ✎" on the left, stacked +/- on the right                  */
/* Row 2: Identifier input full-width beneath                                  */
.cer-table-card .cer-table-title {
    display: flex !important;
    flex-direction: column !important;
    gap: 6px !important;
    margin: 0 0 8px 0 !important;
    align-items: stretch !important;
}

.cer-table-card .cer-table-title-row1 {
    display: flex !important;
    flex-direction: row !important;
    justify-content: space-between !important;
    align-items: center !important;
    gap: 4px !important;
    flex-wrap: nowrap !important;
    min-width: 0;
}

.cer-table-card .cer-table-title-row2 {
    display: block !important;
}

/* Left side: "Table [N] ✎" — don't let it shrink */
.cer-table-card .cer-title-left {
    display: flex !important;
    align-items: center !important;
    gap: 5px !important;
    flex-shrink: 0 !important;
    flex-wrap: nowrap !important;
    min-width: 0;
}

/* Identifier input — full width in row 2 */
.cer-table-card .cer-table-identifier {
    width: 100% !important;
    box-sizing: border-box !important;
    font-size: 11px !important;
    padding: 3px 6px !important;
    border: 1px solid #d1d5db !important;
    border-radius: 4px !important;
    color: #6b7280 !important;
    margin: 0 !important;
    display: block !important;
}

/* ── Stacked +/- controls (scoped to table cards only) ─────────────────────── */
.cer-table-card .cer-add {
    display: grid !important;
    grid-template-columns: 36px 26px !important;
    grid-template-rows: auto auto !important;
    gap: 3px 3px !important;
    align-items: center !important;
    flex-shrink: 0 !important;
}

.cer-table-card .cer-add .cer-add-count    { grid-row: 1; grid-column: 1; }
.cer-table-card .cer-add .cer-add-btn      { grid-row: 1; grid-column: 2; width: 26px !important; min-width: 26px; padding: 0 !important; text-align: center; }
.cer-table-card .cer-add .cer-remove-count { grid-row: 2; grid-column: 1; }
.cer-table-card .cer-add .cer-remove-btn   { grid-row: 2; grid-column: 2; width: 26px !important; min-width: 26px; padding: 0 !important; text-align: center; }

/* ── Seating grid: 2 columns when space allows ─────────────────────────────── */
.cer-seating-layout {
    grid-template-columns: repeat(2, minmax(300px, 1fr)) !important;
}

@media (max-width: 900px) {
    .cer-seating-layout {
        grid-template-columns: 1fr !important;
    }
}

@media (max-width: 700px) {
    .cer-seating-layout {
        grid-template-columns: 1fr !important;
    }
}

/* Seat dietary indicator */
.cer-seat .dietary {
    font-size: 11px;
    color: #dc2626;
    font-style: italic;
}

/* Empty vs filled seats */
.cer-seat:not(.assigned) {
    opacity: 0.7;
}

.cer-seat:not(.assigned):hover {
    opacity: 1;
}

/* ── Bulk assign bar ─────────────────────────────────────────────────────── */
.cer-bulk-bar {
    margin-bottom: 14px;
    padding: 10px 12px;
    background: #f1f5f9;
    border-radius: 8px;
    font-size: 13px;
    display: block;
}
.cer-bulk-label {
    font-weight: 600;
    display: block;
    margin-bottom: 6px;
    color: #374151;
    font-size: 13px;
}
.cer-bulk-checked-row {
    display: flex;
    align-items: center;
    gap: 8px;
    width: 100%;
}
.cer-bulk-group-label {
    font-size: 12px;
    color: #374151;
    white-space: nowrap;
    flex-shrink: 0;
    line-height: 28px;
}
.cer-bulk-assign-checked {
    font-size: 12px !important;
    padding: 3px 10px !important;
    white-space: nowrap;
    height: 28px;
    flex-shrink: 0;
}
#cer-bulk-table {
    padding: 4px 8px;
    border: 1px solid #d1d5db;
    border-radius: 4px;
    font-size: 12px;
    height: 28px;
    flex: 1;
    min-width: 0;
    max-width: 200px;
}
.cer-bulk-hint {
    display: block;
    margin: 7px 0 0 0;
    font-size: 11px;
    color: #6b7280;
    line-height: 1.5;
}

/* Check all checkbox alignment */
.cer-check-all { margin: 0; }

/* Already assigned section */
#cer-assigned-wrap { border-top: 1px solid #e5e7eb; padding-top: 16px; }
#cer-assigned-wrap h4 { margin-top: 0; color: #6b7280; }

/* Export button row */
.cer-box form[action*="export"] { display: inline; }

/* Seat dropdown occupied styling */
.cer-seat option.seat-occupied,
.cer-assign select option.seat-occupied {
    color: #9ca3af;
    text-decoration: line-through;
    background-color: #f3f4f6;
}

/* ── Gala reservation 2-per-row layout ───────────────────────────────────── */
.cer-gala-res-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 8px;
    margin-top: 8px;
}
.cer-gala-res-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 5px 7px;
    background: #fef9ec;
    border: 1px solid #fcd34d;
    border-radius: 6px 6px 0 0;
    flex-wrap: wrap;
    gap: 4px;
}
.cer-gala-res-info { font-size: 11px; font-weight: 600; color: #92400e; }
.cer-gala-res-controls { display: flex; align-items: center; gap: 4px; }
.cer-res-assign-table {
    font-size: 11px;
    padding: 2px 4px;
    height: 24px;
    width: 60px;
    border: 1px solid #d1d5db;
    border-radius: 4px;
}

/* ── Individual assign controls ──────────────────────────────────────────── */
.cer-assign { display: flex; align-items: center; gap: 3px; }
.cer-assign select.cer-table { width: 46px; min-width: unset; padding: 2px; font-size: 12px; }
.cer-assign select.cer-seat  { width: 42px; min-width: unset; padding: 2px; font-size: 12px; }
.cer-assign-col { width: 110px; }
/* Give the Name column room to breathe */
.cer-att-table th:nth-child(2),
.cer-att-table td:nth-child(2) { min-width: 90px; font-size: 13px; }


/* ================================================================
   SEAT COLOR CODING
   ================================================================
   🟢 Green (cer-system)    = Confirmed attendee with details
   🟠 Orange (cer-placeholder) = TBA/Awaiting attendee details
   🔵 Blue (cer-manual)     = Admin manual entry
   🔴 Red (cer-cancelled)   = Cancelled / Not attending
   ================================================================ */

/* GREEN - System booking with confirmed attendee details */
.cer-seat.cer-system {
    border-left: 4px solid #22c55e !important;
    background: linear-gradient(135deg, rgba(34, 197, 94, 0.08), rgba(34, 197, 94, 0.03)) !important;
}

.cer-seat.cer-system .name {
    color: #166534;
    font-weight: 600;
}

.cer-seat.cer-system::after {
    content: '✓';
    position: absolute;
    top: 2px;
    right: 24px;
    font-size: 10px;
    color: #22c55e;
    font-weight: bold;
}

/* ORANGE - Placeholder / TBA / Awaiting attendee details */
.cer-seat.cer-placeholder {
    border-left: 4px solid #f59e0b !important;
    background: linear-gradient(135deg, rgba(245, 158, 11, 0.12), rgba(245, 158, 11, 0.05)) !important;
}

.cer-seat.cer-placeholder .name {
    color: #92400e;
    font-weight: 600;
    font-style: italic;
}

.cer-seat.cer-placeholder::after {
    content: '⏳';
    position: absolute;
    top: 2px;
    right: 24px;
    font-size: 10px;
}

/* BLUE - Manual entry by admin */
.cer-seat.cer-manual {
    border-left: 4px solid #3b82f6 !important;
    background: linear-gradient(135deg, rgba(59, 130, 246, 0.08), rgba(59, 130, 246, 0.03)) !important;
}

.cer-seat.cer-manual .name {
    color: #1e40af;
    font-weight: 600;
}

.cer-seat.cer-manual::after {
    content: '✎';
    position: absolute;
    top: 2px;
    right: 24px;
    font-size: 10px;
    color: #3b82f6;
}

/* RED - Cancelled / Not Attending */
.cer-seat.cer-cancelled {
    border-left: 4px solid #dc2626 !important;
    background: linear-gradient(135deg, rgba(220, 38, 38, 0.15), rgba(220, 38, 38, 0.08)) !important;
    opacity: 0.75;
}

.cer-seat.cer-cancelled .name {
    color: #991b1b;
    font-weight: 600;
    text-decoration: line-through;
}

.cer-seat.cer-cancelled .company,
.cer-seat.cer-cancelled .dietary {
    color: #b91c1c;
    text-decoration: line-through;
}

.cer-seat.cer-cancelled::after {
    content: '❌';
    position: absolute;
    top: 2px;
    right: 24px;
    font-size: 10px;
}

/* TBA badge for placeholder attendees */
.cer-tba-badge {
    display: inline-block;
    padding: 2px 8px;
    background: linear-gradient(135deg, #fbbf24, #f59e0b);
    color: #fff;
    font-size: 11px;
    font-weight: 600;
    border-radius: 4px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

/* Placeholder row styling */
.cer-placeholder-row {
    background: repeating-linear-gradient(
        -45deg,
        transparent,
        transparent 10px,
        rgba(251, 191, 36, 0.05) 10px,
        rgba(251, 191, 36, 0.05) 20px
    );
}

.cer-placeholder-row td {
    font-style: italic;
}

/* Seat with TBA placeholder */
.cer-seat.cer-tba {
    border-left: 3px solid #fbbf24 !important;
    background: rgba(251, 191, 36, 0.1);
}

.cer-seat.cer-tba .name {
    color: #92400e;
    font-weight: 600;
}

/* Seat badge in assigned section */
.cer-seat-badge {
    display: inline-block;
    padding: 2px 6px;
    background: #e5e7eb;
    color: #374151;
    font-size: 11px;
    font-weight: 600;
    border-radius: 4px;
    margin-left: 4px;
}

/* Table badge styling */
.cer-table-badge {
    display: inline-block;
    padding: 2px 8px;
    background: linear-gradient(135deg, #3b82f6, #2563eb);
    color: #fff;
    font-size: 11px;
    font-weight: 600;
    border-radius: 4px;
}

/* Unassign button styling */
.cer-unassign-btn {
    color: #dc2626 !important;
    border-color: #fca5a5 !important;
    background: #fef2f2 !important;
}

.cer-unassign-btn:hover {
    background: #fee2e2 !important;
    border-color: #f87171 !important;
}

/* Assigned actions container */
.cer-assigned-actions {
    display: flex;
    gap: 8px;
    align-items: center;
}


/* ================================================================
   SEAT LEGEND
   ================================================================ */
.cer-seat-legend {
    display: flex;
    gap: 20px;
    flex-wrap: wrap;
    margin-bottom: 16px;
    padding: 12px 16px;
    background: #f9fafb;
    border-radius: 8px;
    border: 1px solid #e5e7eb;
}

.legend-item {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 13px;
    color: #374151;
}

.legend-swatch {
    width: 20px;
    height: 20px;
    border-radius: 4px;
    border: 1px solid rgba(0,0,0,0.1);
}

.legend-system {
    background: linear-gradient(135deg, rgba(34, 197, 94, 0.3), rgba(34, 197, 94, 0.15));
    border-left: 4px solid #22c55e;
}

.legend-placeholder {
    background: linear-gradient(135deg, rgba(245, 158, 11, 0.3), rgba(245, 158, 11, 0.15));
    border-left: 4px solid #f59e0b;
}

.legend-manual {
    background: linear-gradient(135deg, rgba(59, 130, 246, 0.3), rgba(59, 130, 246, 0.15));
    border-left: 4px solid #3b82f6;
}

.legend-cancelled {
    background: linear-gradient(135deg, rgba(220, 38, 38, 0.3), rgba(220, 38, 38, 0.15));
    border-left: 4px solid #dc2626;
}

.legend-label {
    font-weight: 500;
}

/* Table rename button */
.cer-rename-table-btn {
    opacity: 0.5;
    transition: opacity 0.2s;
}

.cer-rename-table-btn:hover {
    opacity: 1;
}

.cer-table-badge-editable {
    cursor: pointer;
    transition: background 0.2s, transform 0.2s;
}

.cer-table-badge-editable:hover {
    background: #1e40af !important;
    transform: scale(1.1);
}


/* Event selection dropdown */
.cer-seating-page select[name="event_id"] {
    min-width: 300px;
    padding: 8px 12px;
    font-size: 14px;
    border: 1px solid #d1d5db;
    border-radius: 6px;
}

/* Load layout section */
#cer-load-layout {
    min-width: 250px;
    padding: 6px 10px;
    border: 1px solid #d1d5db;
    border-radius: 6px;
}

#cer-load-btn {
    margin-left: 8px;
}

/* Generate button */
#cer-seating-generate {
    margin-left: 8px;
}

/* Table controls styling */
.cer-table-card .cer-add input[type="number"] {
    padding: 4px 6px;
    border: 1px solid #d1d5db;
    border-radius: 4px;
    font-size: 12px;
}

/* Seat dietary indicator */
.cer-seat .dietary {
    font-size: 11px;
    color: #dc2626;
    font-style: italic;
}

/* Empty vs filled seats */
.cer-seat:not(.assigned) {
    opacity: 0.7;
}

.cer-seat:not(.assigned):hover {
    opacity: 1;
}


/* ================================================================
   SEAT COLOR CODING
   ================================================================
   🟢 Green (cer-system)    = Confirmed attendee with details
   🟠 Orange (cer-placeholder) = TBA/Awaiting attendee details
   🔵 Blue (cer-manual)     = Admin manual entry
   🔴 Red (cer-cancelled)   = Cancelled / Not attending
   ================================================================ */

/* GREEN - System booking with confirmed attendee details */
.cer-seat.cer-system {
    border-left: 4px solid #22c55e !important;
    background: linear-gradient(135deg, rgba(34, 197, 94, 0.08), rgba(34, 197, 94, 0.03)) !important;
}

.cer-seat.cer-system .name {
    color: #166534;
    font-weight: 600;
}

.cer-seat.cer-system::after {
    content: '✓';
    position: absolute;
    top: 2px;
    right: 24px;
    font-size: 10px;
    color: #22c55e;
    font-weight: bold;
}

/* ORANGE - Placeholder / TBA / Awaiting attendee details */
.cer-seat.cer-placeholder {
    border-left: 4px solid #f59e0b !important;
    background: linear-gradient(135deg, rgba(245, 158, 11, 0.12), rgba(245, 158, 11, 0.05)) !important;
}

.cer-seat.cer-placeholder .name {
    color: #92400e;
    font-weight: 600;
    font-style: italic;
}

.cer-seat.cer-placeholder::after {
    content: '⏳';
    position: absolute;
    top: 2px;
    right: 24px;
    font-size: 10px;
}

/* BLUE - Manual entry by admin */
.cer-seat.cer-manual {
    border-left: 4px solid #3b82f6 !important;
    background: linear-gradient(135deg, rgba(59, 130, 246, 0.08), rgba(59, 130, 246, 0.03)) !important;
}

.cer-seat.cer-manual .name {
    color: #1e40af;
    font-weight: 600;
}

.cer-seat.cer-manual::after {
    content: '✎';
    position: absolute;
    top: 2px;
    right: 24px;
    font-size: 10px;
    color: #3b82f6;
}

/* RED - Cancelled / Not Attending */
.cer-seat.cer-cancelled {
    border-left: 4px solid #dc2626 !important;
    background: linear-gradient(135deg, rgba(220, 38, 38, 0.15), rgba(220, 38, 38, 0.08)) !important;
    opacity: 0.75;
}

.cer-seat.cer-cancelled .name {
    color: #991b1b;
    font-weight: 600;
    text-decoration: line-through;
}

.cer-seat.cer-cancelled .company,
.cer-seat.cer-cancelled .dietary {
    color: #b91c1c;
    text-decoration: line-through;
}

.cer-seat.cer-cancelled::after {
    content: '❌';
    position: absolute;
    top: 2px;
    right: 24px;
    font-size: 10px;
}

/* TBA badge for placeholder attendees */
.cer-tba-badge {
    display: inline-block;
    padding: 2px 8px;
    background: linear-gradient(135deg, #fbbf24, #f59e0b);
    color: #fff;
    font-size: 11px;
    font-weight: 600;
    border-radius: 4px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

/* Placeholder row styling */
.cer-placeholder-row {
    background: repeating-linear-gradient(
        -45deg,
        transparent,
        transparent 10px,
        rgba(251, 191, 36, 0.05) 10px,
        rgba(251, 191, 36, 0.05) 20px
    );
}

.cer-placeholder-row td {
    font-style: italic;
}

/* Seat with TBA placeholder */
.cer-seat.cer-tba {
    border-left: 3px solid #fbbf24 !important;
    background: rgba(251, 191, 36, 0.1);
}

.cer-seat.cer-tba .name {
    color: #92400e;
    font-weight: 600;
}

/* Seat badge in assigned section */
.cer-seat-badge {
    display: inline-block;
    padding: 2px 6px;
    background: #e5e7eb;
    color: #374151;
    font-size: 11px;
    font-weight: 600;
    border-radius: 4px;
    margin-left: 4px;
}

/* Table badge styling */
.cer-table-badge {
    display: inline-block;
    padding: 2px 8px;
    background: linear-gradient(135deg, #3b82f6, #2563eb);
    color: #fff;
    font-size: 11px;
    font-weight: 600;
    border-radius: 4px;
}

/* Unassign button styling */
.cer-unassign-btn {
    color: #dc2626 !important;
    border-color: #fca5a5 !important;
    background: #fef2f2 !important;
}

.cer-unassign-btn:hover {
    background: #fee2e2 !important;
    border-color: #f87171 !important;
}

/* Assigned actions container */
.cer-assigned-actions {
    display: flex;
    gap: 8px;
    align-items: center;
}


/* ================================================================
   SEAT LEGEND
   ================================================================ */
.cer-seat-legend {
    display: flex;
    gap: 20px;
    flex-wrap: wrap;
    margin-bottom: 16px;
    padding: 12px 16px;
    background: #f9fafb;
    border-radius: 8px;
    border: 1px solid #e5e7eb;
}

.legend-item {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 13px;
    color: #374151;
}

.legend-swatch {
    width: 20px;
    height: 20px;
    border-radius: 4px;
    border: 1px solid rgba(0,0,0,0.1);
}

.legend-system {
    background: linear-gradient(135deg, rgba(34, 197, 94, 0.3), rgba(34, 197, 94, 0.15));
    border-left: 4px solid #22c55e;
}

.legend-placeholder {
    background: linear-gradient(135deg, rgba(245, 158, 11, 0.3), rgba(245, 158, 11, 0.15));
    border-left: 4px solid #f59e0b;
}

.legend-manual {
    background: linear-gradient(135deg, rgba(59, 130, 246, 0.3), rgba(59, 130, 246, 0.15));
    border-left: 4px solid #3b82f6;
}

.legend-cancelled {
    background: linear-gradient(135deg, rgba(220, 38, 38, 0.3), rgba(220, 38, 38, 0.15));
    border-left: 4px solid #dc2626;
}

.legend-label {
    font-weight: 500;
}

/* Table rename button */
.cer-rename-table-btn {
    opacity: 0.5;
    transition: opacity 0.2s;
}

.cer-rename-table-btn:hover {
    opacity: 1;
}

.cer-table-badge-editable {
    cursor: pointer;
    transition: background 0.2s, transform 0.2s;
}

.cer-table-badge-editable:hover {
    background: #1e40af !important;
    transform: scale(1.1);
}



/* ── Gala reservation groups in the attendee panel ────────────────────────── */
.cer-gala-res-group {
    margin-bottom: 12px;
}
.cer-gala-res-group .cer-att-table {
    border-radius: 0 0 6px 6px;
    border-top: none !important;
}
.cer-gala-res-group .cer-res-assign-table {
    font-size: 11px;
    padding: 2px 4px;
    height: 26px;
}
