/**
 * Estilos para o gerenciador de testes A/B
 */

/* Cores principais */
:root {
    --ab-primary: #0073e6;
    --ab-primary-dark: #005bb7;
    --ab-primary-light: #e6f2ff;
    --ab-success: #00c853;
    --ab-success-light: #e6f9f0;
    --ab-danger: #f44336;
    --ab-danger-light: #ffebee;
    --ab-warning: #ffc107;
    --ab-warning-light: #fff8e1;
    --ab-text: #333333;
    --ab-text-light: #666666;
    --ab-border: #e0e0e0;
    --ab-background: #f8f9fa;
    --ab-card: #ffffff;
}

/* Container principal */
.ab-test-manager {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Oxygen-Sans, Ubuntu, Cantarell, "Helvetica Neue", sans-serif;
    color: var(--ab-text);
    max-width: 1200px;
    margin: 0 auto;
    padding: 20px;
    background-color: var(--ab-background);
    border-radius: 8px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
}

/* Cabeçalho */
.ab-test-header {
    margin-bottom: 30px;
    padding-bottom: 20px;
    border-bottom: 1px solid var(--ab-border);
}

.ab-test-header h2 {
    font-size: 24px;
    font-weight: 600;
    color: var(--ab-primary);
    margin: 0 0 10px 0;
}

.ab-test-description {
    font-size: 16px;
    color: var(--ab-text-light);
    margin: 0;
}

/* Seção de limites */
.ab-test-limits {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 30px;
    padding: 15px;
    background-color: var(--ab-primary-light);
    border-radius: 6px;
}

.ab-test-limit-info {
    display: flex;
    align-items: center;
}

.ab-test-limit-label {
    font-weight: 600;
    margin-right: 10px;
}

.ab-test-limit-value {
    font-size: 16px;
    font-weight: 700;
    color: var(--ab-primary);
}

.ab-test-limit-reached {
    padding: 10px 15px;
    background-color: var(--ab-warning-light);
    border-radius: 4px;
    color: var(--ab-text);
}

/* Botões */
.ab-test-button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 8px 16px;
    font-size: 14px;
    font-weight: 500;
    border-radius: 4px;
    border: 1px solid var(--ab-border);
    background-color: var(--ab-card);
    color: var(--ab-text);
    cursor: pointer;
    transition: all 0.2s ease;
}

.ab-test-button:hover {
    background-color: var(--ab-background);
}

.ab-test-primary-button {
    background-color: var(--ab-primary);
    border-color: var(--ab-primary);
    color: white;
}

.ab-test-primary-button:hover {
    background-color: var(--ab-primary-dark);
    border-color: var(--ab-primary-dark);
}

.ab-test-delete-button {
    color: var(--ab-danger);
}

.ab-test-delete-button:hover {
    background-color: var(--ab-danger-light);
}

.ab-test-create-button {
    background-color: var(--ab-success);
    border-color: var(--ab-success);
    color: white;
}

.ab-test-create-button:hover {
    background-color: #00a844;
    border-color: #00a844;
}

.ab-test-copy-button {
    padding: 4px 8px;
    font-size: 12px;
    margin-left: 10px;
}

.ab-test-close-button {
    padding: 4px 8px;
    font-size: 12px;
    background: none;
    border: none;
}

.ab-test-close-button:hover {
    color: var(--ab-danger);
    background: none;
}

.ab-test-button .dashicons {
    margin-right: 5px;
    font-size: 16px;
    width: 16px;
    height: 16px;
}

/* Formulários */
.ab-test-form-container {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: rgba(0, 0, 0, 0.5);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 9999;
}

.ab-test-form {
    width: 100%;
    max-width: 500px;
    background-color: var(--ab-card);
    border-radius: 8px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.15);
    overflow: hidden;
}

.ab-test-form-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 15px 20px;
    background-color: var(--ab-primary);
    color: white;
}

.ab-test-form-header h3 {
    margin: 0;
    font-size: 18px;
    font-weight: 600;
}

.ab-test-form form {
    padding: 20px;
}

.ab-test-form-field {
    margin-bottom: 20px;
}

.ab-test-form-field label {
    display: block;
    margin-bottom: 8px;
    font-weight: 500;
}

.ab-test-form-field input[type="text"],
.ab-test-form-field input[type="url"],
.ab-test-form-field input[type="number"] {
    width: 100%;
    padding: 10px;
    border: 1px solid var(--ab-border);
    border-radius: 4px;
    font-size: 14px;
}

.ab-test-form-field input[type="checkbox"] {
    margin-right: 8px;
}

.ab-test-form-hint {
    margin-top: 4px;
    font-size: 12px;
    color: var(--ab-text-light);
}

.ab-test-form-actions {
    display: flex;
    justify-content: flex-end;
    margin-top: 30px;
}

/* Cards de teste */
.ab-test-card {
    background-color: var(--ab-card);
    border-radius: 8px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
    margin-bottom: 20px;
    overflow: hidden;
}

.ab-test-card-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 15px 20px;
    background-color: var(--ab-primary-light);
    border-bottom: 1px solid var(--ab-border);
}

.ab-test-card-title {
    display: flex;
    align-items: center;
}

.ab-test-card-title h3 {
    margin: 0;
    font-size: 18px;
    font-weight: 600;
    margin-right: 10px;
}

.ab-test-status {
    display: inline-block;
    padding: 4px 8px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 500;
}

.ab-test-active {
    background-color: var(--ab-success-light);
    color: var(--ab-success);
}

