/* Unified Sidebar Mode Styles */
.sidebar-mode-tabs {
    display: flex;
    gap: 4px;
    margin-bottom: 20px;
    padding: 4px;
    background: #f1f5f9;
    border-radius: 12px;
}

.sidebar-mode-tab {
    flex: 1;
    border: none;
    background: transparent;
    color: #64748b;
    padding: 12px 16px;
    border-radius: 8px;
    font-size: 0.95rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
}

.sidebar-mode-tab.active {
    background: #ffffff;
    color: #0f172a;
    box-shadow: 0 2px 4px rgba(15, 23, 42, 0.1);
}

.sidebar-mode-tab:hover:not(.active) {
    color: #475569;
    background: rgba(255, 255, 255, 0.5);
}

.sidebar-mode-content {
    display: flex;
    flex-direction: column;
    gap: 20px;
    margin-top: 0.8rem;
}

/* Analysis Mode Styles */
.analysis-placeholder {
    padding: 40px 20px;
    text-align: center;
    color: #64748b;
    font-style: italic;
}

.analysis-content {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.analysis-section-title {
   text-decoration: underline;
   text-underline-offset: 4px;
   text-decoration-thickness: 2px;
   text-decoration-style: dotted;
   text-decoration-color: #5782df;
   font-size: 1rem;
   margin: 0 0 12px;
   font-weight: 800;
   text-transform: uppercase;
   letter-spacing: 0.04em;
   color: #1e293b;
   display: flex;
   align-items: center;
   gap: 8px;
}

.stats-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 12px;
    margin-bottom: 16px;
}

.stat-card {
    background: #ffffff;
    border: 1px solid rgba(15, 23, 42, 0.08);
    border-radius: 12px;
    padding: 12px;
    box-shadow: 0 1px 2px rgba(80, 84, 95, 0.04);
}

.stat-value {
    font-size: 1.1rem !important;
    font-weight: 600;
    margin-bottom: 4px;
    color: #0f172a;
}

.stat-card div:last-child {
    font-size: 0.85rem;
    color: #64748b;
}

.analysis-section {
    border-bottom: 1px solid #e2e8f0;
    padding-bottom: 20px;
}


.search-input {
    margin: 0;
    width: 100%;
    padding: 10px 12px;
    border: 1px solid #cbd5e1;
    border-radius: 10px;
    font-size: 0.95rem;
    margin-bottom: 6px;
}

.search-hint {
    font-size: 0.8rem;
    color: #64748b;
}

.list {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.list-item {
    background: #ffffff;
    border: 1px solid rgba(15, 23, 42, 0.08);
    border-radius: 10px;
    padding: 10px 12px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 0.9rem;
    box-shadow: 0 1px 2px rgba(15, 23, 42, 0.03);
}

.list-item strong {
    font-weight: 600;
}

.cluster-item,
.entity-item,
.relation-item {
    text-align: left;
    cursor: pointer;
    transition: background 0.2s ease, transform 0.2s ease;
}

.cluster-item:hover,
.entity-item:hover,
.relation-item:hover {
    background: #e2e8f0;
}

.cluster-item.active,
.entity-item.active,
.relation-item.active {
    transform: translateX(4px);
    background: #e2e8f0;
}

.cluster-item .meta,
.entity-item .meta,
.relation-item .meta {
    font-size: 0.8rem;
    color: #475569;
}

.selection-card {
    background: #ffffff;
    border: 1px solid rgba(15, 23, 42, 0.08);
    border-radius: 10px;
    padding: 12px;
    font-size: 0.9rem;
    box-shadow: 0 1px 2px rgba(15, 23, 42, 0.03);
}

.selection-card h3 {
    margin: 0 0 8px;
    font-size: 1rem;
}

.selection-card ul {
    list-style: none;
    padding-left: 0;
    margin: 0;
}

.selection-card li {
    margin-bottom: 4px;
    color: #475569;
}


.sidebar {
    background: #f7f6f6
}

.pill {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 2px 10px;
    border-radius: 999px;
    background: #e2e8f0;
    font-size: 0.75rem;
    color: #0f172a;
}

.legend-swatch {
    width: 8px;
    height: 8px;
    border-radius: 999px;
    border: 1px solid rgba(15, 23, 42, 0.25);
}

.sidebar-toggle {
    position: absolute;
    top: 50%;
    left: 432px;
    transform: translateY(-50%);
    background: #ffffff;
    border: 1px solid #e2e8f0;
    border-radius: 50%;
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    font-size: 18px;
    font-weight: bold;
    color: #475569;
    box-shadow: 0 4px 12px rgba(15, 23, 42, 0.1);
    transition: all 0.3s ease;
    z-index: 1000;
}

.sidebar-toggle:hover {
    background: #f8fafc;
    transform: translateY(-50%) scale(1.1);
    box-shadow: 0 6px 16px rgba(15, 23, 42, 0.15);
}

.sidebar-header {
  padding: 8px 0;
   position: sticky;
   top: 0;
   z-index: 1000;
   background: #f7f6f6;
}

.sidebar-header h1 {
    margin: 0;
}

.entity-item-degree {
    font-size: 0.8rem;
    border: 1px dashed #5782df;
    border-radius: 999px;
    padding: 2px 8px;
    font-weight: 600;
}

.cluster-item-title {
    font-size: 0.9rem;
    font-weight: 600;
    margin: 0;
}

@media (max-width: 768px) {
    .sidebar-header h1 {
        font-size: 1.2rem;
    }
    .sidebar-header {
      position: static;
    }
}