/* ==========================================================================
   Opportunity Detail (opp-detail) — Phase 8 Sprint 8.3
   ========================================================================== */

.opp-detail__header {
    background: var(--brand-primary, #46062b);
    color: #fff;
    padding: 1.25rem 1.5rem;
    border-radius: var(--opp-card-radius, 0.5rem);
    margin-bottom: 0;
}

.opp-detail__template {
    display: block;
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    opacity: 0.8;
    margin-bottom: 0.25rem;
}

.opp-detail__title {
    font-size: 1.5rem;
    font-weight: 700;
    margin: 0;
    line-height: 1.3;
}

.opp-detail__header-meta {
    margin-top: 0.5rem;
}

.opp-detail__header-meta .badge {
    font-size: 0.7rem;
}

/* Role roster list — vertical list like workers page */
.opp-detail__roles {
    display: flex;
    flex-direction: column;
    gap: 0;
}

/* Individual role roster row — CSS Grid for responsive layout */
.opp-detail__role-tile {
    display: grid;
    grid-template-columns: 1fr auto auto auto;
    align-items: center;
    gap: 0.5rem 0.75rem;
    padding: 0.625rem 0.75rem;
    border-bottom: 1px solid #e5e7eb;
}

.opp-detail__role-tile:last-child {
    border-bottom: none;
}

.opp-detail__role-tile.role-tile--filled {
    background: transparent;
}

.opp-detail__role-tile.role-tile--mine {
    background: var(--role-tile-mine-bg, color-mix(in srgb, var(--brand-primary) 10%, white));
}

.opp-detail__role-tile.role-tile--open {
    background: transparent;
}

.opp-detail__role-identity {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    min-width: 0;
    flex: 1;
}

.opp-detail__role-info {
    display: flex;
    flex-direction: column;
    min-width: 0;
}

.opp-detail__role-name {
    font-weight: 600;
    font-size: 0.875rem;
    color: #1f2937;
    line-height: 1.2;
}

.opp-detail__role-worker-name {
    font-size: 0.8125rem;
    color: #6b7280;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.opp-detail__role-status {
    font-size: 0.8125rem;
}

.opp-detail__role-meta {
    font-size: 0.75rem;
    color: #6b7280;
}

.opp-detail__role-contact {
    display: flex;
    align-items: center;
    gap: 0.25rem;
    flex-shrink: 0;
}

.opp-detail__role-warning {
    font-size: 0.75rem;
    color: var(--color-warning, #f59e0b);
}

.opp-detail__role-action {
    display: flex;
    gap: 0.25rem;
    align-items: center;
    flex-shrink: 0;
}

.opp-detail__role-suggestions {
    margin-top: 0.375rem;
    padding-top: 0.375rem;
    border-top: 1px solid rgba(0, 0, 0, 0.06);
}

/* Admin remove-worker button — red on hover */
.btn-remove-worker:hover {
    color: #dc2626 !important;
    border-color: #fca5a5 !important;
    background: #fef2f2 !important;
}

/* ==========================================================================
   Opportunity Properties Editor — v2 (Phase 12+)
   ========================================================================== */

/* Section label — uppercase micro-heading with rule */
.opp-props__section-label {
    font-size: 11px;
    font-weight: 600;
    letter-spacing: 0.8px;
    color: var(--color-text-muted, #95a5a6);
    text-transform: uppercase;
    margin-bottom: 12px;
    padding-bottom: 6px;
    border-bottom: 1px solid #eee;
}

/* Field wrapper */
.opp-props__field-group {
    margin-bottom: 4px;
}

.opp-props__field-label {
    font-size: 12px;
    font-weight: 500;
    color: #888;
    margin-bottom: 2px;
}

/* Read-only display: no cursor change, no hover */
.opp-props__field-readonly {
    font-size: 14px;
    color: #333;
    padding: 6px 8px;
    min-height: 34px;
    display: flex;
    align-items: center;
    cursor: default;
}

/* Click-to-edit container: transparent border at rest, highlighted on interaction */
.opp-props__field-editable {
    font-size: 14px;
    color: #333;
    padding: 2px 4px;
    border-radius: 6px;
    border: 1px solid transparent;
    cursor: text;
    transition: background 0.15s, border-color 0.15s, box-shadow 0.15s;
    min-height: 34px;
    display: flex;
    align-items: center;
}

.opp-props__field-editable:hover {
    background: #f0f4f8;
    border-color: #e0e4e8;
}

.opp-props__field-editable:focus-within {
    background: white;
    border-color: var(--brand-accent, #3498db);
    box-shadow: 0 0 0 2px rgba(52, 152, 219, 0.15);
}

.opp-props__field-editable input,
.opp-props__field-editable select,
.opp-props__field-editable textarea {
    border: none;
    outline: none;
    background: transparent;
    width: 100%;
    font-size: 14px;
    color: #333;
    padding: 4px 4px;
    font-family: inherit;
}

.opp-props__field-editable textarea {
    resize: vertical;
    min-height: 60px;
    padding-top: 6px;
}

/* Address block — matches _address_autocomplete.html layout */
.opp-props__address-block {
    max-width: 480px;
}

.opp-props__address-input {
    font-size: 13px;
}

.opp-props__address-input:focus {
    border-color: var(--brand-accent, #3498db);
    box-shadow: 0 0 0 2px rgba(52, 152, 219, 0.15);
}

/* Save indicator — copied exactly from public-form.css (lines 614-668) */
.save-indicator {
    display: inline-flex;
    align-items: center;
    gap: 0.375rem;
    font-size: 0.75rem;
    color: var(--color-text-muted, #64748b);
    transition: color 0.25s ease;
}

.save-indicator::before {
    content: "";
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: var(--color-text-muted, #64748b);
    flex-shrink: 0;
    transition: background 0.25s ease;
}

.save-indicator--saving {
    color: var(--color-text-muted, #64748b);
}

.save-indicator--saving::before {
    background: var(--color-text-muted, #64748b);
    animation: pulse-save 1.2s ease-in-out infinite;
}

.save-indicator--saved {
    color: var(--color-success, #16a34a);
}

.save-indicator--saved::before {
    background: var(--color-success, #16a34a);
}

.save-indicator--error {
    color: var(--color-error, #ef4444);
}

.save-indicator--error::before {
    background: var(--color-error, #ef4444);
}

@keyframes pulse-save {
    0%, 100% { opacity: 1; transform: scale(1); }
    50%       { opacity: 0.4; transform: scale(0.8); }
}

/* Payment — inline at far right of tile */
.opp-detail__role-pay {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    flex-shrink: 0;
}

.opp-detail__pay-fields {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
}

.opp-detail__pay-field {
    display: flex;
    align-items: center;
    gap: 0.25rem;
}

.opp-detail__pay-label {
    font-size: 0.6875rem;
    color: #9ca3af;
    font-weight: 500;
    white-space: nowrap;
    margin: 0;
}

.opp-detail__pay-field .input-group {
    width: 100px;
}

.opp-detail__pay-field .input-group-text {
    padding: 0.15rem 0.35rem;
    font-size: 0.75rem;
    color: #9ca3af;
}

.opp-detail__pay-field .form-control-sm {
    padding: 0.15rem 0.35rem;
    font-size: 0.8125rem;
}

.opp-detail__pay-value {
    font-size: 0.8125rem;
    font-weight: 500;
    color: #374151;
    white-space: nowrap;
}

/* Mobile: stack tile into rows */
@media (max-width: 767.98px) {
    .opp-detail__role-tile {
        grid-template-columns: 1fr auto;
        gap: 0.375rem 0.5rem;
        padding: 0.75rem;
    }

    .opp-detail__role-identity {
        grid-column: 1;
    }

    .opp-detail__role-contact {
        grid-column: 2;
        grid-row: 1;
    }

    .opp-detail__role-action {
        grid-column: 1 / -1;
        justify-content: flex-start;
    }

    .opp-detail__role-pay {
        grid-column: 1 / -1;
        padding-top: 0.375rem;
        border-top: 1px solid #f3f4f6;
    }

    .opp-detail__role-meta,
    .opp-detail__role-warning {
        grid-column: 1 / -1;
    }
}
