/* ==========================================================================
   IX. DATA INSIGHTS TAB (`#insights-tab`)
   ========================================================================== */

/* Enhanced Insight Card Styling */
.insight-card {
    position: relative;
    overflow: visible;
    /* Mindstate: Removed transition for cleaner interaction */
}

/* Mindstate: Simplified top border - removed gradient for solid accent */
.insight-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 3px;
    background: var(--ms-data-green); /* Mindstate: Solid color instead of gradient */
    /* Mindstate: Removed shimmer animation - too decorative */
    border-radius: 0; /* Mindstate: Sharp corners */
}

/* Card Header with Enhanced Aesthetics */
.insight-card-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: var(--spacing-lg);
    cursor: pointer;
    background: var(--color-white);
    border-radius: 0; /* Mindstate: Sharp corners */
    position: relative;
    margin-top: 3px;
}

.insight-card-header:hover {
    background: #FAFAFA; /* Mindstate: Very light gray instead of neuomorphic bg */
}

/* Header Content Layout */
.insight-header-content {
    display: flex;
    align-items: center;
    gap: var(--spacing-md);
    flex: 1;
}

/* Icon Styling */
/* Mindstate: Simplified icon container - removed neuomorphic styling */
.insight-icon {
    font-size: 2rem;
    /* Mindstate: Removed drop shadow and gradient */
    background: #F4F4F4; /* Mindstate: Light gray background */
    width: 50px;
    height: 50px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 0; /* Mindstate: Sharp corners */
    border: 1px solid #EBEBEB; /* Mindstate: Simple border instead of shadow */
    /* Mindstate: Removed neuomorphic dual shadows */
}

/* Title Group */
.insight-title-group {
    flex: 1;
}

.insight-title {
    font-size: 1.2rem;
    font-weight: 600;
    color: #000000; /* Mindstate: Pure black text */
    margin: 0 0 var(--spacing-xs) 0;
    line-height: 1.3;
    letter-spacing: -0.02em; /* Mindstate: Tighter letter spacing */
}

.insight-subtitle {
    font-size: 0.85rem;
    color: #8B9187; /* Mindstate: Medium gray for secondary text */
    margin: 0;
    line-height: 1.4;
}

/* Chevron Icon */
.insight-card-header .chevron-icon {
    font-size: 1rem;
    color: #6B8E23; /* Mindstate: Data green instead of primary */
    display: inline-block;
}

/* Card Content */
.insight-card-content {
    padding: var(--spacing-lg);
    background: var(--color-white);
    display: none;
    border-radius: 0; /* Mindstate: Sharp corners */
}

.insight-card-content.active {
    display: block !important;
}

/* Expanded state - chevron rotates */
.insight-card:not(.collapsed) .chevron-icon {
    transform: rotate(90deg);
}

/* Initialize cards as collapsed by default */
.insight-card {
    /* Default state - cards start collapsed */
}

/* Ensure charts don't overflow their containers */
#insights-tab .chart-container {
    width: 100%;
    max-width: 100%;
    overflow: hidden;
    position: relative;
}

#insights-tab canvas {
    max-width: 100% !important;
    height: auto !important;
}

/* Cross-Disorder Patterns Card */
#insights-tab .card.mb-3 .chart-container {
    height: 500px;
}

/* Layout for Statistical Distributions and Transdiagnostic Symptoms */

/* Most Transdiagnostic Symptoms Card */
#transdiagnosticList {
    /* Container for the list of transdiagnostic symptoms */
}

/* Remove scrollbar from the parent insight card content */
#transdiagnosticSymptoms {
    overflow: visible !important;
    max-height: none !important;
}

/* Mindstate: Simplified list item styling */
#transdiagnosticList .list-item {
    padding: var(--spacing-sm) var(--spacing-md);
    margin-bottom: var(--spacing-xs);
    background: #FFFFFF; /* Mindstate: White background */
    border-radius: 0; /* Mindstate: Sharp corners */
    border: 1px solid #F4F4F4; /* Mindstate: Simple border instead of shadow */
    /* Mindstate: Removed neuomorphic shadows */
    color: #000000; /* Mindstate: Pure black text */
    font-size: 0.9rem;
}

/* Fix for card height in the two-column layout on this tab */
#insights-tab .two-column > .card {
    height: auto !important;
    min-height: 0 !important;
}

#insights-tab .two-column > .card .metrics-grid,
#insights-tab .two-column > .card .stats-summary {
    height: auto !important;
    min-height: 0 !important;
}

#insights-tab .two-column > .card .metric-card {
    height: auto !important;
    min-height: 0 !important;
}

/* Transdiagnostic Results Container */
#transdiagnosticResultsContainer {
    max-height: 600px;
    overflow-y: auto;
    padding-right: var(--spacing-sm);
}

