/* ========================================
   BOQ Modal System — Unified Styles
   ======================================== */

/* Base modal */
.boq-modal { }

/*
 * Strip Blazored.Modal wrapper for ALL custom BOQ/CB modals.
 * Covers: .boq-modal, .cpboq-modal, .cb-preview-modal, .boq-choice-modal
 * Scoped to our prefixes only — does NOT affect other app modals.
 */
.bm-content:has(> .boq-modal),
.bm-content:has(> .cpboq-modal),
.bm-content:has(> .cb-preview-modal),
.bm-content:has(> .boq-choice-modal) {
    padding: 0 !important;
    margin-top: 0 !important;
}

.blazored-modal:has(.boq-modal) .bm-header,
.blazored-modal:has(.cpboq-modal) .bm-header,
.blazored-modal:has(.cb-preview-modal) .bm-header,
.blazored-modal:has(.boq-choice-modal) .bm-header {
    display: none !important;
}

.blazored-modal:has(.boq-modal),
.blazored-modal:has(.cpboq-modal),
.blazored-modal:has(.cb-preview-modal),
.blazored-modal:has(.boq-choice-modal) {
    border-radius: 0.5rem !important;
    overflow: hidden !important;
    padding: 0 !important;
    /* Prevent the default white background from showing through rounded corners
       before the header gradient paints. */
    background: transparent !important;
}

/* Make sure the bm-content itself has no bg either */
.bm-content:has(> .boq-modal),
.bm-content:has(> .cpboq-modal),
.bm-content:has(> .cb-preview-modal),
.bm-content:has(> .boq-choice-modal) {
    background: transparent !important;
}

