/* MPS Post Manager - Estilos CSS */

/* Container principal */
.mps-post-manager {
    max-width: 100%;
    margin: 0 0 30px;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Oxygen-Sans, Ubuntu, Cantarell, "Helvetica Neue", sans-serif;
}

/* Formulários */
.mps-form-group {
    margin-bottom: 20px;
}

.mps-form-row {
    display: flex;
    flex-wrap: wrap;
    margin: 0 -10px;
}

.mps-half {
    flex: 0 0 calc(50% - 20px);
    margin: 0 10px;
}

.mps-form-group label {
    display: block;
    margin-bottom: 5px;
    font-weight: 600;
}

.mps-form-group input[type="text"],
.mps-form-group input[type="file"],
.mps-form-group textarea,
.mps-form-group select {
    width: 100%;
    padding: 8px 12px;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 14px;
}

.mps-form-help {
    margin: 5px 0 0;
    color: #666;
    font-size: 12px;
    font-style: italic;
}

/* Botões */
.mps-button {
    display: inline-block;
    padding: 10px 15px;
    border: none;
    border-radius: 4px;
    font-size: 14px;
    font-weight: 600;
    text-decoration: none;
    cursor: pointer;
    transition: background-color 0.3s;
}

.mps-primary {
    background-color: #0073aa;
    color: #fff;
}

.mps-primary:hover {
    background-color: #005177;
}

.mps-secondary {
    background-color: #f7f7f7;
    color: #555;
    border: 1px solid #ccc;
}

.mps-secondary:hover {
    background-color: #ebebeb;
}

/* Seção SEO */
.mps-seo-section {
    margin-top: 20px;
    padding: 15px;
    background-color: #f9f9f9;
    border-radius: 4px;
}

.mps-seo-section h3 {
    margin-top: 0;
    margin-bottom: 15px;
}

/* Mensagens de feedback */
.mps-message {
    padding: 12px 15px;
    border-radius: 4px;
    margin-bottom: 20px;
    font-weight: 500;
}

.mps-success {
    background-color: #dff0d8;
    color: #3c763d;
    border: 1px solid #d6e9c6;
}

.mps-error {
    background-color: #f2dede;
    color: #a94442;
    border: 1px solid #ebccd1;
}

/* Imagem atual */
.mps-current-image {
    margin-bottom: 10px;
    max-width: 150px;
}

.mps-current-image img {
    max-width: 100%;
    height: auto;
    border-radius: 4px;
}

.mps-current-image p {
    margin: 5px 0 0;
    font-size: 12px;
    text-align: center;
}

/* Estilos para o campo de imagem destacada aprimorado */
.mps-featured-image-container {
    margin-bottom: 15px;
}

.mps-image-buttons {
    display: flex;
    flex-wrap: wrap;
    justify-content: space-between;
    align-items: center;
    margin-top: 10px;
    gap: 10px;
}

.mps-upload-options {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    flex: 1;
}

.mps-upload-input {
    width: 0.1px;
    height: 0.1px;
    opacity: 0;
    overflow: hidden;
    position: absolute;
    z-index: -1;
}

.mps-button.mps-remove {
    background-color: #f9f9f9;
    color: #cc1818;
    border: 1px solid #cc1818;
}

.mps-button.mps-remove:hover {
    background-color: #f2f2f2;
    color: #aa0000;
}

.mps-current-image {
    position: relative;
    margin-bottom: 15px;
    max-width: 300px;
    border: 1px solid #ddd;
    padding: 5px;
    border-radius: 4px;
}

.mps-current-image img {
    max-width: 100%;
    height: auto;
    border-radius: 2px;
    display: block;
}

.mps-current-image p {
    margin: 5px 0 0;
    font-size: 12px;
    text-align: center;
    color: #666;
}

/* Tabela de posts */
.mps-post-container {
    max-width: 100%;
    overflow-x: auto;
}

.mps-post-filter {
    margin-bottom: 20px;
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 10px;
}

.mps-post-filter input,
.mps-post-filter select {
    padding: 8px 12px;
    border: 1px solid #ddd;
    border-radius: 4px;
}

.mps-post-table {
    width: 100%;
    border-collapse: collapse;
    margin-bottom: 30px;
}

.mps-post-table th,
.mps-post-table td {
    padding: 10px 15px;
    border: 1px solid #ddd;
    text-align: left;
}

.mps-post-table th {
    background-color: #f5f5f5;
    font-weight: 600;
}

.mps-post-table tr:nth-child(even) {
    background-color: #f9f9f9;
}

