@import url('./design-tokens.css');
/**
 * session-history.css
 * Styles for Session History components
 */

/* ============================================================================
   HISTORY PANEL
   ============================================================================ */

.kc-history-panel {
    display: flex;
    flex-direction: column;
    gap: 20px;
    padding: 20px;
    max-height: 100%;
    overflow-y: auto;
}

.kc-history-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: var(--space-3);
}

.kc-history-header h3 {
    margin: 0;
    font-size: 18px;
    color: rgba(255, 255, 255, 0.95);
    flex: 1;
}

.kc-history-back {
    background: none;
    border: none;
    color: rgba(255, 255, 255, 0.7);
    font-size: 13px;
    cursor: pointer;
    padding: 8px 0;
    transition: color 0.2s ease;
}

.kc-history-back:hover {
    color: rgba(255, 255, 255, 1);
}

.kc-history-close {
    background: rgba(255, 255, 255, 0.1);
    border: none;
    color: rgba(255, 255, 255, 0.7);
    width: 32px;
    height: 32px;
    border-radius: var(--radius-md);
    cursor: pointer;
    font-size: 16px;
    transition: all 0.2s;
}

.kc-history-close:hover {
    background: rgba(255, 99, 99, 0.2);
    color: #ff6b6b;
}

/* ============================================================================
   STATS SUMMARY
   ============================================================================ */

.kc-history-stats {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: var(--space-3);
}

.kc-stat-card {
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 16px 12px;
    background: linear-gradient(135deg, rgba(255, 255, 255, 0.08) 0%, rgba(255, 255, 255, 0.03) 100%);
    border-radius: var(--radius-lg);
    border: 1px solid var(--glass-border);
    transition: transform 0.2s;
}

.kc-stat-card:hover {
    transform: translateY(-2px);
}

.kc-stat-value {
    font-size: 24px;
    font-weight: 700;
    color: rgba(255, 255, 255, 0.95);
    line-height: 1;
}

.kc-stat-label {
    font-size: 11px;
    color: rgba(255, 255, 255, 0.5);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-top: 6px;
}

.kc-stat-card.positive .kc-stat-value {
    color: var(--color-success);
}

.kc-stat-card.negative .kc-stat-value {
    color: #ef4444;
}

/* ============================================================================
   RECOMMENDATION CARD
   ============================================================================ */

.kc-recommendation-card {
    display: flex;
    align-items: center;
    gap: var(--spacing-md);
    padding: 16px;
    background: linear-gradient(135deg, rgba(99, 102, 241, 0.2) 0%, rgba(139, 92, 246, 0.1) 100%);
    border-radius: var(--radius-lg);
    border: 1px solid rgba(99, 102, 241, 0.3);
}

.kc-rec-icon {
    font-size: 32px;
    flex-shrink: 0;
}

.kc-rec-content {
    flex: 1;
}

.kc-rec-title {
    font-size: 14px;
    font-weight: 600;
    color: rgba(255, 255, 255, 0.95);
    margin-bottom: 4px;
}

.kc-rec-desc {
    font-size: 12px;
    color: rgba(255, 255, 255, 0.6);
    line-height: 1.4;
}

/* ============================================================================
   STAR OVERVIEW
   ============================================================================ */

.kc-star-overview {
    padding: 16px;
    background: rgba(255, 255, 255, 0.03);
    border-radius: var(--radius-lg);
    border: 1px solid rgba(255, 255, 255, 0.05);
}

.kc-star-overview h4 {
    font-size: 13px;
    color: rgba(255, 255, 255, 0.7);
    margin: 0 0 12px 0;
    font-weight: 500;
}

.kc-star-mini-bars {
    display: flex;
    flex-direction: column;
    gap: var(--spacing-sm);
}

.kc-star-mini-row {
    display: flex;
    align-items: center;
    gap: 10px;
}

.kc-star-mini-label {
    width: 16px;
    font-size: 14px;
    font-weight: 700;
    text-align: center;
}

.kc-star-mini-label:nth-child(1) { color: var(--color-success); }

.kc-star-mini-bar {
    flex: 1;
    height: 8px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: var(--radius-xs);
    overflow: hidden;
}

.kc-star-mini-fill {
    height: 100%;
    border-radius: var(--radius-xs);
    transition: width 0.8s ease;
}

