/* ============================================================
   EB UI Components – Tables, Modals & Popups (v3 · 2026-05-09)
   Modal redesign based on Image 3: icon inside card body,
   bolder colors, stronger warning signals.
   Typography: Poppins (inherits from eb_theme.css)
   ============================================================ */

/* ── List Table Wrapper ────────────────────────────────────── */
.eb-list-table-wrap {
    border: 2px solid color-mix(in srgb, var(--eb-brand, #C84C4C) 25%, white) !important;
    border-top: 4px solid var(--eb-brand, #C84C4C) !important;
    border-radius: var(--eb-radius-lg, 18px) !important;
    background: #ffffff !important;
    box-shadow: 0 8px 24px rgba(200, 76, 76, 0.12), 0 2px 8px rgba(15, 23, 42, 0.08) !important;
    overflow-x: auto;
}

/* ── List Table ────────────────────────────────────────────── */
.eb-list-table {
    min-width: 100%;
    border-collapse: collapse;
    font-size: 12px;
    color: #334155;
}

.eb-list-table thead th {
    padding: 14px 18px !important;
    font-size: 11px !important;
    font-weight: 700 !important;
    text-transform: uppercase !important;
    letter-spacing: 0.08em !important;
    color: #1e293b !important;
    background: #ffffff !important;
    border: none !important;
    border-bottom: 2px solid var(--eb-brand, #C84C4C) !important;
    white-space: nowrap !important;
    text-align: left !important;
}

.eb-list-table tbody tr {
    transition: background-color 0.15s ease-in-out, box-shadow 0.15s ease-in-out !important;
}

.eb-list-table tbody td {
    padding: 14px 18px !important;
    border: none !important;
    border-bottom: 1px solid color-mix(in srgb, #0f172a 10%, white) !important;
    vertical-align: middle !important;
    font-weight: 600 !important;
    background: transparent !important;
    color: #1e293b !important;
}

.eb-list-table tbody tr:last-child td {
    border-bottom: none;
}

.eb-list-table tbody tr:hover {
    background-color: color-mix(in srgb, var(--eb-brand, #C84C4C) 5%, white) !important;
    box-shadow: inset 4px 0 0 var(--eb-brand, #C84C4C);
}

.eb-list-table tbody td.action-cell {
    color: #cbd5e1;
    font-weight: 800;
    letter-spacing: 2px;
    cursor: pointer;
}

/* ── Modal Backdrop ────────────────────────────────────────── */
.eb-modal-backdrop {
    position: fixed;
    inset: 0;
    z-index: 1000;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 16px;
    background: rgba(15, 23, 42, 0.45);
    backdrop-filter: blur(4px);
}

/* ═══════════════════════════════════════════════════════════════
   Modal Card – Image 3 "Strong" Design
   ═══════════════════════════════════════════════════════════════
   Icon sits INSIDE the card body (not overlapping the top edge).
   Larger icon container with rounded-square background.
   Bolder title, cleaner spacing, prominent action buttons.
   ─────────────────────────────────────────────────────────────── */
.eb-modal-card {
    position: relative;
    width: min(400px, 100%);
    border-radius: 20px;
    border: none;
    background: #ffffff;
    box-shadow: 0 25px 60px rgba(15, 23, 42, 0.22);
    text-align: center;
    padding: 32px 28px 24px;
    animation: eb-modal-enter 0.25s ease-out;
}

@keyframes eb-modal-enter {
    from {
        opacity: 0;
        transform: translateY(16px) scale(0.95);
    }
    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

/* ── Modal Icon (Image 3: inside card, large rounded square) ── */
.eb-modal-icon {
    position: static;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 64px;
    height: 64px;
    margin: 0 auto 18px;
    border-radius: 16px;
    border: none;
    color: #ffffff;
    font-size: 28px;
    line-height: 1;
    transform: none;
}

/* ── Modal Text ────────────────────────────────────────────── */
.eb-modal-title {
    margin: 0;
    font-size: 20px;
    line-height: 1.3;
    font-weight: 700;
    color: #1e293b;
}

.eb-modal-message {
    margin: 10px auto 24px;
    max-width: 320px;
    font-size: 13px;
    font-weight: 400;
    line-height: 1.55;
    color: #64748b;
}

/* ── Modal Action Buttons ──────────────────────────────────── */
.eb-modal-actions {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 12px;
}

.eb-modal-actions-single {
    grid-template-columns: minmax(0, 1fr);
    justify-items: center;
}

.eb-modal-btn {
    border: none;
    border-radius: 12px;
    padding: 12px 18px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: background-color 0.15s ease-in-out, transform 0.1s ease, box-shadow 0.15s ease-in-out;
}

.eb-modal-btn:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 14px rgba(15, 23, 42, 0.12);
}

.eb-modal-btn:active {
    transform: translateY(0);
}

.eb-modal-actions-single .eb-modal-btn {
    width: min(200px, 100%);
}

/* Cancel button (Image 3 style: light gray, subtle) */
.eb-modal-btn-cancel {
    background: #f1f5f9;
    color: #475569;
}

.eb-modal-btn-cancel:hover {
    background: #e2e8f0;
}

/* Confirm button (Image 3 style: bold brand-colored) */
.eb-modal-btn-primary {
    background: var(--eb-brand, #C84C4C);
    color: #ffffff;
}

.eb-modal-btn-primary:hover {
    background: color-mix(in srgb, var(--eb-brand, #C84C4C) 85%, #0f172a);
}

/* Danger button (Image 3 style: strong red like Delete Account) */
.eb-modal-btn-danger {
    background: #ff4757;
    color: #ffffff;
}

.eb-modal-btn-danger:hover {
    background: #ee3545;
}

/* ── Modal Tone Variants (Icon BG colors) ──────────────────── */
.eb-modal-success .eb-modal-icon {
    background: #10b981;
}

.eb-modal-error .eb-modal-icon {
    background: #ff4757;
}

.eb-modal-info .eb-modal-icon {
    background: var(--eb-brand, #C84C4C);
}


/* ── Round Avatar Safeguard (fixes oval avatars on long names) ────────────
   When a circular avatar sits in a flex row next to a long display name,
   the flex algorithm can squeeze it into an oval. Force any element with
   both `rounded-full` and one of the standard fixed sizes to never shrink
   and to keep a 1:1 aspect ratio. This is a no-op when the avatar already
   has `shrink-0 aspect-square` Tailwind classes applied. */
.rounded-full.h-7.w-7,
.rounded-full.h-8.w-8,
.rounded-full.h-9.w-9,
.rounded-full.h-10.w-10,
.rounded-full.h-12.w-12,
.rounded-full.h-14.w-14,
.rounded-full.h-16.w-16 {
    flex-shrink: 0 !important;
    flex-grow: 0 !important;
    aspect-ratio: 1 / 1 !important;
}

/* Image inside a circular avatar must always render as a perfect square so
   the parent's overflow:hidden produces a circle, not an oval. */
.rounded-full > img {
    aspect-ratio: 1 / 1 !important;
    width: 100% !important;
    height: 100% !important;
    object-fit: cover !important;
}