.mps-post-table tr:hover {
    background-color: #f1f1f1;
}

/* Paginação */
.mps-pagination {
    display: flex;
    justify-content: center;
    margin-top: 20px;
    padding: 0;
    list-style: none;
}

.mps-pagination li {
    margin: 0 5px;
}

.mps-pagination a,
.mps-pagination span {
    display: block;
    padding: 8px 12px;
    border: 1px solid #ddd;
    border-radius: 4px;
    text-decoration: none;
    color: #333;
}

.mps-pagination .current {
    background-color: #0073aa;
    color: #fff;
    border-color: #0073aa;
}

.mps-pagination a:hover {
    background-color: #f5f5f5;
}

/* Estilos para indicadores de status */
.mps-status {
    display: inline-block;
    padding: 4px 8px;
    border-radius: 3px;
    font-size: 12px;
    font-weight: 600;
    text-transform: uppercase;
}

.mps-status-publish {
    background-color: #dff0d8;
    color: #3c763d;
    border: 1px solid #d6e9c6;
}

.mps-status-draft {
    background-color: #fcf8e3;
    color: #8a6d3b;
    border: 1px solid #faebcc;
}

.mps-status-pending {
    background-color: #d9edf7;
    color: #31708f;
    border: 1px solid #bce8f1;
}

/* Estilo para o diálogo de inserção de links */
.mce-link-options-container {
    margin-top: 5px;
}

.mce-link-rel-field {
    margin-top: 8px !important;
}

.mce-link-rel-field label {
    display: block;
    margin-bottom: 3px;
}

/* Estilo para o contador de palavras */
.mce-wordcount {
    font-size: 12px;
    color: #666;
    padding: 4px 8px;
}

/* SEO Metabox Frontend - Estilo inspirado no Rank Math */
.mps-seo-metabox {
    margin: 20px 0;
    background-color: #fff;
    border: 1px solid #e5e5e5;
    border-radius: 4px;
    box-shadow: 0 1px 4px rgba(0,0,0,.05);
}

.mps-seo-metabox-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px 15px;
    background-color: #f8f8f8;
    border-bottom: 1px solid #e5e5e5;
    border-radius: 4px 4px 0 0;
}

.mps-seo-metabox-header h3 {
    margin: 0;
    font-size: 14px;
    font-weight: 600;
    color: #23282d;
}

/* Círculo de pontuação SEO */
.mps-seo-score-circle {
    width: 36px;
    height: 36px;
    position: relative;
}

.mps-seo-score-svg {
    width: 100%;
    height: 100%;
}

.mps-seo-score-svg text {
    font-size: 12px;
    font-weight: bold;
}

/* Abas do metabox */
.mps-seo-metabox-tabs {
    display: flex;
    background-color: #f8f8f8;
    border-bottom: 1px solid #e5e5e5;
}

.mps-seo-tab {
    padding: 10px 15px;
    cursor: pointer;
    font-size: 13px;
    font-weight: 500;
    color: #555;
    border-bottom: 3px solid transparent;
}

.mps-seo-tab.active {
    color: #0073aa;
    border-bottom-color: #0073aa;
}

.mps-seo-tab:hover:not(.active) {
    border-bottom-color: #e5e5e5;
    color: #23282d;
}

/* Conteúdo do metabox */
.mps-seo-metabox-content {
    padding: 15px;
}

.mps-seo-tab-content {
    display: none;
}

.mps-seo-tab-content.active {
    display: block;
}

/* Seção de análise */
.mps-seo-analysis-section {
    padding: 15px;
    border-top: 1px solid #e5e5e5;
}

.mps-seo-analysis-section h4 {
    margin-top: 0;
    margin-bottom: 15px;
    font-size: 14px;
    color: #23282d;
}

.mps-seo-analysis-container {
    min-height: 100px;
}

.mps-seo-loading {
    padding: 20px;
    text-align: center;
    color: #666;
    font-style: italic;
}

/* Resultados de análise SEO */
.mps-seo-item {
    margin-bottom: 8px;
    padding: 10px;
    border-radius: 4px;
    border-left: 4px solid transparent;
    background-color: #fafafa;
}

.mps-seo-item.good {
    border-left-color: #1eb11e;
}

.mps-seo-item.ok {
    border-left-color: #ff9800;
}

.mps-seo-item.bad {
    border-left-color: #dc3232;
}

.mps-seo-item-header {
    display: flex;
    align-items: center;
    margin-bottom: 5px;
}

.mps-seo-item-header i {
    margin-right: 8px;
    width: 16px;
    height: 16px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 10px;
    font-style: normal;
}

