/* ==============================
   MEMORIAL AVATAR - CSS PADRONIZADO
   ============================== */

.ma-wrapper {
    position: relative;
    width: 250px;
    max-width: 100%;
    margin: 20px auto;
    border: 2px dashed #ccc;
    border-radius: 16px;
    padding: 16px;
    cursor: pointer;
    text-align: center;
    background: #fafafa;
    transition: all 0.3s ease;
}

.ma-wrapper:hover {
    border-color: #999;
    background: #fdfdfd;
}

/* Área de preview */
.ma-preview {
    width: 100%;
    height: 250px;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    background: #fff;
    border-radius: 12px;
    position: relative;
}

.ma-placeholder {
    color: #777;
    font-size: 15px;
    text-align: center;
    padding: 30px 10px;
    background: #f5f5f5;
    border-radius: 12px;
    transition: 0.3s;
}

.ma-placeholder:hover {
    background: #e9e9e9;
}

/* Imagem de avatar */
.ma-avatar-img {
    max-width: 100%;
    max-height: 100%;
    object-fit: cover;
    border-radius: 12px;
    cursor: pointer;
    transition: transform 0.25s ease;
}

.ma-avatar-img:hover {
    transform: scale(1.03);
}

/* Input invisível */
.ma-file-input {
    display: none;
}

/* Botão excluir */
.ma-delete-btn {
    margin-top: 12px;
    padding: 8px 16px;
    background: #c62828;
    color: #fff;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    font-size: 14px;
    transition: background 0.25s ease;
}

.ma-delete-btn:hover {
    background: #b71c1c;
}

/* Barra de progresso */
.ma-progress {
    width: 100%;
    height: 6px;
    background: #e0e0e0;
    border-radius: 4px;
    margin-top: 12px;
    overflow: hidden;
}

.ma-progress-fill {
    width: 0%;
    height: 100%;
    background: #4caf50;
    transition: width 0.3s ease;
}

/* ===========================
   MODAL DE CROP
   =========================== */
#ma-crop-modal {
    position: fixed;
    top: 0; left: 0;
    width: 100vw; height: 100vh;
    background: rgba(0,0,0,0.75);
    z-index: 9999;
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 20px;
    box-sizing: border-box;
}

.ma-crop-overlay {
    background: #fff;
    padding: 16px;
    border-radius: 12px;
    max-width: 90vw;
    max-height: 85vh;
    text-align: center;
    overflow: hidden;
    box-shadow: 0 6px 25px rgba(0,0,0,0.4);
}

.ma-crop-container img {
    max-width: 100%;
    max-height: 65vh;
    display: block;
    margin: 0 auto 12px;
    border-radius: 8px;
    background: #fafafa;
}

/* Botões do modal */
#ma-crop-apply,
#ma-crop-cancel {
    margin: 5px 8px 0;
    padding: 8px 18px;
    font-size: 14px;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    color: #fff;
    transition: background 0.25s ease;
}

#ma-crop-apply {
    background: #1976d2;
}

#ma-crop-apply:hover {
    background: #1565c0;
}

#ma-crop-cancel {
    background: #757575;
}

#ma-crop-cancel:hover {
    background: #616161;
}

/* ===========================
   RESPONSIVIDADE
   =========================== */
@media (max-width: 768px) {
    .ma-wrapper {
        width: 100%;
        padding: 12px;
    }

    .ma-preview {
        height: 220px;
    }

    .ma-placeholder {
        font-size: 14px;
        padding: 25px 10px;
    }

    .ma-crop-overlay {
        width: 100%;
        padding: 12px;
        border-radius: 10px;
    }

    .ma-crop-container img {
        max-height: 55vh;
    }

    #ma-crop-apply,
    #ma-crop-cancel {
        width: 100%;
        margin: 6px 0;
    }
}

@media (max-width: 480px) {
    .ma-crop-overlay {
        padding: 10px;
    }

    .ma-crop-container img {
        max-height: 50vh;
    }

    #ma-crop-apply,
    #ma-crop-cancel {
        font-size: 13px;
        padding: 7px 14px;
    }
}

/* ===========================
   ERROS E ESTADOS
   =========================== */
.ma-error {
    background: #ffebee;
    color: #b71c1c;
    padding: 10px 14px;
    border-radius: 8px;
    font-size: 14px;
    text-align: center;
    margin: 10px auto;
    border: 1px solid #ffcdd2;
}
