/* ═══════════════════════════════════════════════════════════════
   StaffHub — ID Badge Generator Styles (Mobile-Optimized)
   ═══════════════════════════════════════════════════════════════ */

/* ── Modal two-panel layout ──────────────────────────────────── */
.badge-modal-layout {
    display: grid;
    grid-template-columns: 300px 1fr;
    gap: 0;
    min-height: 460px;
}

.badge-panel-left {
    padding: 1.25rem;
    border-right: 1px solid #e2e8f0;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.badge-panel-right {
    padding: 1.25rem;
    display: flex;
    flex-direction: column;
}

/* ── Logo upload zone ────────────────────────────────────────── */
.badge-logo-section {
    margin-bottom: 1rem;
    padding-bottom: 1rem;
    border-bottom: 1px solid #e2e8f0;
}

.badge-logo-zone {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 0.75rem;
    border: 2px dashed #cbd5e1;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.2s;
    background: #fafafa;
    /* Larger touch target on all devices */
    min-height: 60px;
}

.badge-logo-zone:hover {
    border-color: #1a73e8;
    background: #f8fafc;
}

/* ── Staff checkbox list ─────────────────────────────────────── */
.badge-staff-list {
    flex: 1;
    overflow-y: auto;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    max-height: 280px;
    -webkit-overflow-scrolling: touch;
}

.badge-staff-row {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.5rem 0.625rem;
    cursor: pointer;
    transition: background 0.15s;
    border-bottom: 1px solid #f1f5f9;
    font-size: 0.8125rem;
    /* Minimum touch target height (44px Apple HIG) */
    min-height: 44px;
}

.badge-staff-row:last-child {
    border-bottom: none;
}

.badge-staff-row:hover {
    background: #f8fafc;
}

/* Active/tap state for touch devices */
.badge-staff-row:active {
    background: #e8f0fe;
}

.badge-staff-row input[type="checkbox"] {
    width: 18px;
    height: 18px;
    flex-shrink: 0;
    accent-color: #1a73e8;
    cursor: pointer;
}

.badge-staff-name {
    flex: 1;
    font-weight: 600;
    color: #0f172a;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    min-width: 0;
}

.badge-staff-meta {
    font-size: 0.75rem;
    color: #94a3b8;
    font-weight: 500;
    flex-shrink: 0;
}

/* ── Tablet (≤ 900px) ────────────────────────────────────────── */
@media (max-width: 900px) {
    .badge-modal-layout {
        grid-template-columns: 260px 1fr;
        min-height: 400px;
    }
}

/* ── Mobile (≤ 700px) — stack panels vertically ──────────────── */
@media (max-width: 700px) {
    .badge-modal-layout {
        grid-template-columns: 1fr;
        min-height: unset;
    }

    .badge-panel-left {
        border-right: none;
        border-bottom: 1px solid #e2e8f0;
        padding: 1rem;
        /* Don't over-constrain — let content breathe */
        max-height: none;
        overflow: visible;
    }

    .badge-panel-right {
        padding: 1rem;
    }

    /* Compact logo section on mobile */
    .badge-logo-section {
        margin-bottom: 0.75rem;
        padding-bottom: 0.75rem;
    }

    .badge-logo-zone {
        padding: 0.5rem;
        min-height: 48px;
        flex-direction: row;
        gap: 0.5rem;
    }

    .badge-logo-zone i {
        font-size: 1.25rem !important;
    }

    .badge-logo-zone p {
        margin: 0 !important;
    }

    /* Staff list takes available space but caps out */
    .badge-staff-list {
        max-height: 200px;
    }

    /* Slightly bigger rows for fat-finger friendliness */
    .badge-staff-row {
        padding: 0.625rem 0.75rem;
        gap: 0.625rem;
        min-height: 48px;
    }

    .badge-staff-row input[type="checkbox"] {
        width: 20px;
        height: 20px;
    }

    .badge-staff-name {
        font-size: 0.875rem;
    }
}

/* ── Small phones (≤ 480px) ──────────────────────────────────── */
@media (max-width: 480px) {
    .badge-panel-left,
    .badge-panel-right {
        padding: 0.75rem;
    }

    .badge-staff-list {
        max-height: 180px;
        border-radius: 6px;
    }

    .badge-staff-row {
        font-size: 0.8125rem;
    }

    /* Hide meta on very small screens to save space */
    .badge-staff-meta {
        display: none;
    }
}

/* ── Safe area support for notched phones ────────────────────── */
@supports (padding-bottom: env(safe-area-inset-bottom)) {
    @media (max-width: 700px) {
        .badge-panel-right {
            padding-bottom: calc(0.75rem + env(safe-area-inset-bottom));
        }
    }
}