/* ==============================================
   MELHORIAS NO SISTEMA DE IMAGENS v2.9.3
   ============================================== */

/* Modal de Ajuda de Imagens */
.modal-ajuda-imagem {
    display: none;
    position: fixed;
    z-index: 10000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.6);
    backdrop-filter: blur(5px);
    overflow-y: auto;
}

.modal-ajuda-imagem.active {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
}

.modal-ajuda-content {
    background: white;
    border-radius: 20px;
    padding: 40px;
    max-width: 800px;
    width: 100%;
    max-height: 90vh;
    overflow-y: auto;
    position: relative;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
    animation: slideUp 0.3s ease;
}

@keyframes slideUp {
    from {
        opacity: 0;
        transform: translateY(50px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.modal-ajuda-content h2 {
    color: #1e40af;
    font-size: 2rem;
    margin-bottom: 10px;
    display: flex;
    align-items: center;
    gap: 10px;
}

.modal-ajuda-content h3 {
    color: #3b82f6;
    font-size: 1.3rem;
    margin: 30px 0 15px 0;
    display: flex;
    align-items: center;
    gap: 10px;
}

.modal-ajuda-content p {
    color: #475569;
    line-height: 1.8;
    margin-bottom: 15px;
}

.passo-tutorial {
    background: #f1f5f9;
    border-left: 4px solid #3b82f6;
    padding: 20px;
    margin: 15px 0;
    border-radius: 8px;
}

.passo-tutorial strong {
    color: #1e40af;
    display: block;
    margin-bottom: 10px;
    font-size: 1.1rem;
}

.servicos-suportados {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 15px;
    margin: 20px 0;
}

.servico-card {
    background: white;
    border: 2px solid #e2e8f0;
    border-radius: 12px;
    padding: 20px;
    text-align: center;
    transition: all 0.3s ease;
    cursor: pointer;
}

.servico-card:hover {
    border-color: #3b82f6;
    box-shadow: 0 4px 12px rgba(59, 130, 246, 0.2);
    transform: translateY(-3px);
}

.servico-card i {
    font-size: 2.5rem;
    margin-bottom: 10px;
    color: #3b82f6;
}

.servico-card h4 {
    color: #1e40af;
    margin-bottom: 5px;
}

.servico-card p {
    color: #64748b;
    font-size: 0.85rem;
    margin: 0;
}

.btn-fechar-ajuda {
    position: absolute;
    top: 20px;
    right: 20px;
    background: #ef4444;
    color: white;
    border: none;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    font-size: 1.2rem;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
}

.btn-fechar-ajuda:hover {
    background: #dc2626;
    transform: rotate(90deg);
}

/* Preview de Imagem */
.image-preview-container {
    background: #f8fafc;
    border: 2px dashed #cbd5e1;
    border-radius: 12px;
    padding: 20px;
    margin: 15px 0;
    text-align: center;
    min-height: 200px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    position: relative;
    overflow: hidden;
}

.image-preview-container.has-image {
    border-style: solid;
    border-color: #10b981;
    background: white;
}

.image-preview-container img {
    max-width: 100%;
    max-height: 300px;
    border-radius: 8px;
    object-fit: contain;
    margin: 10px 0;
}

.image-preview-placeholder {
    color: #94a3b8;
    font-size: 1rem;
}

.image-preview-placeholder i {
    font-size: 3rem;
    margin-bottom: 10px;
    opacity: 0.5;
}

.image-preview-loading {
    color: #3b82f6;
    display: none;
}

.image-preview-loading.active {
    display: block;
}

.image-preview-error {
    color: #ef4444;
    display: none;
    padding: 10px;
    background: #fee2e2;
    border-radius: 8px;
    margin-top: 10px;
}

.image-preview-error.active {
    display: block;
}

.image-preview-success {
    color: #10b981;
    display: none;
    padding: 10px;
    background: #d1fae5;
    border-radius: 8px;
    margin-top: 10px;
}

.image-preview-success.active {
    display: flex;
    align-items: center;
    gap: 8px;
}

.btn-ajuda-imagem {
    background: #3b82f6;
    color: white;
    border: none;
    padding: 8px 16px;
    border-radius: 6px;
    font-size: 0.85rem;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    transition: all 0.3s ease;
    margin-left: 10px;
}

.btn-ajuda-imagem:hover {
    background: #2563eb;
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(59, 130, 246, 0.3);
}

.image-input-group {
    position: relative;
}

.image-input-group label {
    display: flex;
    align-items: center;
    justify-content: space-between;
}

/* Indicadores de formato suportado */
.formatos-suportados {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
    margin: 10px 0;
    font-size: 0.85rem;
}

.formato-badge {
    background: #dbeafe;
    color: #1e40af;
    padding: 4px 10px;
    border-radius: 12px;
    font-weight: 500;
}

/* Dicas rápidas */
.dica-rapida {
    background: #fef3c7;
    border-left: 4px solid #f59e0b;
    padding: 12px;
    border-radius: 6px;
    margin: 10px 0;
    font-size: 0.9rem;
    color: #92400e;
    display: flex;
    align-items: flex-start;
    gap: 10px;
}

.dica-rapida i {
    margin-top: 2px;
    font-size: 1.1rem;
}

/* Loading spinner */
.spinner {
    border: 3px solid #e2e8f0;
    border-top: 3px solid #3b82f6;
    border-radius: 50%;
    width: 40px;
    height: 40px;
    animation: spin 1s linear infinite;
    margin: 20px auto;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* Responsivo */
@media (max-width: 768px) {
    .modal-ajuda-content {
        padding: 25px;
    }
    
    .modal-ajuda-content h2 {
        font-size: 1.5rem;
    }
    
    .servicos-suportados {
        grid-template-columns: 1fr;
    }
    
    .image-preview-container {
        min-height: 150px;
    }
}

/* Badge de status */
.status-badge {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    padding: 5px 12px;
    border-radius: 12px;
    font-size: 0.85rem;
    font-weight: 600;
    margin: 5px 0;
}

.status-badge.success {
    background: #d1fae5;
    color: #065f46;
}

.status-badge.error {
    background: #fee2e2;
    color: #991b1b;
}

.status-badge.warning {
    background: #fef3c7;
    color: #92400e;
}

.status-badge.info {
    background: #dbeafe;
    color: #1e40af;
}
