/* ==========================================================================
   Signup Groups — HC-style grouped role rows (Phase 8)
   Spacing & sizing matched to Holland Central available_shoots.html
   ========================================================================== */

.signup-groups {
    width: 100%;
    margin: 0;
    display: grid;
    grid-template-columns: 1fr;
    gap: 0.75rem;
    align-items: start;
}

/* Group container — white bg starts halfway up the pill */
.signup-group {
    background: transparent;
    position: relative;
    margin: 0;
}

.signup-group::before {
    content: '';
    position: absolute;
    /* White bg splits through the pill's vertical center */
    top: 2.1rem;
    left: 0;
    right: 0;
    bottom: 0;
    background: #fff;
    border: 1px solid #e5e7eb;
    border-radius: 12px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
    z-index: 0;
}

/* Inline header — icon button + pill */
.signup-group__header {
    position: relative;
    z-index: 1;
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 0.875rem 1rem 0.125rem;
}

/* Icon button — non-clickable glass element, height matches the pill.
   Scoped selector overrides .header-btn / .header-btn-icon in main.css. */
.signup-group .signup-group__icon-btn {
    height: 2.05rem;
    min-width: 2.05rem;
    width: 2.05rem;
    padding: 0;
    border-radius: 999px;
    font-size: 0.9rem;
    cursor: default;
    pointer-events: none;
}

/* Title row — aligned with icon center */
.signup-group__title-wrap {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 10px;
    min-width: 0;
}

/* Black pill title — matched to HC .group-title */
.signup-group__pill {
    background: #111827;
    color: #fff;
    font-weight: 800;
    border-radius: 999px;
    padding: 0.35rem 0.9rem;
    font-size: clamp(1.0rem, 1.5vw, 1.2rem);
    letter-spacing: 0.15px;
    text-decoration: none;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 100%;
    transition: background 200ms ease, box-shadow 200ms ease;
}

.signup-group__pill:hover {
    background: #1f2937;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
    color: #fff;
    text-decoration: none;
}

.signup-group__contact {
    font-size: 0.8125rem;
    color: #6b7280;
    font-weight: 600;
    white-space: nowrap;
}

.signup-group__location {
    font-size: 0.8125rem;
    color: #1967D2;
    font-weight: 600;
    white-space: nowrap;
    text-decoration: none;
}

.signup-group__location:hover {
    text-decoration: underline;
    color: #1557b0;
}

.signup-group__location i {
    margin-right: 0.15rem;
}

.signup-group__ref {
    font-size: 0.75rem;
    color: #9ca3af;
    font-weight: 500;
    white-space: nowrap;
}

/* Crew avatars — directly right of the black pill, no overlap, pill-height matched */
.signup-group__crew {
    display: flex;
    align-items: center;
    flex-shrink: 0;
    margin-left: 0.5rem;
    gap: 0.35rem;
}

.signup-group__crew-avatar {
    width: 2.25rem;
    height: 2.25rem;
    font-size: 0.7rem;
    border: 2px solid #fff;
    cursor: default;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}

.signup-group__crew-avatar:first-child {
    margin-left: 0;
}

/* Crew avatar tooltips — multi-line (name + roles), centered */
.signup-group__crew-avatar[data-tooltip]::after {
    white-space: pre-line;
    text-align: center;
    min-width: 8rem;
}

/* Referral avatar tooltip — multi-line, centered */
.signup-group__referral-avatar[data-tooltip]::after {
    white-space: pre-line;
    text-align: center;
    min-width: 8rem;
}

/* Referral avatar — glows with brand color to draw attention.
   Override pointer-events:none from .signup-group__icon-btn so tooltip fires. */
