/* Cluster Visualization - Updated Styles to Match Screenshot */

/* Main Container */
.cluster-visualization-container {
    display: flex;
    gap: 20px;
    padding: 20px;
    background: #fafaff;
    min-height: 100vh;
}

/* Left Sidebar - Cluster Legend */
.cluster-legend-sidebar {
    width: 320px;
    flex-shrink: 0;
}

.cluster-legend-header {
    background: white;
    padding: 16px 20px;
    border-radius: 8px;
    margin-bottom: 16px;
    box-shadow: 0 1px 3px rgba(0,0,0,0.1);
}

.cluster-legend-header h5 {
    font-family: 'Libre Franklin', sans-serif;
    font-size: 14px;
    font-weight: 600;
    color: #1a1a1a;
    margin: 0;
}

/* Cluster Nodes */
.cluster-node {
    background: white;
    border-radius: 8px;
    padding: 16px;
    margin-bottom: 12px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.08);
    transition: all 0.2s ease;
    cursor: pointer;
}

.cluster-node:hover {
    box-shadow: 0 4px 12px rgba(0,0,0,0.15);
    transform: translateY(-2px);
}

.cluster-node-header {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 12px;
}

.cluster-color-indicator {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    flex-shrink: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 600;
    font-size: 14px;
    color: white;
}

.cluster-node-title {
    flex: 1;
}

.cluster-node-title h6 {
    font-family: 'Libre Franklin', sans-serif;
    font-size: 15px;
    font-weight: 600;
    margin: 0 0 4px 0;
    color: #1a1a1a;
}

.cluster-student-count {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 13px;
    color: #666;
}

.cluster-student-count i {
    font-size: 12px;
}

.cluster-student-count .count-badge {
    background: #f0f0f5;
    padding: 2px 8px;
    border-radius: 12px;
    font-weight: 600;
    color: #333;
}

/* Cluster Description */
.cluster-description {
    margin-top: 12px;
    padding-top: 12px;
    border-top: 1px solid #f0f0f5;
}

.cluster-description-label {
    font-size: 12px;
    font-weight: 600;
    color: #666;
    margin-bottom: 6px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.cluster-error-list {
    list-style: none;
    padding: 0;
    margin: 0;
}

.cluster-error-list li {
    font-size: 13px;
    color: #444;
    padding: 4px 0;
    padding-left: 16px;
    position: relative;
}

.cluster-error-list li:before {
    content: "•";
    position: absolute;
    left: 4px;
    color: #999;
}

/* Main Visualization Area */
.cluster-visualization-main {
    flex: 1;
    min-width: 0;
}

/* PCA Scatter Plot Container */
.pca-visualization-card {
    background: gray;
    border-radius: 8px;
    padding: 24px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.08);
    margin-bottom: 20px;
}

.pca-visualization-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
}

.pca-visualization-header h5 {
    font-family: 'Libre Franklin', sans-serif;
    font-size: 16px;
    font-weight: 600;
    color: #1a1a1a;
    margin: 0;
}

#pca-visualization {
    position: relative;
    width: 100%;
    min-height: 500px;
}

/* Right Sidebar - Filters */
.filters-sidebar {
    width: 280px;
    flex-shrink: 0;
}

.filters-card {
    background: gray;
    border-radius: 8px;
    padding: 20px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.08);
}

.filters-header {
    font-family: 'Libre Franklin', sans-serif;
    font-size: 15px;
    font-weight: 600;
    color: #1a1a1a;
    margin-bottom: 16px;
}

.filter-group {
    margin-bottom: 16px;
}

.filter-label {
    font-size: 13px;
    font-weight: 500;
    color: #666;
    margin-bottom: 8px;
    display: block;
}

.filter-control {
    width: 100%;
}

/* Cluster Details Section */
.cluster-details-expanded {
    background: gray;
    border-radius: 8px;
    padding: 24px;
    margin-top: 20px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.08);
}

.cluster-details-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
    padding-bottom: 16px;
    border-bottom: 2px solid #f0f0f5;
}

.cluster-details-title {
    display: flex;
    align-items: center;
    gap: 12px;
}

