/**
 * Corporate Events Suite - Styles
 * Includes seating, check-in, and modal fixes
 */

/* ==========================================
   MODAL STYLES - FIXED CENTER ALIGNMENT
   ========================================== */

/* Modal overlay - darkened background */
.cer-modal-overlay {
    position: fixed !important;
    top: 0 !important;
    left: 0 !important;
    right: 0 !important;
    bottom: 0 !important;
    width: 100% !important;
    height: 100% !important;
    background: rgba(0, 0, 0, 0.6) !important;
    z-index: 999999 !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    padding: 20px !important;
    box-sizing: border-box !important;
}

/* Modal content box - centered */
.cer-modal {
    background: #fff !important;
    border-radius: 12px !important;
    padding: 24px !important;
    max-width: 400px !important;
    width: 100% !important;
    max-height: 90vh !important;
    overflow-y: auto !important;
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.25) !important;
    position: relative !important;
}

.cer-modal h3 {
    margin: 0 0 16px 0 !important;
    font-size: 18px !important;
    font-weight: 600 !important;
    color: #1e293b !important;
}

.cer-modal label {
    display: block !important;
    margin-bottom: 16px !important;
    font-weight: 500 !important;
    color: #374151 !important;
}

.cer-modal input[type="text"],
.cer-modal select {
    width: 100% !important;
    padding: 10px 12px !important;
    border: 1px solid #d1d5db !important;
    border-radius: 6px !important;
    font-size: 14px !important;
    margin-top: 6px !important;
    box-sizing: border-box !important;
}

.cer-modal input[type="text"]:focus,
.cer-modal select:focus {
    outline: none !important;
    border-color: #3b82f6 !important;
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.1) !important;
}

.cer-modal-actions {
    display: flex !important;
    gap: 10px !important;
    margin-top: 20px !important;
    padding-top: 16px !important;
    border-top: 1px solid #e5e7eb !important;
}

.cer-modal-actions .button {
    flex: 1 !important;
    text-align: center !important;
    padding: 10px 16px !important;
}

/* Close on backdrop click visual cue */
.cer-modal-overlay:hover {
    cursor: pointer;
}

.cer-modal:hover {
    cursor: default;
}


/* ==========================================
   SEATING STYLES
   ========================================== */

/* Top row: Configured (1/3) | Create/Load (2/3) */
.cer-top-grid {
    display: grid;
    grid-template-columns: 1fr 2fr;
    gap: 20px;
    margin-bottom: 16px;
    align-items: start;
}

.cer-top-grid > .cer-box {
    align-self: start;
}

/* Second row: Attendees (1/3) | Tables (2/3) */
.cer-seat-wrap {
    display: grid;
    grid-template-columns: 1fr 2fr;
    gap: 20px;
}

@media (max-width: 1000px) {
    .cer-top-grid {
        grid-template-columns: 1fr;
    }
    .cer-seat-wrap {
        grid-template-columns: 1fr;
    }
}

.cer-box {
    border: 1px solid #e5e7eb;
    border-radius: 12px;
    padding: 16px;
    background: #fff;
}

.cer-seat-left {
    max-height: 70vh;
    overflow: auto;
}

.cer-company-group {
    margin-bottom: 14px;
    border: 1px dashed #e5e7eb;
    border-radius: 10px;
    padding: 10px;
    background: #fff;
}

.cer-company-title {
    font-weight: 600;
    margin-bottom: 6px;
    color: #374151;
}

.cer-list {
    margin: 0;
    padding-left: 18px;
}

/* Tables grid: 2 per row */
.cer-seating-layout {
    display: grid;
    grid-template-columns: repeat(2, minmax(260px, 1fr));
    gap: 12px;
}

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

.cer-table-card {
    border: 1px solid #e2e8f0;
    border-radius: 10px;
    padding: 10px;
    background: #fff;
}

.cer-table-title {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-weight: 600;
    margin: 0 0 8px 0;
    gap: 12px;
}

.cer-title-left {
    display: flex;
    align-items: center;
    gap: 10px;
}

.cer-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: #f1f5f9;
    border: 1px solid #e2e8f0;
    border-radius: 6px;
    padding: 6px 10px;
    font-weight: 600;
    min-width: 40px;
    text-align: center;
}

.cer-add {
    display: flex;
    gap: 6px;
    align-items: center;
}

.cer-add input {
    width: 56px;
}

.button.button-xxs {
    padding: 0 6px;
    line-height: 22px;
    height: 24px;
    font-size: 12px;
}

.cer-seat {
    display: flex;
    justify-content: space-between;
    align-items: center;
    border: 1px dashed #d1d5db;
    border-radius: 8px;
    padding: 6px 8px;
    margin: 6px 0;
    cursor: pointer;
    transition: background-color 0.15s, border-color 0.15s;
}

