﻿
/* ============================================
   LANGUAGE INTELLIGENCE PANEL
   ============================================ */
.lang-intel-panel {
    margin-top: 24px;
    background: var(--surface-card);
    border: 1px solid var(--border-default);
    border-radius: var(--radius-lg);
    padding: 28px;
    animation: fadeInUp 0.5s both;
}

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

.lang-intel-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 24px;
}

.lang-intel-header h2 {
    font-size: 1.15rem;
    font-weight: 700;
    color: var(--text-primary);
    display: flex;
    align-items: center;
    gap: 10px;
}

.lang-intel-header h2 i {
    color: var(--brand);
}

.lang-intel-subhead {
    font-size: 0.9rem;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: 14px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.lang-intel-subhead i {
    color: var(--brand);
    font-size: 0.85rem;
}

/* ?? Content DNA Strip ?? */
.lang-dna-strip-wrap {
    margin-bottom: 28px;
}

.lang-dna-strip {
    display: flex;
    height: 14px;
    border-radius: 7px;
    overflow: hidden;
    gap: 2px;
    background: var(--surface-overlay);
}

.lang-dna-segment {
    min-width: 4px;
    border-radius: 7px;
    transition: transform 0.2s, filter 0.2s;
    cursor: pointer;
    position: relative;
}

.lang-dna-segment:hover {
    transform: scaleY(1.6);
    filter: brightness(1.2);
    z-index: 1;
}

.lang-dna-legend {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    margin-top: 10px;
}

.lang-dna-legend-item {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    font-size: 0.72rem;
    color: var(--text-secondary);
    font-weight: 500;
}

.lang-dna-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    flex-shrink: 0;
}

/* ?? Language Leaderboard ?? */
.lang-leaderboard {
    margin-bottom: 28px;
}

.lang-lb-list {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.lang-lb-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 14px;
    background: var(--surface-overlay);
    border-radius: var(--radius-md);
    transition: background 0.2s, transform 0.15s;
    animation: lbSlideIn 0.4s both;
}

@keyframes lbSlideIn {
    from { opacity: 0; transform: translateX(-12px); }
    to { opacity: 1; transform: translateX(0); }
}

.lang-lb-item:hover {
    background: var(--surface-card-hover);
    transform: translateX(4px);
}

.lang-lb-rank {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.75rem;
    font-weight: 700;
    color: var(--text-muted);
    background: var(--surface-base);
    flex-shrink: 0;
}

.lang-lb-rank.rank-gold {
    background: linear-gradient(135deg, #fbbf24, #f59e0b);
    color: #78350f;
}

.lang-lb-rank.rank-silver {
    background: linear-gradient(135deg, #d1d5db, #9ca3af);
    color: #1f2937;
}

.lang-lb-rank.rank-bronze {
    background: linear-gradient(135deg, #d97706, #b45309);
    color: #fff;
}

.lang-lb-info {
    flex: 1;
    min-width: 0;
}

.lang-lb-name {
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--text-primary);
}

.lang-lb-meta {
    font-size: 0.72rem;
    color: var(--text-muted);
    display: flex;
    align-items: center;
    gap: 4px;
    margin-top: 2px;
}

.lang-lb-sep {
    opacity: 0.5;
}

.lang-lb-bar-wrap {
    width: 100px;
    height: 6px;
    background: var(--surface-base);
    border-radius: 3px;
    overflow: hidden;
    flex-shrink: 0;
}

.lang-lb-bar {
    height: 100%;
    border-radius: 3px;
    transition: width 0.8s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.lang-lb-health {
    flex-shrink: 0;
}

.lang-lb-health-ring {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    background: conic-gradient(var(--health-color) calc(var(--health) * 1%), var(--surface-base) 0);
    position: relative;
}

.lang-lb-health-ring::before {
    content: '';
    position: absolute;
    inset: 4px;
    border-radius: 50%;
    background: var(--surface-overlay);
}

.lang-lb-health-ring span {
    position: relative;
    font-size: 0.65rem;
    font-weight: 700;
    color: var(--text-primary);
}

/* ?? Maturity Cards ?? */
.lang-maturity-row {
    margin-bottom: 28px;
}

.lang-maturity-cards {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
    gap: 10px;
}

.lang-maturity-card {
    padding: 14px;
    background: var(--surface-overlay);
    border-radius: var(--radius-md);
    border-left: 3px solid var(--text-muted);
    transition: transform 0.2s, box-shadow 0.2s;
}

.lang-maturity-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 16px rgba(0,0,0,.15);
}

.lang-maturity-card.maturity-established { border-left-color: #10b981; }
.lang-maturity-card.maturity-growing { border-left-color: #06b6d4; }
.lang-maturity-card.maturity-new { border-left-color: #f59e0b; }
.lang-maturity-card.maturity-fresh { border-left-color: #ef4444; }

.lang-maturity-name {
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--text-primary);
    display: flex;
    align-items: center;
    gap: 6px;
    margin-bottom: 10px;
}

.lang-maturity-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    flex-shrink: 0;
}

.lang-maturity-stats {
    display: flex;
    gap: 16px;
    margin-bottom: 8px;
}

.lang-maturity-stat {
    display: flex;
    flex-direction: column;
}

.lang-maturity-stat-val {
    font-size: 1.1rem;
    font-weight: 700;
    color: var(--text-primary);
    line-height: 1.2;
}

.lang-maturity-stat-lbl {
    font-size: 0.65rem;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.lang-maturity-badge {
    display: inline-block;
    padding: 2px 10px;
    border-radius: 100px;
    font-size: 0.65rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.maturity-established .lang-maturity-badge {
    background: rgba(16, 185, 129, 0.12);
    color: #10b981;
}
.maturity-growing .lang-maturity-badge {
    background: rgba(6, 182, 212, 0.12);
    color: #06b6d4;
}
.maturity-new .lang-maturity-badge {
    background: rgba(245, 158, 11, 0.12);
    color: #f59e0b;
}
.maturity-fresh .lang-maturity-badge {
    background: rgba(239, 68, 68, 0.12);
    color: #ef4444;
}

/* ?? Orbit Canvas ?? */
.lang-orbit-section {
    margin-top: 4px;
}

.lang-orbit-canvas-wrap {
    height: 300px;
    border-radius: var(--radius-md);
    overflow: hidden;
    background: var(--surface-overlay);
}

.lang-orbit-canvas-wrap canvas {
    width: 100%;
    height: 100%;
}

/* ?? Light Theme Overrides ?? */
[data-theme="light"] .lang-intel-panel {
    background: var(--surface-card);
    border-color: var(--border-default);
}

[data-theme="light"] .lang-lb-item {
    background: var(--surface-overlay);
}

[data-theme="light"] .lang-lb-item:hover {
    background: #f1f5f9;
}

[data-theme="light"] .lang-maturity-card {
    background: var(--surface-overlay);
}

[data-theme="light"] .lang-orbit-canvas-wrap {
    background: #f8fafc;
}

/* ?? Responsive ?? */
@media (max-width: 768px) {
    .lang-intel-panel { padding: 18px; }
    .lang-lb-bar-wrap { width: 60px; }
    .lang-maturity-cards { grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); }
    .lang-orbit-canvas-wrap { height: 220px; }
    .lang-lb-health-ring { width: 30px; height: 30px; }
    .lang-lb-health-ring span { font-size: 0.58rem; }
}
