/* ============================================
   PNIA — Módulo 04: SWOT  v1.0.0
   ============================================ */

#pnia-mod04-wrap {
    font-family: 'Segoe UI', system-ui, sans-serif;
    color: #1a1a2e;
    padding: 8px 0;
}

/* ── SPINNER ── */
.pnia-swot-spinner {
    width: 36px;
    height: 36px;
    border: 3px solid #e2e8f0;
    border-top-color: #4f46e5;
    border-radius: 50%;
    animation: pnia-spin 0.7s linear infinite;
    margin: 0 auto 12px;
}
@keyframes pnia-spin { to { transform: rotate(360deg); } }

#pnia-mod04-loading {
    text-align: center;
    padding: 48px 24px;
    color: #64748b;
    font-size: 14px;
}

/* ── EMPTY STATE ── */
.pnia-swot-empty-state {
    text-align: center;
    padding: 52px 32px;
    background: linear-gradient(135deg, #f8faff 0%, #f0f4ff 100%);
    border-radius: 16px;
    border: 2px dashed #c7d2fe;
}
.pnia-swot-empty-icon {
    font-size: 52px;
    margin-bottom: 16px;
    filter: drop-shadow(0 4px 8px rgba(79,70,229,0.2));
}
.pnia-swot-empty-state h3 {
    font-size: 22px;
    font-weight: 700;
    color: #1e1b4b;
    margin: 0 0 10px;
}
.pnia-swot-empty-state p {
    font-size: 14px;
    color: #64748b;
    max-width: 440px;
    margin: 0 auto 28px;
    line-height: 1.6;
}

/* ── BOTÕES ── */
.pnia-swot-btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 9px 18px;
    border-radius: 8px;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    border: none;
    transition: all 0.18s ease;
    line-height: 1;
}
.pnia-swot-btn:disabled {
    opacity: 0.55;
    cursor: not-allowed;
}
.pnia-swot-btn-primary {
    background: linear-gradient(135deg, #4f46e5, #7c3aed);
    color: #fff;
    box-shadow: 0 4px 14px rgba(79,70,229,0.35);
}
.pnia-swot-btn-primary:hover:not(:disabled) {
    transform: translateY(-1px);
    box-shadow: 0 6px 20px rgba(79,70,229,0.45);
}
.pnia-swot-btn-large {
    padding: 13px 28px;
    font-size: 15px;
    border-radius: 10px;
}
.pnia-swot-btn-outline {
    background: #fff;
    color: #4f46e5;
    border: 2px solid #c7d2fe;
}
.pnia-swot-btn-outline:hover:not(:disabled) {
    background: #f0f4ff;
    border-color: #818cf8;
}
.pnia-swot-btn-success {
    background: linear-gradient(135deg, #059669, #10b981);
    color: #fff;
    box-shadow: 0 4px 12px rgba(5,150,105,0.3);
}
.pnia-swot-btn-success:hover:not(:disabled) {
    transform: translateY(-1px);
    box-shadow: 0 6px 18px rgba(5,150,105,0.4);
}

/* ── HEADER DO EDITOR ── */
.pnia-swot-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 12px;
    margin-bottom: 20px;
}
.pnia-swot-header h3 {
    font-size: 20px;
    font-weight: 700;
    color: #1e1b4b;
    margin: 0 0 4px;
}
.pnia-swot-subtitle {
    font-size: 13px;
    color: #64748b;
    margin: 0;
}
.pnia-swot-header-actions {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
}

/* ── MATRIZ 2x2 ── */
.pnia-swot-matrix {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 14px;
}
@media (max-width: 600px) {
    .pnia-swot-matrix { grid-template-columns: 1fr; }
    .pnia-swot-header { flex-direction: column; }
}

/* ── QUADRANTES ── */
.pnia-swot-quadrant {
    border-radius: 14px;
    padding: 18px;
    border: 1px solid transparent;
    transition: box-shadow 0.2s ease;
    position: relative;
}
.pnia-swot-quadrant:hover {
    box-shadow: 0 4px 20px rgba(0,0,0,0.07);
}

.pnia-swot-forcas {
    background: linear-gradient(145deg, #f0fdf4, #dcfce7);
    border-color: #bbf7d0;
}
.pnia-swot-fraquezas {
    background: linear-gradient(145deg, #fff7ed, #ffedd5);
    border-color: #fed7aa;
}
.pnia-swot-oportunidades {
    background: linear-gradient(145deg, #eff6ff, #dbeafe);
    border-color: #bfdbfe;
}
.pnia-swot-ameacas {
    background: linear-gradient(145deg, #fdf2f8, #fce7f3);
    border-color: #fbcfe8;
}

/* ── HEADER DO QUADRANTE ── */
.pnia-swot-quadrant-header {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 14px;
}
.pnia-swot-quadrant-icon {
    font-size: 22px;
    flex-shrink: 0;
}
.pnia-swot-quadrant-header h4 {
    font-size: 15px;
    font-weight: 700;
    margin: 0 0 2px;
    color: #1a1a2e;
}
.pnia-swot-quadrant-tag {
    font-size: 10px;
    font-weight: 600;
    color: #94a3b8;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

/* ── LISTA DE ITENS ── */
.pnia-swot-list {
    list-style: none;
    margin: 0 0 10px;
    padding: 0;
    min-height: 40px;
}
.pnia-swot-list li {
    display: flex;
    align-items: flex-start;
    gap: 8px;
    padding: 7px 10px;
    border-radius: 8px;
    font-size: 13px;
    color: #334155;
    line-height: 1.45;
    transition: background 0.15s;
    margin-bottom: 4px;
    background: rgba(255,255,255,0.6);
    border: 1px solid transparent;
}
.pnia-swot-list li:hover {
    background: rgba(255,255,255,0.9);
    border-color: rgba(0,0,0,0.06);
}
.pnia-swot-list li .item-text {
    flex: 1;
    cursor: pointer;
    min-height: 18px;
    word-break: break-word;
    user-select: text;
}
.pnia-swot-list li .item-text:hover {
    color: #4f46e5;
}
.pnia-swot-list li .item-delete {
    background: none;
    border: none;
    cursor: pointer;
    color: #cbd5e1;
    font-size: 16px;
    line-height: 1;
    padding: 0 2px;
    flex-shrink: 0;
    transition: color 0.15s;
    margin-top: 1px;
}
.pnia-swot-list li .item-delete:hover {
    color: #ef4444;
}
.pnia-swot-list li .item-bullet {
    color: #94a3b8;
    font-size: 16px;
    flex-shrink: 0;
    margin-top: 1px;
}

/* ── ÁREA ADICIONAR ITEM ── */
.pnia-swot-add-item {
    display: flex;
    gap: 6px;
    margin-top: 8px;
}
.pnia-swot-input-novo {
    flex: 1;
    border: 1.5px solid #e2e8f0;
    border-radius: 7px;
    padding: 6px 10px;
    font-size: 13px;
    color: #1e1b4b;
    outline: none;
    transition: border-color 0.15s;
}
.pnia-swot-input-novo:focus {
    border-color: #4f46e5;
}
.pnia-swot-add-btn {
    background: none;
    border: 1.5px dashed #94a3b8;
    color: #64748b;
    font-size: 12px;
    font-weight: 600;
    padding: 6px 14px;
    border-radius: 7px;
    cursor: pointer;
    white-space: nowrap;
    transition: all 0.15s;
}
.pnia-swot-add-btn:hover {
    border-color: #4f46e5;
    color: #4f46e5;
    background: rgba(79,70,229,0.04);
}

/* ── INPUT DE EDIÇÃO INLINE ── */
.pnia-swot-item-edit-input {
    flex: 1;
    border: 1.5px solid #4f46e5;
    border-radius: 5px;
    padding: 2px 8px;
    font-size: 13px;
    color: #1e1b4b;
    outline: none;
    width: 100%;
}

/* ── HINT DE ITEM VAZIO ── */
.pnia-swot-empty-hint {
    font-size: 12px;
    color: #94a3b8;
    font-style: italic;
    padding: 4px 0;
    list-style: none;
}

/* ── DICA DE SALVAMENTO ── */
.pnia-swot-save-hint {
    text-align: center;
    font-size: 12px;
    color: #94a3b8;
    margin: 10px 0 0;
    animation: pnia-fade-in 0.3s ease;
}
@keyframes pnia-fade-in {
    from { opacity: 0; } to { opacity: 1; }
}

/* ── PREVIEW (concluído) ── */
.pnia-swot-preview-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 12px;
    margin-bottom: 20px;
}
.pnia-swot-preview-header h3 {
    font-size: 20px;
    font-weight: 700;
    color: #1e1b4b;
    margin: 4px 0 0;
}
.pnia-swot-badge-concluido {
    display: inline-block;
    background: #dcfce7;
    color: #166534;
    font-size: 11px;
    font-weight: 700;
    padding: 3px 10px;
    border-radius: 20px;
    letter-spacing: 0.3px;
    margin-bottom: 4px;
}
.pnia-swot-matrix-preview .pnia-swot-quadrant {
    opacity: 0.95;
}
.pnia-swot-matrix-preview .pnia-swot-list li {
    cursor: default;
}

/* ── OVERLAY DE IA GERANDO ── */
.pnia-swot-ia-overlay {
    position: absolute;
    inset: 0;
    background: rgba(255,255,255,0.82);
    border-radius: 14px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 10px;
    z-index: 10;
    backdrop-filter: blur(2px);
}
.pnia-swot-ia-overlay span {
    font-size: 13px;
    color: #4f46e5;
    font-weight: 600;
}