.signup-group__referral-avatar {
    pointer-events: auto;
    cursor: default;
    box-shadow: 0 0 0 3px var(--brand-primary, #5e8aa8),
                0 0 12px color-mix(in srgb, var(--brand-primary, #5e8aa8) 40%, transparent);
    animation: referral-pulse 2s ease-in-out infinite;
}

@keyframes referral-pulse {
    0%, 100% { box-shadow: 0 0 0 3px var(--brand-primary, #5e8aa8), 0 0 8px color-mix(in srgb, var(--brand-primary, #5e8aa8) 30%, transparent); }
    50% { box-shadow: 0 0 0 3px var(--brand-primary, #5e8aa8), 0 0 16px color-mix(in srgb, var(--brand-primary, #5e8aa8) 50%, transparent); }
}

/* Shoot type / template name label */
.signup-group__type {
    font-size: 0.8rem;
    color: #6b7280;
    font-weight: 600;
    white-space: nowrap;
    background: #f3f4f6;
    padding: 0.15rem 0.55rem;
    border-radius: 999px;
}

/* Role row — desktop grid
   name | date/location (150px) | properties (150px) | action */
.signup-role-row {
    position: relative;
    z-index: 1;
    display: grid;
    grid-template-columns: 1fr 150px 150px minmax(0, auto);
    align-items: center;
    gap: 0 0.75rem;
    padding: 0.65rem 1rem;
    line-height: 1.25;
    overflow: hidden;
}

/* Border between consecutive role rows only (not between header and first role) */
.signup-role-row + .signup-role-row {
    border-top: 1px solid #e5e7eb;
}


/* Pay pill — inline badge next to role name */
.pay-pill {
    display: inline-block;
    padding: 0.25rem 0.6rem;
    border-radius: 8px;
    background: linear-gradient(180deg, #32d583, #16a34a);
    color: #fff;
    font-weight: 700;
    font-size: 0.875rem;
    box-shadow: 0 2px 6px rgba(22, 163, 74, 0.25);
    vertical-align: middle;
    margin-left: 0.4rem;
}

/* Role name — matched to HC .role-name */
.signup-role-row__name {
    font-size: clamp(1.05rem, 1.2vw, 1.2rem);
    font-weight: 800;
    color: #1f2937;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    text-align: left;
}

/* Info cell — date pill + map pill stacked vertically */
.signup-role-row__info {
    display: flex;
    flex-direction: column;
    gap: 0.15rem;
    min-width: 0;
}

/* Each info row: icon button + text horizontally aligned */
.signup-role-row__info-row {
    display: flex;
    align-items: center;
    gap: 0.3rem;
}

/* Smaller icon buttons inside info rows */
.signup-role-row__info-row .header-btn {
    height: 22px;
    min-width: 22px;
    padding: 0;
    width: 22px;
}

.signup-role-row__info-row .header-btn i {
    font-size: 0.7rem;
}

/* Shared text style next to icon buttons */
.signup-role-row__info-text {
    font-size: 0.78rem;
    color: #4b5563;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

/* Date pill — icon-only button, clickable when worker has service_date */
.signup-role-row__date-pill {
    cursor: pointer;
}

.signup-role-row__date-pill i {
    color: #6366f1;
}

.signup-role-row__date-pill:hover i {
    color: #fff;
}

/* Map pill — icon-only button */
.signup-role-row__map-pill {
    white-space: nowrap;
}

.signup-role-row__map-pill .bi-geo-alt-fill {
    color: var(--color-danger, #dc3545);
}

.signup-role-row__map-pill:hover .bi-geo-alt-fill {
    color: #fff;
}

/* Remote desktop connect pill — virtual role rows */
.signup-role-row__connect-pill .bi-display {
    color: #0ea5e9; /* sky-500 */
}

.signup-role-row__connect-pill:hover .bi-display {
    color: #fff;
}

/* Props column — custom properties stacked vertically, same style as info */
.signup-role-row__props {
    display: flex;
    flex-direction: column;
    gap: 0.15rem;
    min-width: 0;
}

/* Extra left margin clears the button's 18px glow radius */
.signup-role-row__action {
    margin-left: 0.75rem;
}

/* Property pill — custom field values as info rows */
.signup-role-row__prop-pill .bi-tag-fill {
    color: var(--brand-primary, #6366f1);
}

.signup-role-row__prop-pill:hover .bi-tag-fill {
    color: #fff;
}

/* Date emoji icon — matched to HC .calendar-emoji */
.signup-role-row__date-icon {
    margin-right: 0.2rem;
}

/* Action buttons — matched to HC .btn-admin */
.btn-role {
    display: inline-block;
    padding: 0.6rem 1rem;
    border-radius: 12px;
    font-size: clamp(0.9rem, 1vw, 1.05rem);
    font-weight: 900;
    text-decoration: none;
    text-align: center;
    white-space: nowrap;
    cursor: default;
}

.btn-role--open {
    background: #fff;
    color: var(--brand-primary);
    /* Fallback for browsers without color-mix() support */
    box-shadow: 0 3px 18px rgba(99, 102, 241, 0.35),
                0 1px 6px rgba(255, 255, 255, 0.15);
    box-shadow: 0 3px 18px color-mix(in srgb, var(--brand-primary) 35%, transparent),
                0 1px 6px rgba(255, 255, 255, 0.15);
    cursor: pointer;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.btn-role--open:hover {
    transform: scale(1.05);
    /* Fallback for browsers without color-mix() support */
    box-shadow: 0 4px 28px rgba(99, 102, 241, 0.5),
                0 2px 10px rgba(255, 255, 255, 0.2);
    box-shadow: 0 4px 28px color-mix(in srgb, var(--brand-primary) 50%, transparent),
                0 2px 10px rgba(255, 255, 255, 0.2);
    color: var(--brand-primary);
    text-decoration: none;
}

/* Yay button — green with glow effects (matches btn-role--open pattern) */
.btn-role--yay {
    background: #fff;
    color: #16a34a;
    box-shadow: 0 3px 18px rgba(22, 163, 74, 0.35),
                0 1px 6px rgba(255, 255, 255, 0.15);
    cursor: pointer;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.btn-role--yay:hover {
    transform: scale(1.05);
    box-shadow: 0 4px 28px rgba(22, 163, 74, 0.5),
                0 2px 10px rgba(255, 255, 255, 0.2);
    color: #16a34a;
}

/* Nay button — red outline, no special effects */
.btn-role--nay {
    background: transparent;
    color: #dc2626;
    border: 2px solid #dc2626;
    cursor: pointer;
    transition: background 0.2s ease;
}

.btn-role--nay:hover {
    background: #fef2f2;
}

/* Locked row — dimmed, non-interactive */
.signup-role-row--locked {
    opacity: 0.45;
    pointer-events: none;
}

/* Skill gate lock button */
.btn-role--locked {
    background: transparent;
    color: #9ca3af;
    border: 2px dashed #d1d5db;
    font-size: 0.8rem;
    font-weight: 700;
    cursor: not-allowed;
}

.btn-role--locked .bi-lock-fill { margin-right: 0.25rem; }

/* Badge variants */
.badge-role {
    display: inline-block;
    font-size: 0.78rem;
    font-weight: 700;
    line-height: 1.1;
    text-align: center;
    padding: 0.4rem 0.7rem;
    border-radius: 10px;
    cursor: default;
}
.badge-role--invited { background: var(--brand-highlight, #e8f0fe); color: var(--brand-primary, #5e8aa8); }
.badge-role--pending { background: var(--brand-highlight, #e8f0fe); color: var(--brand-primary, #5e8aa8); }
.badge-role--approved { background: #dcfce7; color: #166534; }

/* Locked info row */
.signup-role-row__locked-info {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.35rem;
    flex-wrap: wrap;
}

/* Green flash on successful signup/accept (Phase 3) */
@keyframes signup-success-flash {
    0%   { background-color: #dcfce7; }
    100% { background-color: transparent; }
}
.signup-role-row--success-flash {
    animation: signup-success-flash 1.5s ease-out forwards;
}

/* Assign panel header — uses org brand color instead of impersonate red */
.assign-panel .impersonate-modal-header {
    background: var(--brand-primary, #5e8aa8);
}

/* ===== Mobile: HC-style stacked role rows ===== */
@media (max-width: 768px) {
    .signup-groups {
        grid-template-columns: 1fr;
    }

    /* Mobile role rows: name top, info+props left, button right */
    .signup-role-row {
        grid-template-columns: 1fr auto;
        gap: 0.25rem 0.5rem;
        padding: 0.55rem 1rem;
    }

    /* Row 1: name spans full width */
    .signup-role-row__name {
        grid-column: 1 / -1;
        justify-self: start;
        font-size: 1.2rem;
    }

    /* Info and props stack in left column */
    .signup-role-row__info {
        grid-column: 1;
        flex-wrap: wrap;
    }

    .signup-role-row__props {
        grid-column: 1;
    }

    /* Action in right column, auto-spanning all info/props rows */
    .signup-role-row__action {
        grid-row: 2 / -1;
        grid-column: 2;
        justify-self: end;
        align-self: center;
        margin-left: 0;
    }

    .pay-pill {
        font-size: 0.75rem;
    }

    .signup-group__pill {
        max-width: 60%;
    }

    .signup-group__crew-avatar {
        margin-left: -8px;
    }

    .signup-group__crew-avatar:first-child {
        margin-left: 0;
    }

    .btn-role {
        padding: 0.8rem 1.2rem;
        font-size: 1.12rem;
        border-radius: 12px;
    }
}

@media (max-width: 480px) {
    .signup-role-row__action {
        grid-row: -1;
        grid-column: 1 / -1;
        justify-self: stretch;
    }

    .btn-role {
        display: block;
        text-align: center;
    }

    .signup-group__ref,
    .signup-group__template {
        display: none;
    }
}
