/**
 * Estilos CSS para UTM Form API Connector
 */

/* Estilos para mensajes de debug en frontend */
.utmfac-debug-message {
    position: fixed;
    top: 20px;
    right: 20px;
    background: #333;
    color: #fff;
    padding: 10px 15px;
    border-radius: 5px;
    font-size: 12px;
    z-index: 9999;
    max-width: 300px;
    opacity: 0.9;
}

.utmfac-debug-message.success {
    background: #28a745;
}

.utmfac-debug-message.error {
    background: #dc3545;
}

.utmfac-debug-message.warning {
    background: #ffc107;
    color: #333;
}

/* Indicador de formulario procesado */
.wpforms-form.utmfac-processed {
    position: relative;
}

.wpforms-form.utmfac-processed::after {
    content: "✓ UTM Tracking Active";
    position: absolute;
    top: -25px;
    right: 0;
    background: #28a745;
    color: white;
    padding: 2px 8px;
    font-size: 10px;
    border-radius: 3px;
    display: none; /* Solo visible en modo debug */
}

/* Mostrar indicador solo en modo debug */
body.utmfac-debug .wpforms-form.utmfac-processed::after {
    display: block;
}

/* Estilos para admin */
.utmfac-admin-notice {
    border-left: 4px solid #00a0d2;
    padding: 12px;
    margin: 20px 0;
    background: #fff;
    box-shadow: 0 1px 1px rgba(0,0,0,.04);
}

.utmfac-admin-notice.error {
    border-left-color: #dc3232;
}

.utmfac-admin-notice.warning {
    border-left-color: #ffb900;
}

.utmfac-admin-notice.success {
    border-left-color: #46b450;
}

/* Tabla de configuración mejorada */
.utmfac-config-table {
    width: 100%;
    border-collapse: collapse;
    margin: 20px 0;
}

.utmfac-config-table th,
.utmfac-config-table td {
    padding: 12px;
    text-align: left;
    border-bottom: 1px solid #ddd;
}

.utmfac-config-table th {
    background-color: #f1f1f1;
    font-weight: 600;
}

.utmfac-config-table input[type="text"],
.utmfac-config-table input[type="url"],
.utmfac-config-table input[type="number"] {
    width: 100%;
    min-width: 200px;
}

/* Indicadores de estado */
.utmfac-status-indicator {
    display: inline-block;
    width: 12px;
    height: 12px;
    border-radius: 50%;
    margin-right: 8px;
}

.utmfac-status-indicator.active {
    background-color: #46b450;
}

.utmfac-status-indicator.inactive {
    background-color: #dc3232;
}

.utmfac-status-indicator.warning {
    background-color: #ffb900;
}

/* Loading spinner para test de conexión */
.utmfac-loading {
    display: inline-block;
    width: 16px;
    height: 16px;
    border: 2px solid #f3f3f3;
    border-top: 2px solid #3498db;
    border-radius: 50%;
    animation: utmfac-spin 1s linear infinite;
    margin-right: 8px;
}

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

/* Responsive para admin */
@media (max-width: 768px) {
    .utmfac-config-table,
    .utmfac-config-table thead,
    .utmfac-config-table tbody,
    .utmfac-config-table th,
    .utmfac-config-table td,
    .utmfac-config-table tr {
        display: block;
    }

    .utmfac-config-table thead tr {
        position: absolute;
        top: -9999px;
        left: -9999px;
    }

    .utmfac-config-table tr {
        border: 1px solid #ccc;
        margin-bottom: 10px;
        padding: 10px;
    }

    .utmfac-config-table td {
        border: none;
        position: relative;
        padding-left: 50%;
    }

    .utmfac-config-table td:before {
        content: attr(data-label) ": ";
        position: absolute;
        left: 6px;
        width: 45%;
        font-weight: bold;
    }
}

/* Tooltip para ayuda */
.utmfac-tooltip {
    position: relative;
    display: inline-block;
    cursor: help;
}

.utmfac-tooltip .utmfac-tooltiptext {
    visibility: hidden;
    width: 200px;
    background-color: #333;
    color: #fff;
    text-align: center;
    border-radius: 6px;
    padding: 8px;
    position: absolute;
    z-index: 1;
    bottom: 125%;
    left: 50%;
    margin-left: -100px;
    font-size: 12px;
    line-height: 1.4;
}

.utmfac-tooltip .utmfac-tooltiptext::after {
    content: "";
    position: absolute;
    top: 100%;
    left: 50%;
    margin-left: -5px;
    border-width: 5px;
    border-style: solid;
    border-color: #333 transparent transparent transparent;
}

.utmfac-tooltip:hover .utmfac-tooltiptext {
    visibility: visible;
}
