/* Dashboard Profesional - Smart WhatsApp Button */

.mcnb-dashboard {
    background: #f1f1f1;
    margin-bottom: 20px;
    padding: 0;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
}

/* Header */
.mcnb-dashboard-header {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 2rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
}

.mcnb-dashboard-title {
    font-size: 2rem;
    margin: 0;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-weight: 300;
}

.mcnb-dashboard-title .dashicons {
    font-size: 2rem;
}

.mcnb-dashboard-actions {
    display: flex;
    gap: 1rem;
    align-items: center;
}

.mcnb-select {
    background: rgba(255, 255, 255, 0.2);
    border: 1px solid rgba(255, 255, 255, 0.3);
    color: white;
    padding: 0.5rem 1rem;
    border-radius: 6px;
    font-size: 0.9rem;
}

.mcnb-select option {
    background: #333;
    color: white;
}

.mcnb-dashboard-actions .button {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.5rem 1rem;
    border-radius: 6px;
    font-weight: 500;
    transition: all 0.2s ease;
}

.mcnb-dashboard-actions .button-primary {
    background: rgba(255, 255, 255, 0.2);
    border-color: rgba(255, 255, 255, 0.3);
    color: white;
}

.mcnb-dashboard-actions .button-primary:hover {
    background: rgba(255, 255, 255, 0.3);
    transform: translateY(-1px);
}

/* KPI Grid */
.mcnb-kpi-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 1.5rem;
    padding: 2rem;
    margin-bottom: 1rem;
}

.mcnb-kpi-card {
    background: white;
    border-radius: 12px;
    padding: 1.5rem;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
    border: 1px solid #e1e5e9;
    display: flex;
    align-items: center;
    gap: 1rem;
    transition: all 0.2s ease;
}

.mcnb-kpi-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.12);
}

.mcnb-kpi-icon {
    width: 60px;
    height: 60px;
    border-radius: 50%;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.mcnb-kpi-icon .dashicons {
    color: white;
    font-size: 24px;
}

.mcnb-kpi-content {
    flex: 1;
}

.mcnb-kpi-value {
    font-size: 2.5rem;
    font-weight: 700;
    color: #2c3e50;
    line-height: 1;
    margin-bottom: 0.25rem;
}

.mcnb-kpi-label {
    font-size: 0.9rem;
    color: #7f8c8d;
    margin-bottom: 0.5rem;
    font-weight: 500;
}

.mcnb-kpi-change {
    font-size: 0.85rem;
    font-weight: 600;
    padding: 0.25rem 0.5rem;
    border-radius: 4px;
    display: inline-block;
}

.mcnb-kpi-change.positive {
    background: #d4edda;
    color: #155724;
}

.mcnb-kpi-change.negative {
    background: #f8d7da;
    color: #721c24;
}

.mcnb-kpi-change.neutral {
    background: #e2e3e5;
    color: #383d41;
}

/* Charts */
.mcnb-charts-row {
    display: grid;
    grid-template-columns: 2fr 1fr;
    gap: 1.5rem;
    padding: 0 2rem 2rem;
}

.mcnb-chart-container {
    background: white;
    border-radius: 12px;
    padding: 1.5rem;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
    border: 1px solid #e1e5e9;
}

.mcnb-chart-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1.5rem;
    padding-bottom: 1rem;
    border-bottom: 1px solid #eee;
}

.mcnb-chart-header h3 {
    margin: 0;
    font-size: 1.1rem;
    font-weight: 600;
    color: #2c3e50;
}

.mcnb-chart-loading {
    display: none;
}

.mcnb-chart-loading.active {
    display: block;
}

/* Tables */
.mcnb-tables-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1.5rem;
    padding: 0 2rem 2rem;
}

.mcnb-table-container {
    background: white;
    border-radius: 12px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
    border: 1px solid #e1e5e9;
    overflow: hidden;
}

.mcnb-table-header {
    padding: 1.5rem;
    background: #f8f9fa;
    border-bottom: 1px solid #e1e5e9;
}

.mcnb-table-header h3 {
    margin: 0;
    font-size: 1.1rem;
    font-weight: 600;
    color: #2c3e50;
}

.mcnb-table-wrapper {
    overflow-x: auto;
}

.mcnb-data-table {
    width: 100%;
    border-collapse: collapse;
}

.mcnb-data-table th {
    background: #f8f9fa;
    padding: 1rem;
    text-align: left;
    font-weight: 600;
    color: #495057;
    font-size: 0.85rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    border-bottom: 1px solid #e1e5e9;
}