.mps-seo-item.good i {
    background-color: #1eb11e;
}

.mps-seo-item.ok i {
    background-color: #ff9800;
}

.mps-seo-item.bad i {
    background-color: #dc3232;
}

.mps-seo-item-title {
    font-size: 14px;
    font-weight: 500;
    flex-grow: 1;
}

.mps-seo-item-content {
    font-size: 13px;
    line-height: 1.5;
    color: #555;
}

/* Preview de resultados de busca */
.mps-seo-preview-title {
    font-size: 18px;
    color: #1a0dab;
    margin: 5px 0;
    line-height: 1.2;
    word-wrap: break-word;
}

.mps-seo-preview-desc {
    font-size: 13px;
    color: #4d5156;
    line-height: 1.4;
    margin-bottom: 5px;
    word-wrap: break-word;
}

/* Estilo para preview social */
.mps-seo-social-preview {
    margin-bottom: 15px;
}

.mps-seo-social-preview h4 {
    margin-top: 0;
    margin-bottom: 10px;
    font-size: 14px;
}

.mps-social-preview-container {
    border: 1px solid #e1e1e1;
    border-radius: 4px;
    overflow: hidden;
}

.mps-social-preview-image {
    width: 100%;
    height: 200px;
    background-color: #f1f1f1;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
}

.mps-social-preview-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.mps-social-preview-content {
    padding: 10px;
    background-color: #f5f5f5;
}

.mps-social-preview-title {
    font-size: 16px;
    font-weight: 600;
    color: #1877f2;
    margin-bottom: 5px;
}

.mps-social-preview-desc {
    font-size: 13px;
    color: #333;
    margin-bottom: 5px;
}

.mps-social-preview-url {
    font-size: 12px;
    color: #606770;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

/* Checkbox stylized */
.mps-checkbox-wrapper {
    margin-bottom: 10px;
    display: flex;
    align-items: center;
}

.mps-checkbox-wrapper input[type="checkbox"] {
    margin-right: 8px;
}

/* Integração com Rank Math */
.mps-rank-math-analyzer {
    margin-top: 20px;
    padding: 15px;
    background-color: #f8f8f8;
    border-radius: 4px;
    border: 1px solid #e5e5e5;
}

.mps-rank-math-analyzer h4 {
    margin-top: 0;
    margin-bottom: 15px;
    font-size: 16px;
    color: #23282d;
}

.rank-math-analyzer-container {
    position: relative;
    min-height: 150px;
}

.rank-math-loading {
    padding: 20px;
    text-align: center;
    color: #666;
    font-style: italic;
}

.rank-math-notice {
    padding: 10px;
    background-color: #f9f9f9;
    border-left: 4px solid #ffb900;
    color: #444;
}

/* Estilos para os resultados do analizador */
.rank-math-score-good {
    color: #1eb11e;
}

.rank-math-score-ok {
    color: #ff9800;
}

.rank-math-score-bad {
    color: #dc3232;
}

.rank-math-analyzer-result {
    margin-bottom: 10px;
    padding: 10px;
    border-bottom: 1px solid #eee;
}

.rank-math-analyzer-result:last-child {
    border-bottom: none;
}

.rank-math-analyzer-result-title {
    font-weight: 600;
    margin-bottom: 5px;
}

.rank-math-analyzer-result-description {
    font-size: 13px;
    line-height: 1.5;
}

/* SEO Metabox Frontend - Etiquetas de palavras-chave como no Rank Math */
.mps-keyword-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 5px;
    margin: 10px 0;
}

.mps-keyword-tag {
    display: inline-flex;
    align-items: center;
    padding: 3px 8px;
    border-radius: 3px;
    font-size: 12px;
    font-weight: 500;
    background-color: #f0f0f0;
    border: 1px solid #ddd;
}

.mps-keyword-tag.primary {
    background-color: #e9f7e9;
    border-color: #1eb11e;
    color: #1eb11e;
}

.mps-keyword-tag.secondary {
    background-color: #f0f8ff;
    border-color: #2271b1;
    color: #2271b1;
}

.mps-keyword-tag .dashicons {
    font-size: 14px;
    width: 14px;
    height: 14px;
    margin-right: 3px;
}

/* Estilo para mensagens de alerta importantes */
.mps-seo-alert {
    background-color: #ffecec;
    border-left: 4px solid #d63638;
    padding: 12px 15px;
    margin: 15px 0;
    display: flex;
    align-items: flex-start;
    font-weight: 500;
}