.ab-test-inactive {
    background-color: var(--ab-danger-light);
    color: var(--ab-danger);
}

.ab-test-card-actions {
    display: flex;
    gap: 10px;
}

.ab-test-card-content {
    padding: 20px;
}

/* URL do teste */
.ab-test-url-container {
    background-color: var(--ab-background);
    padding: 15px;
    border-radius: 6px;
    margin-bottom: 20px;
}

.ab-test-url-label {
    font-weight: 600;
    margin-bottom: 5px;
}

.ab-test-url-value {
    display: flex;
    align-items: center;
}

.ab-test-url-value code {
    flex-grow: 1;
    padding: 8px 12px;
    background-color: var(--ab-card);
    border: 1px solid var(--ab-border);
    border-radius: 4px;
    font-family: monospace;
    word-break: break-all;
}

/* Seção de variantes */
.ab-test-variants-container {
    margin-top: 30px;
}

.ab-test-variants-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 15px;
}

.ab-test-variants-header h4 {
    margin: 0;
    font-size: 16px;
    font-weight: 600;
}

.ab-test-variants-list {
    margin-bottom: 15px;
}

.ab-test-variant-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 12px 15px;
    background-color: var(--ab-background);
    border-radius: 6px;
    margin-bottom: 10px;
}

.ab-test-variant-info {
    flex: 1;
}

.ab-test-variant-name {
    font-weight: 500;
    margin-bottom: 5px;
}

.ab-test-variant-weight {
    font-size: 14px;
    color: var(--ab-text-light);
}

.ab-test-variant-stats {
    display: flex;
    gap: 15px;
    margin: 0 15px;
}

.ab-test-stat {
    text-align: center;
}

.ab-test-stat-label {
    display: block;
    font-size: 12px;
    color: var(--ab-text-light);
    margin-bottom: 3px;
}

.ab-test-stat-value {
    font-size: 14px;
    font-weight: 600;
}

.ab-test-variant-actions {
    display: flex;
    gap: 5px;
}

.ab-test-variant-actions .ab-test-button {
    padding: 4px 8px;
}

/* Resumo de peso */
.ab-test-weight-summary {
    padding: 12px 15px;
    background-color: var(--ab-background);
    border-radius: 6px;
    margin-top: 15px;
}

.ab-test-weight-info {
    display: flex;
    align-items: center;
}

.ab-test-weight-label {
    font-weight: 500;
    margin-right: 10px;
}

.ab-test-weight-value {
    font-size: 16px;
    font-weight: 600;
}

.ab-test-weight-warning {
    margin-left: 10px;
    font-size: 14px;
    color: var(--ab-warning);
}

.ab-test-weight-ok .ab-test-weight-value {
    color: var(--ab-success);
}

.ab-test-weight-error .ab-test-weight-value {
    color: var(--ab-danger);
}

/* Mensagem vazia */
.ab-test-empty {
    text-align: center;
    padding: 40px 20px;
    background-color: var(--ab-card);
    border-radius: 8px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
}

.ab-test-empty-icon {
    margin-bottom: 15px;
}

.ab-test-empty-icon .dashicons {
    font-size: 48px;
    width: 48px;
    height: 48px;
    color: var(--ab-primary);
}

.ab-test-empty h3 {
    margin: 0 0 10px 0;
    font-weight: 600;
}

.ab-test-empty p {
    margin: 0;
    color: var(--ab-text-light);
}

.ab-test-empty-variants {
    padding: 15px;
    background-color: var(--ab-background);
    border-radius: 6px;
    text-align: center;
    color: var(--ab-text-light);
}

/* Notificações */
.ab-test-notification {
    position: fixed;
    bottom: 20px;
    right: 20px;
    padding: 15px 20px;
    border-radius: 6px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    font-size: 14px;
    z-index: 9999;
    opacity: 0;
    transform: translateY(20px);
    transition: opacity 0.3s, transform 0.3s;
}

.ab-test-notification.show {
    opacity: 1;
    transform: translateY(0);
}

.ab-test-success {
    background-color: var(--ab-success);
    color: white;
}

.ab-test-error {
    background-color: var(--ab-danger);
    color: white;
}

/* Animação de spinner */
.ab-test-spin {
    animation: ab-test-spin 1s linear infinite;
}

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

/* Mensagem de login */
.ab-test-login-message {
    text-align: center;
    padding: 40px 20px;
    background-color: var(--ab-primary-light);
    border-radius: 8px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
}

.ab-test-login-message p {
    margin: 0 0 20px 0;
    font-size: 16px;
}

.ab-test-login-button {
    display: inline-block;
    padding: 10px 20px;
    background-color: var(--ab-primary);
    color: white;
    border-radius: 4px;
    text-decoration: none;
    font-weight: 500;
    transition: background-color 0.2s;
}

.ab-test-login-button:hover {
    background-color: var(--ab-primary-dark);
    text-decoration: none;
    color: white;
}

/* Responsividade */
@media (max-width: 768px) {
    .ab-test-limits {
        flex-direction: column;
        gap: 15px;
        align-items: flex-start;
    }
    
    .ab-test-card-header {
        flex-direction: column;
        align-items: flex-start;
    }
    
    .ab-test-card-actions {
        margin-top: 15px;
    }
    
    .ab-test-variant-item {
        flex-direction: column;
        align-items: flex-start;
    }
    
    .ab-test-variant-stats {
        margin: 15px 0;
    }
    
    .ab-test-variant-actions {
        width: 100%;
        justify-content: flex-end;
    }
}