/**
 * Sistema de Análise Inteligente de Desempenho - Estilos
 */

/* ===== INSIGHTS COMPACTOS (Dashboard) ===== */

.insights-dashboard-list {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.insight-card-compact {
    display: flex;
    gap: 1rem;
    padding: 1rem;
    border-radius: 0.5rem;
    border-left: 3px solid;
    transition: all 0.2s;
    background: rgba(30, 41, 59, 0.4);
}

.insight-card-compact:hover {
    transform: translateX(4px);
    background: rgba(30, 41, 59, 0.6);
}

/* Variantes por severidade */
.insight-card-critical {
    border-left-color: rgb(248, 113, 113);
    background: rgba(239, 68, 68, 0.1);
}

.insight-card-critical:hover {
    background: rgba(239, 68, 68, 0.15);
}

.insight-card-warning {
    border-left-color: rgb(251, 146, 60);
    background: rgba(251, 146, 60, 0.1);
}

.insight-card-warning:hover {
    background: rgba(251, 146, 60, 0.15);
}

.insight-card-info {
    border-left-color: rgb(96, 165, 250);
    background: rgba(96, 165, 250, 0.1);
}

.insight-card-info:hover {
    background: rgba(96, 165, 250, 0.15);
}

.insight-card-success {
    border-left-color: rgb(52, 211, 153);
    background: rgba(16, 185, 129, 0.1);
}

.insight-card-success:hover {
    background: rgba(16, 185, 129, 0.15);
}

.insight-icon {
    flex-shrink: 0;
    width: 2.5rem;
    height: 2.5rem;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 0.5rem;
    background: rgba(15, 23, 42, 0.5);
}

.insight-content {
    flex: 1;
    min-width: 0;
}

.insight-title {
    font-size: 0.875rem;
    font-weight: 600;
    color: rgb(226, 232, 240);
    margin-bottom: 0.25rem;
    line-height: 1.3;
}

.insight-description {
    font-size: 0.8125rem;
    color: rgb(148, 163, 184);
    line-height: 1.4;
    margin-bottom: 0.5rem;
}

.insight-action-btn {
    display: inline-flex;
    align-items: center;
    gap: 0.375rem;
    font-size: 0.75rem;
    font-weight: 600;
    color: rgb(96, 165, 250);
    background: rgba(59, 130, 246, 0.1);
    padding: 0.375rem 0.75rem;
    border-radius: 0.375rem;
    border: 1px solid rgba(59, 130, 246, 0.3);
    cursor: pointer;
    transition: all 0.2s;
    margin-top: 0.5rem;
}

.insight-action-btn:hover {
    background: rgba(59, 130, 246, 0.2);
    border-color: rgba(59, 130, 246, 0.5);
    color: rgb(147, 197, 253);
}

.insight-action-btn i,
.insight-action-btn [data-lucide] {
    width: 0.75rem;
    height: 0.75rem;
}

/* ===== INSIGHTS EXPANDIDOS (Acompanhamento) ===== */

.insights-expanded-container {
    display: flex;
    flex-direction: column;
    gap: 2rem;
}

.insights-section {
    background: rgba(15, 23, 42, 0.4);
    border: 1px solid rgba(71, 85, 105, 0.5);
    border-radius: 0.75rem;
    padding: 1.5rem;
}

.insights-section-title {
    font-size: 1.125rem;
    font-weight: 700;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin-bottom: 1.25rem;
    padding-bottom: 0.75rem;
    border-bottom: 1px solid rgba(71, 85, 105, 0.3);
}

.insights-section-title i,
.insights-section-title [data-lucide] {
    width: 1.25rem;
    height: 1.25rem;
}

.insights-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 1rem;
}

.insight-card-expanded {
    background: rgba(30, 41, 59, 0.5);
    border: 1px solid rgba(71, 85, 105, 0.5);
    border-radius: 0.5rem;
    padding: 1.25rem;
    transition: all 0.2s;
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.insight-card-expanded:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
}

/* Variantes expandidas */
.insight-card-expanded.insight-card-critical {
    border-color: rgba(248, 113, 113, 0.5);
    background: rgba(239, 68, 68, 0.1);
}