.cer-seat:hover {
    background: #f8fafc;
}

.cer-seat.assigned {
    border-style: solid;
    background: #f9fafb;
}

.cer-seat .name {
    font-weight: 500;
}

.cer-seat small {
    opacity: 0.8;
}

/* Green = assigned from attendee list; Blue = manual entry */
.cer-seat.cer-system {
    background: #e6ffed;
    border-color: #34d058;
}

.cer-seat.cer-manual {
    background: #e6f0ff;
    border-color: #4c8bf5;
}

.cer-seat .actions {
    display: flex;
    gap: 6px;
    align-items: center;
}

.cer-seat .edit {
    cursor: pointer;
    text-decoration: underline;
    font-size: 12px;
    color: #6b7280;
}

.cer-seat .edit:hover {
    color: #3b82f6;
}

.cer-outline {
    background: #fff;
    border: 2px solid #cbd5e1;
    box-shadow: none;
}

.cer-outline:hover {
    border-color: #94a3b8;
}

.cer-top-note {
    margin-top: 0;
    margin-bottom: 8px;
    font-size: 13px;
    color: #6b7280;
}


/* ==========================================
   CHECK-IN STYLES
   ========================================== */

.cer-company-header td {
    background: #f6f7f7 !important;
    font-weight: 600;
}

.cer-table-col span {
    display: inline-block;
}

#cer-checkin-search {
    border: 1px solid #d1d5db;
    border-radius: 6px;
}

#cer-checkin-search:focus {
    outline: none;
    border-color: #3b82f6;
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.1);
}


/* ==========================================
   CUTOFF MESSAGE STYLES
   ========================================== */

.cer-cutoff-notice {
    background: #fef3c7;
    border: 1px solid #fcd34d;
    border-radius: 8px;
    padding: 12px 16px;
    margin-bottom: 16px;
    color: #92400e;
}

.cer-cutoff-notice strong {
    color: #78350f;
}

.cer-readonly-notice {
    background: #fee2e2;
    border: 1px solid #fca5a5;
    border-radius: 8px;
    padding: 12px 16px;
    margin-bottom: 16px;
    color: #991b1b;
}


/* ==========================================
   ATTENDEE TABLE (View Only Mode)
   ========================================== */

.cer-attendee-table.view-only input,
.cer-attendee-table.view-only select,
.cer-attendee-table.view-only textarea {
    pointer-events: none;
    background: #f9fafb;
    color: #6b7280;
    border-color: #e5e7eb;
}

.cer-attendee-table.view-only .cer-modal-footer {
    display: none;
}


/* ==========================================
   FORM STYLES
   ========================================== */

.cer-form-inline {
    display: flex;
    gap: 10px;
    align-items: center;
    flex-wrap: wrap;
}

.cer-filters {
    display: flex;
    gap: 8px;
    align-items: center;
    flex-wrap: wrap;
    margin-bottom: 16px;
}

.cer-filters select {
    padding: 6px 10px;
    border: 1px solid #d1d5db;
    border-radius: 6px;
}


/* ==========================================
   DIETARY FILTER BUTTON
   ========================================== */

#cer-dietary-filter {
    position: relative;
}

#cer-dietary-filter.is-active {
    background: #fef3c7;
    border-color: #fcd34d;
    color: #92400e;
}

#cer-dietary-filter.is-active::after {
    content: " ✓";
}


/* ==========================================
   CARD STYLES
   ========================================== */

.cer-card {
    background: #fff;
    border: 1px solid #e5e7eb;
    border-radius: 12px;
    padding: 20px;
    margin-bottom: 16px;
}

.cer-card h3 {
    margin-top: 0;
    margin-bottom: 16px;
    font-size: 18px;
    font-weight: 600;
    color: #1e293b;
}


/* ==========================================
   ASSIGN CONTROLS
   ========================================== */

.cer-assign {
    display: flex;
    gap: 4px;
    align-items: center;
}

.cer-assign select {
    padding: 4px 6px;
    font-size: 12px;
    border: 1px solid #d1d5db;
    border-radius: 4px;
}

.cer-assign .cer-table {
    width: 50px;
}

.cer-assign .cer-seat {
    width: 40px;
}

.cer-assign-btn {
    padding: 4px 8px !important;
    font-size: 12px !important;
}


/* ==========================================
   ATTENDEE TABLE IN MODAL
   ========================================== */

.cer-att-table {
    font-size: 13px;
}

.cer-att-table th,
.cer-att-table td {
    padding: 6px 8px;
}

.cer-att-table .cer-pick {
    margin: 0;
}