/* Custom scrollbar for transdiagnostic results */
#transdiagnosticResultsContainer::-webkit-scrollbar {
    width: 8px;
}

#transdiagnosticResultsContainer::-webkit-scrollbar-track {
    background: #F4F4F4; /* Mindstate: Light gray */
    border-radius: 0; /* Mindstate: Sharp corners */
}

#transdiagnosticResultsContainer::-webkit-scrollbar-thumb {
    background: #8B9187; /* Mindstate: Medium gray */
    border-radius: 0; /* Mindstate: Sharp corners */
}

#transdiagnosticResultsContainer::-webkit-scrollbar-thumb:hover {
    background: #3B3B3B; /* Mindstate: Dark gray on hover */
}

.transdiagnostic-header {
    text-align: center;
    margin-bottom: var(--spacing-lg);
}

.transdiagnostic-header p {
    color: #8B9187; /* Mindstate: Medium gray for secondary text */
    font-size: 0.9rem;
}

.transdiagnostic-header strong {
    color: #000000; /* Mindstate: Pure black for emphasis */
    font-weight: 600;
}

/* Transdiagnostic Symptoms Enhancements */
/* Mindstate: Simplified filter controls */
#transdiagnosticList .filter-controls {
    background: #FAFAFA; /* Mindstate: Very light gray */
    border-radius: 0; /* Mindstate: Sharp corners */
    padding: var(--spacing-lg);
    margin-bottom: var(--spacing-lg);
    border: 1px solid #EBEBEB; /* Mindstate: Simple border instead of inset shadow */
    /* Mindstate: Removed neuomorphic inset shadows */
}

#transdiagnosticList .filter-grid {
    display: grid;
    gap: var(--spacing-md);
}

#transdiagnosticList .filter-group {
    display: flex;
    flex-direction: column;
}

#transdiagnosticList .input-label {
    font-size: 0.85rem;
    color: #3B3B3B; /* Mindstate: Dark gray for labels */
    margin-bottom: var(--spacing-xs);
    font-weight: 500;
    text-transform: uppercase; /* Mindstate: Uppercase labels */
    letter-spacing: 0.05em; /* Mindstate: Wide letter spacing for labels */
}

#transdiagnosticList .neumorphic-input {
    width: 100%;
    padding: var(--spacing-xs) var(--spacing-sm);
    font-size: 0.9rem;
}

#transdiagnosticList .filter-status {
    margin-top: var(--spacing-md);
    font-size: 0.85rem;
    color: #8B9187; /* Mindstate: Medium gray */
    text-align: center;
    padding: var(--spacing-sm);
    background: #FFFFFF; /* Mindstate: White background */
    border-radius: 0; /* Mindstate: Sharp corners */
    border: 1px solid #F4F4F4; /* Mindstate: Light border */
}

#transdiagnosticList .filter-status strong {
    color: #000000; /* Mindstate: Pure black for emphasis */
    font-weight: 600;
}

/* Show More Button Styling */
.show-more-container {
    text-align: center;
    margin-top: var(--spacing-xl);
    padding: var(--spacing-lg) 0;
    border-top: 1px solid #EBEBEB; /* Mindstate: Light gray border */
}

/* Show more container button styles - using shared button components */
.show-more-container .os-btn {
    margin: 0 var(--spacing-sm);
}

/* Custom link button style for data insights */
/* Mindstate: Simplified link button */
.os-btn--link {
    color: #6B8E23; /* Mindstate: Data green */
    text-decoration: underline;
    background: none;
    box-shadow: none;
    padding: var(--spacing-sm) var(--spacing-md);
}

.os-btn--link:hover {
    color: #000000; /* Mindstate: Black on hover */
    background: none;
    box-shadow: none;
    text-decoration: underline;
    transform: translateY(-1px);
}

/* Additional insights sections */
#therapeuticGapAnalysisCard {
    margin-top: var(--spacing-xl);
}

#therapeuticGapAnalysisCard h3 {
    margin-bottom: var(--spacing-md);
    letter-spacing: -0.02em; /* Mindstate: Tighter letter spacing */
}

/* Mindstate: Simplified gap list items */
#therapeuticGapAnalysisCard .gap-list-item {
    padding: var(--spacing-md);
    background: #FFFFFF; /* Mindstate: White background */
    border-radius: 0; /* Mindstate: Sharp corners */
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05); /* Mindstate: Minimal shadow */
    margin-bottom: var(--spacing-sm);
    border-left: 3px solid #BDB76B; /* Mindstate: Data yellow for warnings */
}

#therapeuticGapAnalysisCard .gap-list-item .gap-title {
    font-weight: 600;
    color: #000000; /* Mindstate: Pure black */
    margin-bottom: var(--spacing-xs);
}

#therapeuticGapAnalysisCard .gap-list-item .gap-description {
    font-size: 0.9rem;
    color: #3B3B3B; /* Mindstate: Dark gray for body text */
}