/* ============================================================
   Upload personalizado — nova-demanda
   ============================================================ */

/* Área clicável de upload */
.anexo-upload-area {
    border: 2px dashed #2F80ED;
    border-radius: 8px;
    padding: 18px 14px;
    text-align: center;
    cursor: pointer;
    background: #f0f6ff;
    transition: background 0.2s, border-color 0.2s;
    display: flex !important;
    flex-direction: column;
    align-items: center;
    gap: 4px;
    user-select: none;
    margin-bottom: 4px;
}

.anexo-upload-area:hover,
.anexo-upload-area.drag-over {
    background: #daeeff;
    border-color: #1a6abf;
}

.anexo-upload-area ion-icon.upload-icon {
    font-size: 36px;
    color: #2F80ED;
    pointer-events: none;
}

.anexo-upload-area .upload-label {
    color: #2F80ED;
    font-size: 13px;
    font-weight: 600;
    pointer-events: none;
    margin: 0;
}

.anexo-upload-area .upload-hint {
    color: #999;
    font-size: 11px;
    pointer-events: none;
    margin: 0;
}

/* Grade lado a lado */
.anexo-preview-list {
    margin-top: 10px;
    display: flex !important;
    flex-wrap: wrap;
    gap: 10px;
    padding: 0;
    list-style: none;
}

.anexo-preview-item {
    position: relative !important;
    display: flex !important;
    flex-direction: column !important;
    align-items: center !important;
    gap: 5px !important;
    background: #f1f5fb !important;
    border-radius: 8px !important;
    padding: 12px 8px 8px !important;
    border: 1px solid #dce7f8 !important;
    width: 88px !important;
    min-width: 88px !important;
    max-width: 88px !important;
    flex-shrink: 0 !important;
    flex-grow: 0 !important;
    box-sizing: border-box !important;
}

.anexo-thumb {
    width: 58px;
    height: 58px;
    object-fit: cover;
    border-radius: 5px;
    flex-shrink: 0;
}

.anexo-file-icon {
    width: 58px;
    height: 58px;
    display: flex !important;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.anexo-file-icon ion-icon {
    font-size: 40px;
    color: #2F80ED;
}

.anexo-name {
    font-size: 10px;
    color: #555;
    text-align: center;
    width: 100%;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

/* Container de mídia — flex para alinhar imagens e cards PDF pelo topo */
.media {
    display: flex !important;
    flex-wrap: wrap !important;
    align-items: flex-start !important;
    gap: 8px !important;
}

/* Links de PDF/DOCX nos anexos */
.preview-link {
    display: inline-flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 6px;
    padding: 10px 12px;
    background: #f0f6ff;
    border: 1px solid #c3d9f7;
    border-radius: 8px;
    color: #2F80ED;
    font-size: 11px;
    font-weight: 500;
    text-decoration: none;
    transition: background 0.15s;
    width: 99px;
    height: 99px;
    word-break: break-all;
    text-align: center;
    box-sizing: border-box;
    vertical-align: top;
}

.preview-link:hover {
    background: #daeeff;
    color: #1a6abf;
}

.preview-link ion-icon {
    font-size: 38px;
    flex-shrink: 0;
}

/* Alerta de formato inválido */
.anexo-alerta {
    margin-top: 8px;
    padding: 8px 12px;
    background: #fff3cd;
    border: 1px solid #f0ad4e;
    border-radius: 6px;
    color: #856404;
    font-size: 12px;
    display: flex;
    align-items: center;
    gap: 6px;
}

.anexo-alerta ion-icon {
    font-size: 16px;
    color: #f0ad4e;
    flex-shrink: 0;
}

/* Botão remover — ion-icon close-circle (padrão do projeto) */
ion-icon.anexo-remove {
    position: absolute;
    top: -9px;
    right: -9px;
    font-size: 22px;
    color: #e74c3c;
    background: #fff;
    border-radius: 50%;
    cursor: pointer;
    display: block;
    z-index: 1;
    transition: color 0.15s;
}

ion-icon.anexo-remove:hover {
    color: #c0392b;
}