.mcnb-data-table td {
    padding: 1rem;
    border-bottom: 1px solid #f1f3f4;
    color: #495057;
}

.mcnb-data-table tbody tr:hover {
    background: #f8f9fa;
}

.mcnb-data-table .loading-row td {
    text-align: center;
    padding: 2rem;
    color: #6c757d;
}

/* Chart Wrapper para gráficos más pequeños */
.mcnb-chart-wrapper {
    padding: 1.5rem;
    height: 300px;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* Insights Panel */
.mcnb-insights-panel {
    margin: 0 2rem 2rem;
    background: white;
    border-radius: 12px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
    border: 1px solid #e1e5e9;
    overflow: hidden;
}

.mcnb-insights-header {
    padding: 1.5rem;
    background: linear-gradient(135deg, #ffecd2 0%, #fcb69f 100%);
    border-bottom: 1px solid #e1e5e9;
}

.mcnb-insights-header h3 {
    margin: 0;
    font-size: 1.1rem;
    font-weight: 600;
    color: #8b4513;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.mcnb-insights-content {
    padding: 1.5rem;
}

.mcnb-insight-item {
    display: flex;
    align-items: flex-start;
    gap: 1rem;
    padding: 1rem;
    border-radius: 8px;
    margin-bottom: 1rem;
    border-left: 4px solid #3498db;
    background: #f8f9fa;
}

.mcnb-insight-item.warning {
    border-left-color: #f39c12;
    background: #fef9e7;
}

.mcnb-insight-item.success {
    border-left-color: #27ae60;
    background: #eafaf1;
}

.mcnb-insight-item.loading {
    justify-content: center;
    border: none;
    background: transparent;
}

/* Activity Feed */
.mcnb-activity-panel {
    margin: 0 2rem 2rem;
    background: white;
    border-radius: 12px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
    border: 1px solid #e1e5e9;
    max-height: 400px;
    overflow: hidden;
}

.mcnb-activity-header {
    padding: 1.5rem;
    background: #f8f9fa;
    border-bottom: 1px solid #e1e5e9;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.mcnb-activity-header h3 {
    margin: 0;
    font-size: 1.1rem;
    font-weight: 600;
    color: #2c3e50;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.mcnb-live-indicator {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.75rem;
    font-weight: 600;
    color: #27ae60;
}

.mcnb-live-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: #27ae60;
    animation: mcnb-pulse 2s infinite;
}

@keyframes mcnb-pulse {
    0% { opacity: 1; }
    50% { opacity: 0.5; }
    100% { opacity: 1; }
}

.mcnb-activity-feed {
    max-height: 300px;
    overflow-y: auto;
    padding: 1rem;
}

.mcnb-activity-item {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 0.75rem;
    border-radius: 6px;
    margin-bottom: 0.5rem;
    transition: background 0.2s ease;
}

.mcnb-activity-item:hover {
    background: #f8f9fa;
}

.mcnb-activity-time {
    font-size: 0.75rem;
    color: #6c757d;
    white-space: nowrap;
}

.mcnb-activity-content {
    flex: 1;
    font-size: 0.9rem;
    color: #495057;
}

/* Responsive */
@media (max-width: 1200px) {
    .mcnb-charts-row {
        grid-template-columns: 1fr;
    }
    
    .mcnb-tables-row {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 768px) {
    .mcnb-dashboard-header {
        flex-direction: column;
        gap: 1rem;
        text-align: center;
    }
    
    .mcnb-kpi-grid {
        grid-template-columns: 1fr;
        padding: 1rem;
    }
    
    .mcnb-charts-row,
    .mcnb-tables-row {
        padding: 0 1rem 1rem;
    }
    
    .mcnb-insights-panel,
    .mcnb-activity-panel {
        margin: 0 1rem 1rem;
    }
}

/* Loading States */
.mcnb-loading {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 2rem;
    color: #6c757d;
}

.mcnb-error {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 2rem;
    color: #dc3545;
    background: #f8d7da;
    border-radius: 6px;
    margin: 1rem;
}

/* Animations */
.mcnb-fade-in {
    animation: mcnb-fadeIn 0.3s ease-in;
}

@keyframes mcnb-fadeIn {
    from { opacity: 0; transform: translateY(10px); }
    to { opacity: 1; transform: translateY(0); }
}

/* A/B Testing Analysis Section */
.mcnb-ab-analysis-section {
    background: white;
    border-radius: 12px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    margin: 2rem 0;
    overflow: hidden;
}

.mcnb-ab-analysis-header {
    background: linear-gradient(135deg, #25D366 0%, #128C7E 100%);
    color: white;
    padding: 1.5rem 2rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.mcnb-ab-analysis-header h2 {
    margin: 0;
    font-size: 1.5rem;
    font-weight: 500;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.mcnb-ab-analysis-header .dashicons {
    font-size: 1.5rem;
}

.mcnb-ab-status {
    display: flex;
    align-items: center;
}

.mcnb-status-badge {
    padding: 0.5rem 1rem;
    border-radius: 20px;
    font-size: 0.8rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.mcnb-status-active {
    background: rgba(255, 255, 255, 0.2);
    color: white;
    border: 1px solid rgba(255, 255, 255, 0.3);
}

.mcnb-status-inactive {
    background: rgba(255, 255, 255, 0.1);
    color: rgba(255, 255, 255, 0.7);
    border: 1px solid rgba(255, 255, 255, 0.2);
}

/* A/B Testing Metrics Grid */
.mcnb-ab-metrics-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 2rem;
    padding: 2rem;
}

.mcnb-ab-variant-card {
    background: #f8f9fa;
    border-radius: 12px;
    padding: 1.5rem;
    border: 2px solid transparent;
    transition: all 0.3s ease;
}

.mcnb-variant-control {
    border-color: #007cba;
}

.mcnb-variant-test {
    border-color: #25D366;
}

.mcnb-ab-variant-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

.mcnb-ab-variant-header {
    display: flex;
    align-items: center;
    gap: 1rem;
    margin-bottom: 1.5rem;
}

.mcnb-ab-variant-icon {
    width: 48px;
    height: 48px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
    color: white;
}

.mcnb-variant-control .mcnb-ab-variant-icon {
    background: #007cba;
}

.mcnb-variant-test .mcnb-ab-variant-icon {
    background: #25D366;
}

.mcnb-ab-variant-info {
    flex: 1;
}

.mcnb-ab-variant-info h3 {
    margin: 0 0 0.25rem 0;
    font-size: 1.1rem;
    font-weight: 600;
    color: #333;
}

.mcnb-ab-variant-description {
    margin: 0;
    font-size: 0.9rem;
    color: #666;
}

.mcnb-ab-variant-percentage {
    background: white;
    padding: 0.5rem 1rem;
    border-radius: 20px;
    font-weight: 600;
    color: #333;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.mcnb-ab-metrics {
    display: grid;
    grid-template-columns: 1fr 1fr 1fr;
    gap: 1rem;
}

.mcnb-ab-metric {
    text-align: center;
    padding: 1rem;
    background: white;
    border-radius: 8px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
}

.mcnb-ab-metric-value {
    font-size: 1.5rem;
    font-weight: 700;
    color: #333;
    margin-bottom: 0.25rem;
}

.mcnb-ab-metric-label {
    font-size: 0.8rem;
    color: #666;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

/* A/B Testing Results Summary */
.mcnb-ab-results-summary {
    background: #f8f9fa;
    padding: 2rem;
    border-top: 1px solid #e9ecef;
}

.mcnb-ab-results-header h3 {
    margin: 0 0 1.5rem 0;
    font-size: 1.2rem;
    color: #333;
    font-weight: 600;
}

.mcnb-ab-results-content {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 1.5rem;
}

.mcnb-ab-result-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1rem;
    background: white;
    border-radius: 8px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
}

.mcnb-ab-result-label {
    font-size: 0.9rem;
    color: #666;
    font-weight: 500;
}

.mcnb-ab-result-value {
    font-size: 1.1rem;
    font-weight: 700;
    color: #333;
}

/* A/B Testing Chart */
.mcnb-ab-chart-container {
    padding: 2rem;
    border-top: 1px solid #e9ecef;
}

.mcnb-ab-chart-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1.5rem;
}

.mcnb-ab-chart-header h3 {
    margin: 0;
    font-size: 1.2rem;
    color: #333;
    font-weight: 600;
}

.mcnb-ab-chart-loading {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    color: #666;
}

/* Responsive Design */
@media (max-width: 768px) {
    .mcnb-ab-metrics-grid {
        grid-template-columns: 1fr;
        gap: 1rem;
        padding: 1rem;
    }
    
    .mcnb-ab-variant-header {
        flex-direction: column;
        text-align: center;
        gap: 0.5rem;
    }
    
    .mcnb-ab-metrics {
        grid-template-columns: 1fr;
        gap: 0.5rem;
    }
    
    .mcnb-ab-results-content {
        grid-template-columns: 1fr;
        gap: 1rem;
    }
    
    .mcnb-ab-analysis-header {
        flex-direction: column;
        gap: 1rem;
        text-align: center;
    }
}