.cluster-details-title h6 {
    font-family: 'Libre Franklin', sans-serif;
    font-size: 16px;
    font-weight: 600;
    color: #1a1a1a;
    margin: 0;
}

.collapse-toggle {
    background: none;
    border: none;
    padding: 8px;
    cursor: pointer;
    color: #0a309d;
    font-size: 18px;
    transition: transform 0.2s;
}

.collapse-toggle.expanded {
    transform: rotate(180deg);
}

/* Cognitive Analysis Section */
.cognitive-analysis-section {
    background: gray;
    border-radius: 6px;
    padding: 20px;
    margin-top: 16px;
}

.cognitive-analysis-header {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 16px;
}

.cognitive-analysis-icon {
    width: 32px;
    height: 32px;
    background: #0a309d;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 14px;
}

.cognitive-analysis-title {
    font-family: 'Libre Franklin', sans-serif;
    font-size: 15px;
    font-weight: 600;
    color: #1a1a1a;
    margin: 0;
}

.analysis-content {
    background: gray;
    border-radius: 6px;
    padding: 16px;
    margin-top: 12px;
}

.analysis-summary {
    font-size: 14px;
    line-height: 1.6;
    color: #444;
    margin-bottom: 16px;
}

.analysis-details {
    margin-top: 16px;
}

.analysis-section {
    margin-bottom: 20px;
}

.analysis-section-title {
    font-size: 13px;
    font-weight: 600;
    color: #0a309d;
    margin-bottom: 10px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.analysis-section-content {
    font-size: 13px;
    line-height: 1.6;
    color: #555;
}

/* Buttons */
.btn-primary-custom {
    background: #0a309d;
    color: white;
    border: none;
    padding: 10px 20px;
    border-radius: 6px;
    font-family: 'Libre Franklin', sans-serif;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s;
}

.btn-primary-custom:hover {
    background: #082470;
    transform: translateY(-1px);
    box-shadow: 0 4px 8px rgba(10,48,157,0.2);
}

.btn-outline-custom {
    background: gray;
    color: #0a309d;
    border: 1px solid #0a309d;
    padding: 10px 20px;
    border-radius: 6px;
    font-family: 'Libre Franklin', sans-serif;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s;
}

.btn-outline-custom:hover {
    background: #f0f4ff;
}

/* Update action buttons */
.cluster-actions {
    display: flex;
    gap: 8px;
    margin-top: 12px;
    padding-top: 12px;
    border-top: 1px solid #f0f0f5;
}

.btn-sm-custom {
    padding: 6px 12px;
    font-size: 12px;
    border-radius: 4px;
}

/* Workflow Steps */
.workflow-step {
    background: gray;
    border-radius: 6px;
    padding: 20px;
    margin-bottom: 16px;
    border-left: 4px solid #0a309d;
}

.workflow-step-header {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 12px;
}

.step-number {
    width: 32px;
    height: 32px;
    background: #0a309d;
    color: white;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 600;
    font-size: 14px;
}

.step-title {
    font-family: 'Libre Franklin', sans-serif;
    font-size: 15px;
    font-weight: 600;
    color: #1a1a1a;
    margin: 0;
}

.step-description {
    font-size: 13px;
    color: #666;
    margin-top: 8px;
    line-height: 1.5;
}

/* Responsive Design */
@media (max-width: 1400px) {
    .cluster-visualization-container {
        flex-direction: column;
    }
    
    .cluster-legend-sidebar,
    .filters-sidebar {
        width: 100%;
    }
}

/* Cluster Colors - Updated palette matching screenshot */
.cluster-color-0 { background: #8B5CF6; }
.cluster-color-1 { background: #E879F9; }
.cluster-color-2 { background: #60A5FA; }
.cluster-color-3 { background: #34D399; }
.cluster-color-4 { background: #FBBF24; }
.cluster-color-5 { background: #F87171; }
.cluster-color-6 { background: #A78BFA; }
.cluster-color-7 { background: #FB923C; }
.cluster-color-8 { background: #22D3EE; }
.cluster-color-9 { background: #F472B6; }

/* Cluster Grid Layout (Alternative to Sidebar) */
.cluster-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 16px;
    margin-top: 20px;
}