.boq-modal-header {
    background: linear-gradient(135deg, var(--boq-modal-color, #003951) 0%, var(--boq-modal-color-light, #005a7a) 100%);
    color: white;
    padding: 1rem 1.25rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.boq-modal-header h5,
.boq-modal-header h6 {
    margin: 0;
    font-size: 1rem;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.boq-modal-close {
    background: transparent !important;
    border: none !important;
    color: rgba(255,255,255,0.8) !important;
    padding: 0.25rem !important;
    min-width: auto !important;
    cursor: pointer;
}
.boq-modal-close:hover {
    color: white !important;
}

.boq-modal-body {
    background: #f8fafc;
    padding: 1.25rem;
}

.boq-modal-footer {
    padding: 0.75rem 1.25rem;
    display: flex;
    justify-content: flex-end;
    gap: 0.5rem;
    border-top: 1px solid #e2e8f0;
    background: white;
}

/* Field labels */
.boq-modal .boq-field-label {
    font-size: 0.85rem;
    font-weight: 600;
    color: #374151;
    margin-bottom: 0.25rem;
}

/* Per-modal color overrides */
.boq-modal--success { --boq-modal-color: #28a745; --boq-modal-color-light: #34d058; }
.boq-modal--warning { --boq-modal-color: #ED880E; --boq-modal-color-light: #f5a623; }
.boq-modal--info { --boq-modal-color: #17a2b8; --boq-modal-color-light: #1fc8e3; }
.boq-modal--danger { --boq-modal-color: #dc2626; --boq-modal-color-light: #ef4444; }

/* KPI mini-cards used in modals */
.boq-modal-kpi-strip {
    display: flex;
    gap: 0.75rem;
    margin-bottom: 1rem;
}

.boq-modal-kpi {
    flex: 1;
    background: white;
    border-radius: 0.5rem;
    padding: 0.75rem;
    text-align: center;
    border-top: 3px solid #003951;
    box-shadow: 0 1px 3px rgba(0,0,0,0.06);
}

.boq-modal-kpi-label {
    font-size: 0.75rem;
    color: #64748b;
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 0.025em;
}

.boq-modal-kpi-value {
    font-size: 1.25rem;
    font-weight: 700;
    color: #1e293b;
    margin-top: 0.125rem;
}

/* Score bar visualization */
.boq-score-bar {
    height: 6px;
    background: #e2e8f0;
    border-radius: 3px;
    overflow: hidden;
    width: 100%;
}

.boq-score-bar-fill {
    height: 100%;
    border-radius: 3px;
    transition: width 300ms ease;
}

.boq-score-bar-fill--green { background: #28a745; }
.boq-score-bar-fill--blue { background: #17a2b8; }
.boq-score-bar-fill--orange { background: #ED880E; }
.boq-score-bar-fill--red { background: #dc2626; }

/* Section cards within modals */
.boq-modal-section {
    background: white;
    border-radius: 0.5rem;
    padding: 1rem;
    margin-bottom: 1rem;
    box-shadow: 0 1px 3px rgba(0,0,0,0.06);
}

.boq-modal-section-title {
    font-size: 0.85rem;
    font-weight: 600;
    color: #374151;
    margin-bottom: 0.75rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

/* Progress ring (for completion modals) */
.boq-progress-ring {
    display: flex;
    align-items: center;
    justify-content: center;
}

/* Company chip/tag */
.boq-company-chip {
    display: inline-flex;
    align-items: center;
    gap: 0.375rem;
    padding: 0.25rem 0.625rem;
    background: #003951;
    color: white;
    border-radius: 1rem;
    font-size: 0.8rem;
    font-weight: 500;
}

.boq-company-chip--locked {
    opacity: 0.7;
}

.boq-company-chip .boq-chip-remove {
    cursor: pointer;
    opacity: 0.7;
    font-size: 0.7rem;
}
.boq-company-chip .boq-chip-remove:hover {
    opacity: 1;
}

/* Dropzone */
.boq-dropzone {
    border: 2px dashed #cbd5e1;
    border-radius: 0.75rem;
    padding: 2rem;
    text-align: center;
    cursor: pointer;
    transition: all 200ms ease;
    background: white;
}

.boq-dropzone:hover {
    border-color: #003951;
    background: rgba(0,57,81,0.02);
}

.boq-dropzone-icon {
    font-size: 2rem;
    color: #94a3b8;
    margin-bottom: 0.75rem;
}

/* Step indicator (for multi-step modals) */
.boq-steps {
    display: flex;
    justify-content: center;
    gap: 1.5rem;
    margin-bottom: 1.25rem;
}

.boq-step {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.8rem;
    color: #94a3b8;
}

.boq-step--active {
    color: #003951;
    font-weight: 600;
}

.boq-step--done {
    color: #28a745;
}

.boq-step-number {
    width: 24px;
    height: 24px;
    border-radius: 50%;
    background: #e2e8f0;
    color: #64748b;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.75rem;
    font-weight: 600;
}

.boq-step--active .boq-step-number {
    background: #003951;
    color: white;
}

.boq-step--done .boq-step-number {
    background: #28a745;
    color: white;
}

/* Summary card (for confirm steps) */
.boq-summary-card {
    background: white;
    border: 1px solid #e2e8f0;
    border-radius: 0.75rem;
    padding: 1.5rem;
    text-align: center;
}

.boq-summary-card-title {
    font-size: 1rem;
    font-weight: 600;
    color: #1e293b;
    margin-bottom: 1rem;
}

.boq-summary-card-items {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 1rem;
    margin-bottom: 1rem;
}

.boq-summary-card-item {
    display: flex;
    align-items: center;
    gap: 0.375rem;
    padding: 0.375rem 0.75rem;
    background: #f0f4f8;
    border-radius: 0.375rem;
    font-size: 0.85rem;
    color: #374151;
}

/* Choice cards (for CreateProjectChoiceModal pattern) */
.boq-choice-cards {
    display: flex;
    gap: 1rem;
}

.boq-choice-card {
    flex: 1;
    background: white;
    border: 2px solid #e2e8f0;
    border-radius: 0.75rem;
    padding: 1.5rem;
    text-align: center;
    cursor: pointer;
    transition: all 200ms ease;
}

.boq-choice-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0,0,0,0.1);
}

.boq-choice-card-icon {
    width: 56px;
    height: 56px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 0.75rem;
}

.boq-choice-card h6 {
    font-weight: 600;
    color: #1e293b;
    margin-bottom: 0.5rem;
}

.boq-choice-card p {
    font-size: 0.8rem;
    color: #64748b;
    margin: 0;
}
