/* Ferramenta Completa Nicks - Estilos Frontend */
/* Namespaced para evitar conflitos com temas e outros plugins */

/* Container principal - alta especificidade para evitar conflitos */
.ffm-generator-block.ffm-custom,
.ffm-generator-block.ffm-stylized-custom {
    background: var(--wp--preset--color--background, var(--wp--custom--color--background, #ffffff));
    border: 1px solid var(--wp--preset--color--border, var(--wp--custom--color--border, #e0e0e0));
    border-radius: 8px;
    padding: 24px;
    margin-bottom: 30px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
    transition: box-shadow 0.3s ease;
    box-sizing: border-box;
    isolation: isolate; /* Cria novo contexto de empilhamento */
}

.ffm-generator-block.ffm-custom:hover,
.ffm-generator-block.ffm-stylized-custom:hover {
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
}

.ffm-generator-block.ffm-custom .ffm-header,
.ffm-generator-block.ffm-stylized-custom .ffm-header {
    margin-bottom: 20px;
    padding-bottom: 15px;
    border-bottom: 2px solid #f0f0f0;
}

/* Títulos e descrições - alta especificidade */
.ffm-generator-block.ffm-custom .ffm-header .ffm-title,
.ffm-generator-block.ffm-stylized-custom .ffm-header .ffm-title {
    font-size: var(--wp--preset--font-size--large, 24px);
    font-weight: var(--wp--custom--font-weight--heading, 700);
    color: var(--wp--preset--color--foreground, var(--wp--custom--color--text, #333));
    margin: 0 0 8px 0;
    font-family: var(--wp--preset--font-family--heading, inherit);
    line-height: 1.2;
}

.ffm-generator-block.ffm-custom .ffm-header .ffm-description,
.ffm-generator-block.ffm-stylized-custom .ffm-header .ffm-description {
    font-size: var(--wp--preset--font-size--small, 14px);
    color: var(--wp--preset--color--foreground, var(--wp--custom--color--text-secondary, #666));
    margin: 0;
    line-height: 1.5;
    font-family: var(--wp--preset--font-family--body, inherit);
}

/* Formulários - alta especificidade */
.ffm-generator-block.ffm-custom .ffm-form,
.ffm-generator-block.ffm-stylized-custom .ffm-form {
    margin-bottom: 20px;
    display: flex;
    flex-direction: column;
    align-items: center;
}

.ffm-generator-block.ffm-custom .ffm-form .ffm-field,
.ffm-generator-block.ffm-stylized-custom .ffm-form .ffm-field {
    margin-bottom: 18px;
    width: 100%;
    max-width: 500px;
    display: flex;
    flex-direction: column;
    align-items: center;
}

.ffm-generator-block.ffm-custom .ffm-form .ffm-field label,
.ffm-generator-block.ffm-stylized-custom .ffm-form .ffm-field label {
    display: block;
    font-weight: var(--wp--custom--font-weight--label, 600);
    color: var(--wp--preset--color--foreground, var(--wp--custom--color--text, #444));
    margin-bottom: 8px;
    font-size: var(--wp--preset--font-size--small, 14px);
    width: 100%;
    text-align: center;
    font-family: var(--wp--preset--font-family--body, inherit);
}

.ffm-generator-block.ffm-custom .ffm-form .ffm-field .ffm-input,
.ffm-generator-block.ffm-custom .ffm-form .ffm-field .ffm-select,
.ffm-generator-block.ffm-stylized-custom .ffm-form .ffm-field .ffm-input,
.ffm-generator-block.ffm-stylized-custom .ffm-form .ffm-field .ffm-select {
    width: 100%;
    max-width: 500px;
    padding: 10px 14px;
    border: 2px solid var(--wp--preset--color--border, var(--wp--custom--color--border-light, #ddd));
    border-radius: 6px;
    font-size: var(--wp--preset--font-size--medium, 15px);
    transition: border-color 0.3s ease;
    box-sizing: border-box;
    margin: 0 auto;
    background: var(--wp--preset--color--background, #ffffff);
    color: var(--wp--preset--color--foreground, var(--wp--custom--color--text, #333));
    font-family: var(--wp--preset--font-family--body, inherit);
}

/* Estados de foco - alta especificidade */
.ffm-generator-block.ffm-custom .ffm-form .ffm-field .ffm-input:focus,
.ffm-generator-block.ffm-custom .ffm-form .ffm-field .ffm-select:focus,
.ffm-generator-block.ffm-stylized-custom .ffm-form .ffm-field .ffm-input:focus,
.ffm-generator-block.ffm-stylized-custom .ffm-form .ffm-field .ffm-select:focus {
    outline: none;
    border-color: var(--wp--preset--color--primary, var(--wp--custom--color--primary, #4a90e2));
    box-shadow: 0 0 0 3px var(--wp--preset--color--primary, rgba(74, 144, 226, 0.1));
}

/* Opções e checkboxes - alta especificidade */
.ffm-generator-block.ffm-custom .ffm-options,
.ffm-generator-block.ffm-stylized-custom .ffm-options {
    margin-bottom: 18px;
    display: flex;
    flex-wrap: wrap;
    gap: 20px;
    justify-content: center;
    width: 100%;
    max-width: 500px;
}

.ffm-generator-block.ffm-custom .ffm-checkbox,
.ffm-generator-block.ffm-stylized-custom .ffm-checkbox {
    display: flex;
    align-items: center;
    margin-bottom: 0;
    cursor: pointer;
    font-size: 14px;
    color: #555;
}

.ffm-generator-block.ffm-custom .ffm-checkbox input[type="checkbox"],
.ffm-generator-block.ffm-stylized-custom .ffm-checkbox input[type="checkbox"] {
    margin-right: 8px;
    width: 18px;
    height: 18px;
    cursor: pointer;
}

.ffm-generator-block.ffm-custom .ffm-checkbox-group,
.ffm-generator-block.ffm-stylized-custom .ffm-checkbox-group {
    display: flex;
    flex-wrap: wrap;
    gap: 15px;
}

.ffm-generator-block.ffm-custom .ffm-checkbox-group .ffm-checkbox,
.ffm-generator-block.ffm-stylized-custom .ffm-checkbox-group .ffm-checkbox {
    margin-bottom: 0;
}

/* Botões - alta especificidade */
.ffm-generator-block.ffm-custom .ffm-btn,
.ffm-generator-block.ffm-stylized-custom .ffm-btn {
    padding: 12px 24px;
    border: none;
    border-radius: 6px;
    font-size: 15px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    display: inline-block;
    text-align: center;
    text-decoration: none;
}

.ffm-generator-block.ffm-custom .ffm-btn-primary,
.ffm-generator-block.ffm-stylized-custom .ffm-btn-primary {
    background: var(--wp--preset--color--primary, var(--wp--custom--color--primary, linear-gradient(135deg, #667eea 0%, #764ba2 100%)));
    color: var(--wp--preset--color--contrast, var(--wp--custom--color--button-text, #ffffff));
}

.ffm-generator-block.ffm-custom .ffm-btn-primary:hover,
.ffm-generator-block.ffm-stylized-custom .ffm-btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px var(--wp--preset--color--primary, rgba(102, 126, 234, 0.4));
    background: var(--wp--preset--color--primary-hover, var(--wp--custom--color--primary-hover, var(--wp--preset--color--primary, #764ba2)));
}

.ffm-generator-block.ffm-custom .ffm-btn-secondary,
.ffm-generator-block.ffm-stylized-custom .ffm-btn-secondary {
    background: var(--wp--preset--color--secondary, var(--wp--custom--color--secondary, #6c757d));
    color: var(--wp--preset--color--contrast, var(--wp--custom--color--button-text, #ffffff));
}

.ffm-generator-block.ffm-custom .ffm-btn-secondary:hover,
.ffm-generator-block.ffm-stylized-custom .ffm-btn-secondary:hover {
    background: var(--wp--preset--color--secondary-hover, var(--wp--custom--color--secondary-hover, #5a6268));
    transform: translateY(-2px);
}

.ffm-generator-block.ffm-custom .ffm-btn-small,
.ffm-generator-block.ffm-stylized-custom .ffm-btn-small {
    padding: 6px 12px;
    font-size: 13px;
}

.ffm-generator-block.ffm-custom .ffm-btn:active,
.ffm-generator-block.ffm-stylized-custom .ffm-btn:active {
    transform: translateY(0);
}

.ffm-generator-block.ffm-custom .ffm-generate,
.ffm-generator-block.ffm-stylized-custom .ffm-generate {
    margin-top: 10px;
    align-self: center;
}

.ffm-generator-block.ffm-custom .ffm-generate-random,
.ffm-generator-block.ffm-stylized-custom .ffm-generate-random {
    margin-top: 10px;
    margin-left: 10px;
    align-self: center;
}

.ffm-generator-block.ffm-custom .ffm-quick-actions,
.ffm-generator-block.ffm-stylized-custom .ffm-quick-actions {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
    margin-bottom: 20px;
    justify-content: center;
    width: 100%;
}

.ffm-generator-block.ffm-custom .ffm-quick-actions .ffm-btn,
.ffm-generator-block.ffm-stylized-custom .ffm-quick-actions .ffm-btn {
    flex: 1;
    min-width: 200px;
    max-width: 500px;
}

/* Símbolos e Corações - alta especificidade */
.ffm-generator-block.ffm-custom .ffm-symbol-picker,
.ffm-generator-block.ffm-custom .ffm-heart-picker,
.ffm-generator-block.ffm-stylized-custom .ffm-symbol-picker,
.ffm-generator-block.ffm-stylized-custom .ffm-heart-picker {
    margin-top: 10px;
}

.ffm-generator-block.ffm-custom .ffm-symbol-grid,
.ffm-generator-block.ffm-stylized-custom .ffm-symbol-grid {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin-top: 10px;
}

.ffm-generator-block.ffm-custom .ffm-symbol-item,
.ffm-generator-block.ffm-stylized-custom .ffm-symbol-item {
    display: flex;
    align-items: center;
    padding: 8px 12px;
    border: 2px solid #e0e0e0;
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.2s ease;
    background: #f9f9f9;
}

.ffm-generator-block.ffm-custom .ffm-symbol-item:hover,
.ffm-generator-block.ffm-stylized-custom .ffm-symbol-item:hover {
    border-color: #4a90e2;
    background: #f0f7ff;
}

.ffm-generator-block.ffm-custom .ffm-symbol-item input[type="checkbox"],
.ffm-generator-block.ffm-stylized-custom .ffm-symbol-item input[type="checkbox"] {
    margin-right: 6px;
}

/* Resultados - alta especificidade */
.ffm-generator-block.ffm-custom .ffm-results,
.ffm-generator-block.ffm-stylized-custom .ffm-results {
    margin-top: 25px;
    padding-top: 20px;
    border-top: 2px solid #f0f0f0;
}

.ffm-generator-block.ffm-custom .ffm-results-header,
.ffm-generator-block.ffm-stylized-custom .ffm-results-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 15px;
}

.ffm-generator-block.ffm-custom .ffm-results-header h4,
.ffm-generator-block.ffm-stylized-custom .ffm-results-header h4 {
    margin: 0;
    font-size: 18px;
    color: #333;
}

.ffm-generator-block.ffm-custom .ffm-results-list,
.ffm-generator-block.ffm-stylized-custom .ffm-results-list {
    display: grid;
    gap: 12px;
}

/* Layout de botões para resultados - alta especificidade */
.ffm-generator-block.ffm-custom .ffm-results-list.ffm-results-buttons,
.ffm-generator-block.ffm-stylized-custom .ffm-results-list.ffm-results-buttons {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 10px;
    justify-content: center;
}

.ffm-generator-block.ffm-custom .ffm-result-button,
.ffm-generator-block.ffm-stylized-custom .ffm-result-button {
    padding: 12px 20px;
    border: none;
    border-radius: 6px;
    font-size: var(--wp--preset--font-size--medium, 15px);
    font-weight: var(--wp--custom--font-weight--button, 600);
    cursor: pointer;
    transition: all 0.3s ease;
    background: var(--wp--preset--color--primary, var(--wp--custom--color--primary, linear-gradient(135deg, #667eea 0%, #764ba2 100%)));
    color: var(--wp--preset--color--contrast, var(--wp--custom--color--button-text, #ffffff));
    text-align: center;
    width: 100%;
    word-break: break-all;
    font-family: var(--wp--preset--font-family--monospace, 'Courier New', monospace);
}

.ffm-generator-block.ffm-custom .ffm-result-button:hover,
.ffm-generator-block.ffm-stylized-custom .ffm-result-button:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(102, 126, 234, 0.4);
}

.ffm-generator-block.ffm-custom .ffm-result-button:active,
.ffm-generator-block.ffm-stylized-custom .ffm-result-button:active {
    transform: translateY(0);
}

.ffm-generator-block.ffm-custom .ffm-result-item,
.ffm-generator-block.ffm-stylized-custom .ffm-result-item {
    background: var(--wp--preset--color--background-alt, var(--wp--custom--color--background-alt, #f8f9fa));
    border: 1px solid var(--wp--preset--color--border, var(--wp--custom--color--border, #e0e0e0));
    border-radius: 6px;
    padding: 15px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    transition: all 0.2s ease;
}

.ffm-generator-block.ffm-custom .ffm-result-item:hover,
.ffm-generator-block.ffm-stylized-custom .ffm-result-item:hover {
    background: var(--wp--preset--color--background-hover, var(--wp--custom--color--background-hover, #f0f0f0));
    border-color: var(--wp--preset--color--primary, var(--wp--custom--color--primary, #4a90e2));
    transform: translateX(4px);
}

.ffm-generator-block.ffm-custom .ffm-result-text,
.ffm-generator-block.ffm-stylized-custom .ffm-result-text {
    flex: 1;
    font-family: var(--wp--preset--font-family--monospace, 'Courier New', monospace);
    font-size: var(--wp--preset--font-size--medium, 16px);
    color: var(--wp--preset--color--foreground, var(--wp--custom--color--text, #333));
    word-break: break-all;
    margin-right: 15px;
    user-select: all;
}

/* Estilo especial para textos espelhados (invertidos) */
.ffm-generator-block[data-type="mirror"] .ffm-result-text,
.ffm-generator-block[data-type="mirror"] .ffm-result-button {
    transform: rotate(180deg);
    display: inline-block;
    direction: rtl;
    unicode-bidi: bidi-override;
    text-align: center;
}

/* Garantir que o container não seja afetado pela rotação */
.ffm-generator-block[data-type="mirror"] .ffm-result-item {
    transform: none;
}

.ffm-generator-block[data-type="mirror"] .ffm-results-list.ffm-results-buttons .ffm-result-button {
    transform: rotate(180deg);
}

.ffm-generator-block.ffm-custom .ffm-result-meta,
.ffm-generator-block.ffm-stylized-custom .ffm-result-meta {
    display: flex;
    align-items: center;
    gap: 12px;
}

.ffm-generator-block.ffm-custom .ffm-result-length,
.ffm-generator-block.ffm-stylized-custom .ffm-result-length {
    font-size: 12px;
    color: #888;
    white-space: nowrap;
}

.ffm-generator-block.ffm-custom .ffm-no-results,
.ffm-generator-block.ffm-stylized-custom .ffm-no-results {
    text-align: center;
    padding: 30px;
    color: #888;
    font-style: italic;
}

/* Estado copiado - alta especificidade */
.ffm-generator-block.ffm-custom .ffm-result-button.ffm-copied,
.ffm-generator-block.ffm-custom .ffm-btn.ffm-copied,
.ffm-generator-block.ffm-stylized-custom .ffm-result-button.ffm-copied,
.ffm-generator-block.ffm-stylized-custom .ffm-btn.ffm-copied {
    background: #28a745;
    color: #ffffff;
}

/* Responsivo - alta especificidade */
@media (max-width: 768px) {
    .ffm-generator-block.ffm-custom,
    .ffm-generator-block.ffm-stylized-custom {
        padding: 18px;
    }
    
    .ffm-generator-block.ffm-custom .ffm-header .ffm-title,
    .ffm-generator-block.ffm-stylized-custom .ffm-header .ffm-title {
        font-size: 20px;
    }
    
    .ffm-quick-actions {
        flex-direction: column;
    }
    
    .ffm-quick-actions .ffm-btn {
        width: 100%;
    }
    
    .ffm-generate-random {
        margin-left: 0;
        margin-top: 12px;
    }
    
    .ffm-results-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 10px;
    }
    
    .ffm-result-item {
        flex-direction: column;
        align-items: flex-start;
        gap: 10px;
    }
    
    .ffm-result-meta {
        width: 100%;
        justify-content: space-between;
    }
    
    .ffm-checkbox-group {
        flex-direction: column;
        gap: 8px;
    }
    
    /* Layout de botões - 1 por linha no mobile */
    .ffm-results-list.ffm-results-buttons {
        grid-template-columns: 1fr;
    }
}

/* Animações */
@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.ffm-generator-block.ffm-custom .ffm-results-list .ffm-result-item,
.ffm-generator-block.ffm-stylized-custom .ffm-results-list .ffm-result-item {
    animation: fadeIn 0.3s ease;
}

/* Acessibilidade - alta especificidade */
.ffm-generator-block.ffm-custom .ffm-btn:focus,
.ffm-generator-block.ffm-stylized-custom .ffm-btn:focus,
.ffm-generator-block.ffm-custom .ffm-result-button:focus,
.ffm-generator-block.ffm-stylized-custom .ffm-result-button:focus {
    outline: 2px solid #4a90e2;
    outline-offset: 2px;
}

.ffm-generator-block.ffm-custom .ffm-form .ffm-field .ffm-input:focus,
.ffm-generator-block.ffm-custom .ffm-form .ffm-field .ffm-select:focus,
.ffm-generator-block.ffm-stylized-custom .ffm-form .ffm-field .ffm-input:focus,
.ffm-generator-block.ffm-stylized-custom .ffm-form .ffm-field .ffm-select:focus {
    outline: 2px solid #4a90e2;
    outline-offset: 2px;
}

/* Dark mode support (opcional) - alta especificidade */
@media (prefers-color-scheme: dark) {
    .ffm-generator-block.ffm-custom,
    .ffm-generator-block.ffm-stylized-custom {
        background: #2d2d2d;
        border-color: #444;
        color: #e0e0e0;
    }
    
    .ffm-generator-block.ffm-custom .ffm-header .ffm-title,
    .ffm-generator-block.ffm-stylized-custom .ffm-header .ffm-title {
        color: #ffffff;
    }
    
    .ffm-generator-block.ffm-custom .ffm-header .ffm-description,
    .ffm-generator-block.ffm-stylized-custom .ffm-header .ffm-description {
        color: #b0b0b0;
    }
    
    .ffm-generator-block.ffm-custom .ffm-form .ffm-field .ffm-input,
    .ffm-generator-block.ffm-custom .ffm-form .ffm-field .ffm-select,
    .ffm-generator-block.ffm-stylized-custom .ffm-form .ffm-field .ffm-input,
    .ffm-generator-block.ffm-stylized-custom .ffm-form .ffm-field .ffm-select {
        background: #1a1a1a;
        border-color: #444;
        color: #e0e0e0;
    }
    
    .ffm-generator-block.ffm-custom .ffm-result-item,
    .ffm-generator-block.ffm-stylized-custom .ffm-result-item {
        background: #1a1a1a;
        border-color: #444;
    }
    
    .ffm-generator-block.ffm-custom .ffm-result-text,
    .ffm-generator-block.ffm-stylized-custom .ffm-result-text {
        color: #e0e0e0;
    }
}