.kc-star-mini-fill.s { background: linear-gradient(90deg, var(--color-success), #34d399); }
.kc-star-mini-fill.t { background: linear-gradient(90deg, var(--color-primary), #38bdf8); }
.kc-star-mini-fill.a { background: linear-gradient(90deg, #f59e0b, #fbbf24); }
.kc-star-mini-fill.r { background: linear-gradient(90deg, var(--color-primary), #38bdf8); }

.kc-star-mini-value {
    width: 40px;
    font-size: 12px;
    font-weight: 600;
    color: rgba(255, 255, 255, 0.8);
    text-align: right;
}

/* ============================================================================
   SESSION LIST
   ============================================================================ */

.kc-session-list h4 {
    font-size: 13px;
    color: rgba(255, 255, 255, 0.7);
    margin: 0 0 12px 0;
    font-weight: 500;
}

.kc-sessions-scroll {
    display: flex;
    flex-direction: column;
    gap: var(--spacing-sm);
    max-height: 300px;
    overflow-y: auto;
}

.kc-session-item {
    display: flex;
    align-items: center;
    gap: var(--space-3);
    padding: 12px;
    background: rgba(255, 255, 255, 0.03);
    border-radius: 10px;
    border: 1px solid rgba(255, 255, 255, 0.05);
    cursor: pointer;
    transition: all 0.2s;
}

.kc-session-item:hover {
    background: var(--glass-bg-light);
    border-color: rgba(99, 102, 241, 0.3);
    transform: translateX(4px);
}

.kc-session-icon {
    font-size: 24px;
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--glass-bg-light);
    border-radius: 10px;
}

.kc-session-info {
    flex: 1;
    min-width: 0;
}

.kc-session-title {
    font-size: 13px;
    font-weight: 600;
    color: rgba(255, 255, 255, 0.9);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.kc-session-meta {
    display: flex;
    gap: var(--space-3);
    font-size: 11px;
    color: rgba(255, 255, 255, 0.5);
    margin-top: 4px;
}

.kc-session-score {
    font-size: 16px;
    font-weight: 700;
    padding: 6px 12px;
    border-radius: var(--radius-md);
    min-width: 50px;
    text-align: center;
}

.kc-session-score.excellent {
    background: rgba(var(--color-success-rgb), 0.2);
    color: var(--color-success);
}

.kc-session-score.good {
    background: rgba(var(--color-primary-rgb), 0.2);
    color: var(--color-primary);
}

.kc-session-score.medium {
    background: rgba(245, 158, 11, 0.2);
    color: #f59e0b;
}

.kc-session-score.low {
    background: rgba(239, 68, 68, 0.2);
    color: #ef4444;
}

.kc-no-sessions {
    text-align: center;
    padding: 40px 20px;
    color: rgba(255, 255, 255, 0.5);
}

.kc-no-sessions-icon {
    font-size: 40px;
    display: block;
    margin-bottom: 12px;
}

.kc-no-sessions p {
    margin: 4px 0;
}

.kc-no-sessions-hint {
    font-size: 12px;
    opacity: 0.7;
}

/* ============================================================================
   HISTORY WIDGET (Compact for Step 1)
   ============================================================================ */

.kc-history-widget {
    padding: 16px;
    background: linear-gradient(135deg, rgba(99, 102, 241, 0.1) 0%, rgba(139, 92, 246, 0.05) 100%);
    border-radius: var(--radius-lg);
    border: 1px solid rgba(99, 102, 241, 0.2);
    margin-bottom: 20px;
}

.kc-hw-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 12px;
}

.kc-hw-title {
    font-size: 13px;
    font-weight: 600;
    color: rgba(255, 255, 255, 0.9);
}

.kc-hw-expand {
    background: none;
    border: none;
    color: rgba(99, 102, 241, 0.9);
    font-size: 12px;
    cursor: pointer;
    padding: 4px 8px;
    border-radius: var(--radius-xs);
    transition: background 0.2s;
}

.kc-hw-expand:hover {
    background: rgba(99, 102, 241, 0.1);
}

.kc-hw-stats {
    display: flex;
    gap: var(--spacing-md);
    flex-wrap: wrap;
}

.kc-hw-stat {
    font-size: 12px;
    color: rgba(255, 255, 255, 0.7);
}

.kc-hw-stat strong {
    color: rgba(255, 255, 255, 0.95);
}

.kc-hw-stat.positive strong {
    color: var(--color-success);
}

.kc-hw-stat.negative strong {
    color: #ef4444;
}

.kc-hw-weakness {
    margin-top: 10px;
    padding-top: 10px;
    border-top: 1px solid var(--glass-border);
    font-size: 12px;
    color: rgba(255, 255, 255, 0.6);
}

.kc-hw-weakness strong {
    color: #f59e0b;
}

/* ============================================================================
   TREND CHART
   ============================================================================ */

.kc-trend-chart {
    padding: 16px;
}

.kc-trend-title {
    font-size: 13px;
    color: rgba(255, 255, 255, 0.7);
    margin-bottom: 12px;
    font-weight: 500;
}

.kc-trend-bars {
    display: flex;
    align-items: flex-end;
    gap: var(--spacing-sm);
    height: 100px;
}

.kc-trend-bar-container {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: var(--spacing-xs);
}

.kc-trend-bar {
    width: 100%;
    background: linear-gradient(180deg, var(--color-secondary) 0%, var(--color-primary) 100%);
    border-radius: var(--radius-xs) 4px 0 0;
    transition: height 0.5s ease;
    min-height: 4px;
}

.kc-trend-label {
    font-size: 10px;
    color: rgba(255, 255, 255, 0.5);
}

.kc-trend-empty {
    text-align: center;
    padding: 20px;
    color: rgba(255, 255, 255, 0.4);
    font-size: 12px;
}

/* ============================================================================
   RESPONSIVE
   ============================================================================ */

@media (max-width: 600px) {
    .kc-history-stats {
        grid-template-columns: repeat(2, 1fr);
    }

    .kc-recommendation-card {
        flex-direction: column;
        text-align: center;
    }

    .kc-session-meta {
        flex-direction: column;
        gap: var(--spacing-xs);
    }
}