.insight-card-expanded.insight-card-critical:hover {
    border-color: rgba(248, 113, 113, 0.7);
    background: rgba(239, 68, 68, 0.15);
}

.insight-card-expanded.insight-card-warning {
    border-color: rgba(251, 146, 60, 0.5);
    background: rgba(251, 146, 60, 0.1);
}

.insight-card-expanded.insight-card-warning:hover {
    border-color: rgba(251, 146, 60, 0.7);
    background: rgba(251, 146, 60, 0.15);
}

.insight-card-expanded.insight-card-info {
    border-color: rgba(96, 165, 250, 0.5);
    background: rgba(96, 165, 250, 0.1);
}

.insight-card-expanded.insight-card-info:hover {
    border-color: rgba(96, 165, 250, 0.7);
    background: rgba(96, 165, 250, 0.15);
}

.insight-card-expanded.insight-card-success {
    border-color: rgba(52, 211, 153, 0.5);
    background: rgba(16, 185, 129, 0.1);
}

.insight-card-expanded.insight-card-success:hover {
    border-color: rgba(52, 211, 153, 0.7);
    background: rgba(16, 185, 129, 0.15);
}

.insight-card-header {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.insight-icon-large {
    flex-shrink: 0;
    width: 3rem;
    height: 3rem;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 0.5rem;
    background: rgba(15, 23, 42, 0.7);
}

.insight-title-large {
    font-size: 1rem;
    font-weight: 700;
    color: rgb(226, 232, 240);
    line-height: 1.3;
    flex: 1;
}

.insight-description-large {
    font-size: 0.875rem;
    color: rgb(148, 163, 184);
    line-height: 1.5;
}

.insight-action-btn-large {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    font-size: 0.875rem;
    font-weight: 600;
    color: rgb(226, 232, 240);
    background: rgba(59, 130, 246, 0.2);
    padding: 0.625rem 1rem;
    border-radius: 0.375rem;
    border: 1px solid rgba(59, 130, 246, 0.5);
    cursor: pointer;
    transition: all 0.2s;
    width: 100%;
}

.insight-action-btn-large:hover {
    background: rgba(59, 130, 246, 0.3);
    border-color: rgba(59, 130, 246, 0.7);
    transform: translateY(-1px);
}

.insight-action-btn-large i,
.insight-action-btn-large [data-lucide] {
    width: 1rem;
    height: 1rem;
}

/* ===== ESTADO VAZIO ===== */

.insights-empty {
    text-align: center;
    padding: 3rem 1rem;
}

.insights-empty i,
.insights-empty [data-lucide] {
    width: 4rem;
    height: 4rem;
    margin: 0 auto 1rem;
}

/* ===== RESPONSIVIDADE ===== */

@media (max-width: 768px) {
    .insights-grid {
        grid-template-columns: 1fr;
    }

    .insight-card-compact {
        flex-direction: column;
        gap: 0.75rem;
    }

    .insight-icon {
        width: 2rem;
        height: 2rem;
    }

    .insight-title {
        font-size: 0.8125rem;
    }

    .insight-description {
        font-size: 0.75rem;
    }

    .insights-section {
        padding: 1rem;
    }

    .insights-section-title {
        font-size: 1rem;
    }

    .insight-card-expanded {
        padding: 1rem;
    }

    .insight-icon-large {
        width: 2.5rem;
        height: 2.5rem;
    }

    .insight-title-large {
        font-size: 0.9375rem;
    }

    .insight-description-large {
        font-size: 0.8125rem;
    }
}

@media (max-width: 480px) {
    .insights-dashboard-list {
        gap: 0.5rem;
    }

    .insight-card-compact {
        padding: 0.75rem;
    }

    .insight-action-btn {
        width: 100%;
        justify-content: center;
        margin-top: 0.5rem;
    }

    .insights-section {
        padding: 0.75rem;
    }

    .insights-grid {
        gap: 0.75rem;
    }

    .insight-card-expanded {
        padding: 0.875rem;
        gap: 0.75rem;
    }
}

/* ===== ANIMAÇÕES ===== */

@keyframes insightFadeIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.insight-card-compact,
.insight-card-expanded {
    animation: insightFadeIn 0.3s ease-out;
}

.insight-card-compact:nth-child(1) {
    animation-delay: 0s;
}

.insight-card-compact:nth-child(2) {
    animation-delay: 0.1s;
}

.insight-card-compact:nth-child(3) {
    animation-delay: 0.2s;
}

/* ===== UTILITÁRIOS ===== */

.insight-badge {
    display: inline-flex;
    align-items: center;
    gap: 0.25rem;
    font-size: 0.75rem;
    font-weight: 600;
    padding: 0.25rem 0.5rem;
    border-radius: 0.25rem;
    background: rgba(139, 92, 246, 0.2);
    color: rgb(167, 139, 250);
    border: 1px solid rgba(139, 92, 246, 0.3);
}

.insight-divider {
    height: 1px;
    background: linear-gradient(to right, transparent, rgba(71, 85, 105, 0.5), transparent);
    margin: 1.5rem 0;
}

/* Loading state */
.insight-loading {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 2rem;
    color: rgb(148, 163, 184);
    font-size: 0.875rem;
}

.insight-loading::before {
    content: '';
    display: inline-block;
    width: 1rem;
    height: 1rem;
    margin-right: 0.5rem;
    border: 2px solid rgba(139, 92, 246, 0.3);
    border-top-color: rgb(139, 92, 246);
    border-radius: 50%;
    animation: spin 0.6s linear infinite;
}

@keyframes spin {
    to {
        transform: rotate(360deg);
    }
}

/* ===== COCKPIT OVERRIDES ===== */

.insights-expanded-container {
    gap: 1.4rem;
}

.insights-section {
    position: relative;
    overflow: hidden;
    border-radius: 1.15rem;
    background:
        radial-gradient(circle at top right, rgba(34, 211, 238, 0.1), transparent 28%),
        linear-gradient(145deg, rgba(7, 15, 31, 0.96), rgba(18, 31, 58, 0.9));
    border: 1px solid rgba(71, 85, 105, 0.55);
    box-shadow:
        0 22px 48px rgba(2, 8, 23, 0.32),
        inset 0 0 0 1px rgba(255, 255, 255, 0.02);
}

.insights-section::after {
    content: "";
    position: absolute;
    inset: auto -4rem -5rem auto;
    width: 14rem;
    height: 14rem;
    background: radial-gradient(circle, rgba(59, 130, 246, 0.12), transparent 70%);
    pointer-events: none;
}

.insights-section > * {
    position: relative;
}

.insights-section-title {
    color: rgb(241, 245, 249);
    border-bottom-color: rgba(71, 85, 105, 0.38);
    letter-spacing: 0.04em;
}

.insights-grid {
    grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
    gap: 1rem;
}

.insight-card-expanded {
    min-height: 100%;
    border-radius: 1rem;
    background:
        linear-gradient(145deg, rgba(15, 23, 42, 0.92), rgba(26, 39, 69, 0.84));
    box-shadow:
        0 18px 34px rgba(2, 8, 23, 0.24),
        inset 0 0 0 1px rgba(255, 255, 255, 0.02);
}

.insight-card-expanded:hover {
    transform: translateY(-4px);
    box-shadow:
        0 28px 44px rgba(2, 8, 23, 0.34),
        0 0 24px rgba(34, 211, 238, 0.08);
}

.insight-icon,
.insight-icon-large {
    background: linear-gradient(145deg, rgba(8, 15, 31, 0.95), rgba(20, 33, 62, 0.88));
    box-shadow:
        inset 0 0 0 1px rgba(255, 255, 255, 0.02),
        0 0 20px rgba(34, 211, 238, 0.08);
}

.insight-title-large,
.insight-title {
    color: rgb(248, 250, 252);
}

.insight-description-large,
.insight-description {
    color: rgb(148, 163, 184);
}

.insight-action-btn-large,
.insight-action-btn {
    border-radius: 999px;
    border-color: rgba(34, 211, 238, 0.24);
    background: linear-gradient(145deg, rgba(8, 15, 31, 0.96), rgba(18, 31, 58, 0.84));
    box-shadow: 0 0 24px rgba(34, 211, 238, 0.08);
}

.insight-action-btn-large:hover,
.insight-action-btn:hover {
    border-color: rgba(34, 211, 238, 0.45);
    color: rgb(224, 242, 254);
}