.mps-seo-alert-icon {
    margin-right: 10px;
    color: #d63638;
    flex-shrink: 0;
}

.mps-seo-alert-content h4 {
    margin: 0 0 5px;
    color: #d63638;
    font-size: 14px;
    text-transform: uppercase;
}

.mps-seo-alert-content p {
    margin: 0;
}

/* Estilo para a lista de verificação como no Rank Math */
.mps-seo-checklist-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 10px;
    background-color: #f8f8f8;
    border-bottom: 1px solid #e5e5e5;
    cursor: pointer;
}

.mps-seo-checklist-header h4 {
    margin: 0;
    font-size: 14px;
    font-weight: 600;
}

.mps-seo-checklist-header .mps-seo-score {
    display: inline-flex;
    align-items: center;
    font-size: 12px;
    font-weight: 600;
}

.mps-seo-checklist-header .mps-good-score {
    color: #1eb11e;
}

.mps-seo-checklist-content {
    margin: 0;
    padding: 0;
    list-style: none;
}

.mps-seo-check-item {
    display: flex;
    padding: 10px;
    border-bottom: 1px solid #f0f0f0;
}

.mps-seo-check-item:last-child {
    border-bottom: none;
}

.mps-check-status {
    flex-shrink: 0;
    margin-right: 10px;
    color: #1eb11e;
}

.mps-check-content {
    flex-grow: 1;
}

.mps-check-help {
    flex-shrink: 0;
    margin-left: 10px;
    color: #999;
    cursor: help;
}

/* Melhoria nos tooltips de ajuda */
.mps-tooltip {
    position: relative;
    display: inline-block;
}

.mps-tooltip .mps-tooltip-content {
    visibility: hidden;
    width: 250px;
    background-color: #555;
    color: #fff;
    text-align: left;
    border-radius: 4px;
    padding: 10px;
    position: absolute;
    z-index: 1;
    bottom: 125%;
    left: 50%;
    transform: translateX(-50%);
    opacity: 0;
    transition: opacity 0.3s;
    font-weight: normal;
    font-size: 12px;
    line-height: 1.4;
    box-shadow: 0 3px 10px rgba(0,0,0,0.2);
}

.mps-tooltip:hover .mps-tooltip-content {
    visibility: visible;
    opacity: 1;
}

/* Estilo para prévia de URL semelhante ao Rank Math */
.mps-url-preview {
    padding: 10px;
    background-color: #f8f8f8;
    border: 1px solid #e5e5e5;
    border-radius: 4px;
    margin-bottom: 15px;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Oxygen-Sans, Ubuntu, Cantarell, "Helvetica Neue", sans-serif;
}

.mps-url-preview-title {
    font-size: 13px;
    font-weight: 600;
    margin-bottom: 5px;
}

.mps-url-preview-content {
    word-break: break-all;
    font-size: 12px;
    color: #0073aa;
}

/* Checkbox de conteúdo pilar */
.mps-pillar-content-wrapper {
    margin-top: 10px;
    padding: 8px 12px;
    background-color: #f8f9fa;
    border-left: 3px solid #007cba;
    border-radius: 2px;
    display: flex;
    align-items: center;
}

.mps-pillar-content-wrapper label {
    font-weight: 600;
    color: #1d2327;
    margin-bottom: 0;
    margin-right: 5px;
}

.mps-pillar-content-wrapper .mps-tooltip {
    margin-left: 5px;
}

/* Campo de texto alternativo para imagens */
.mps-alt-text-field {
    margin-top: 8px;
    padding: 10px;
    border-radius: 4px;
}

.mps-highlight-field {
    background-color: #f7fcfe;
    border-left: 3px solid #72aee6;
    animation: pulse-border 2s ease-in-out;
}

@keyframes pulse-border {
    0% { border-left-color: #72aee6; }
    50% { border-left-color: #2271b1; }
    100% { border-left-color: #72aee6; }
}

/* Indicador visual de campo importante para SEO */
.mps-seo-recommended-field label::after {
    content: " *";
    color: #1eb11e;
    font-weight: bold;
}

.mps-seo-recommended-field .mps-form-help::before {
    content: "Recomendado: ";
    color: #1eb11e;
    font-weight: 600;
}

/* Responsividade */
@media (max-width: 768px) {
    .mps-half {
        flex: 0 0 calc(100% - 20px);
    }
    
    .mps-post-filter {
        flex-direction: column;
        align-items: flex-start;
    }
    
    .mps-post-filter input,
    .mps-post-filter select,
    .mps-post-filter button {
        width: 100%;
    }
}