/* Interactive Lessons Styles */

.lesson-card {
    background-color: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    padding: 2.5rem;
    box-shadow: var(--card-shadow);
    min-height: 400px;
    transition: opacity 0.3s ease;
}

.lesson-card.fade-out {
    opacity: 0;
}

.lesson-card.fade-in {
    opacity: 1;
}

/* Step Header */
.step-header {
    margin-bottom: 1.5rem;
}

.step-badge {
    display: inline-block;
    background-color: #0d6efd;
    color: white;
    font-size: 0.75rem;
    font-weight: 600;
    padding: 0.25rem 0.75rem;
    border-radius: 20px;
    margin-bottom: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.step-title {
    color: var(--text-primary);
    font-size: 1.5rem;
    font-weight: 600;
    letter-spacing: -0.3px;
    margin-bottom: 0.5rem;
}

/* Step Content */
.step-content {
    color: var(--text-primary);
    font-size: 1rem;
    line-height: 1.8;
}

.step-content p {
    margin-bottom: 1rem;
}

.step-content .highlight {
    color: #0d6efd;
    font-weight: 500;
}

.step-content .highlight-token {
    display: inline-block;
    background-color: rgba(13, 110, 253, 0.1);
    color: #0d6efd;
    font-weight: 600;
    padding: 0.1rem 0.4rem;
    border-radius: 4px;
    font-family: 'Courier New', monospace;
}

.step-content .highlight-tensor {
    display: inline-block;
    background-color: rgba(108, 117, 125, 0.1);
    color: var(--text-primary);
    font-weight: 500;
    padding: 0.1rem 0.4rem;
    border-radius: 4px;
    font-family: 'Courier New', monospace;
}

/* Interactive Demo Area */
.demo-area {
    background-color: var(--bg-primary);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    padding: 1.5rem;
    margin: 1.5rem 0;
}

.demo-area h5 {
    color: var(--text-primary);
    font-size: 0.9rem;
    font-weight: 600;
    margin-bottom: 1rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

/* Token Grid */
.token-grid {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    margin: 1rem 0;
}

.token-chip {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    background-color: rgba(13, 110, 253, 0.08);
    border: 1px solid rgba(13, 110, 253, 0.2);
    border-radius: 6px;
    padding: 0.4rem 0.75rem;
    font-size: 0.9rem;
    color: var(--text-primary);
    cursor: pointer;
    transition: all 0.2s ease;
}

.token-chip:hover {
    background-color: rgba(13, 110, 253, 0.15);
    border-color: #0d6efd;
    transform: translateY(-1px);
}

.token-chip .token-id {
    font-family: 'Courier New', monospace;
    font-size: 0.75rem;
    color: #0d6efd;
    font-weight: 600;
}

.token-chip .token-label {
    font-weight: 500;
}

/* Tensor Display */
.tensor-display {
    display: flex;
    flex-wrap: wrap;
    gap: 0.25rem;
    align-items: center;
    font-family: 'Courier New', monospace;
    font-size: 0.9rem;
    padding: 1rem;
    background-color: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: 6px;
    margin: 0.5rem 0;
    overflow-x: auto;
}

.tensor-value {
    padding: 0.15rem 0.4rem;
    border-radius: 3px;
    background-color: rgba(13, 110, 253, 0.06);
}

.tensor-value.highlighted {
    background-color: rgba(13, 110, 253, 0.2);
    font-weight: 600;
}

.tensor-bracket {
    color: var(--text-muted);
    font-weight: 600;
}

/* Embedding Space Visualization */
.embedding-viz {
    position: relative;
    width: 100%;
    height: 300px;
    background-color: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    overflow: hidden;
    margin: 1rem 0;
}

.embedding-viz canvas {
    width: 100%;
    height: 100%;
}

.embedding-label {
    position: absolute;
    font-size: 0.7rem;
    color: var(--text-muted);
    pointer-events: none;
}

/* Clickable Sentence */
.clickable-sentence {
    display: flex;
    flex-wrap: wrap;
    gap: 0.3rem;
    padding: 1rem;
    background-color: var(--bg-primary);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    margin: 1rem 0;
}

.word-token {
    display: inline-flex;
    align-items: center;
    gap: 0.3rem;
    padding: 0.3rem 0.6rem;
    border-radius: 4px;
    background-color: var(--bg-secondary);
    border: 1px solid var(--border-color);
    cursor: pointer;
    transition: all 0.2s ease;
    font-size: 0.95rem;
}

.word-token:hover {
    border-color: #0d6efd;
    background-color: rgba(13, 110, 253, 0.08);
}

.word-token.active {
    border-color: #0d6efd;
    background-color: rgba(13, 110, 253, 0.15);
    box-shadow: 0 0 0 2px rgba(13, 110, 253, 0.2);
}

.word-token .word {
    font-weight: 500;
    color: var(--text-primary);
}

.word-token .word-id {
    font-size: 0.65rem;
    color: var(--text-muted);
    font-family: 'Courier New', monospace;
}

/* Token Info Panel */
.token-info-panel {
    background-color: var(--bg-primary);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    padding: 1.25rem;
    margin-top: 1rem;
}

.token-info-panel h6 {
    font-size: 0.8rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: var(--text-muted);
    margin-bottom: 0.75rem;
}

.token-info-panel .info-row {
    display: flex;
    justify-content: space-between;
    padding: 0.4rem 0;
    border-bottom: 1px solid var(--border-color);
    font-size: 0.9rem;
}

.token-info-panel .info-row:last-child {
    border-bottom: none;
}

.token-info-panel .info-label {
    color: var(--text-muted);
}

.token-info-panel .info-value {
    color: var(--text-primary);
    font-weight: 500;
    font-family: 'Courier New', monospace;
}

/* Prediction Demo */
.prediction-demo {
    text-align: center;
    padding: 1.5rem;
}

.prediction-input {
    font-size: 1.1rem;
    color: var(--text-primary);
    margin-bottom: 1rem;
}

.prediction-options {
    display: flex;
    flex-wrap: wrap;
    gap: 0.75rem;
    justify-content: center;
    margin: 1.5rem 0;
}

.prediction-option {
    padding: 0.75rem 1.5rem;
    border: 2px solid var(--border-color);
    border-radius: 8px;
    background-color: var(--bg-secondary);
    cursor: pointer;
    transition: all 0.2s ease;
    font-size: 1rem;
    font-weight: 500;
    color: var(--text-primary);
}

.prediction-option:hover {
    border-color: #0d6efd;
    background-color: rgba(13, 110, 253, 0.08);
}

.prediction-option.correct {
    border-color: #198754;
    background-color: rgba(25, 135, 84, 0.1);
    color: #198754;
}

.prediction-option.wrong {
    border-color: #dc3545;
    background-color: rgba(220, 53, 69, 0.1);
    color: #dc3545;
}

.prediction-option:disabled {
    cursor: default;
    opacity: 0.7;
}

.prediction-feedback {
    margin-top: 1rem;
    padding: 1rem;
    border-radius: 8px;
    font-size: 0.95rem;
}

.prediction-feedback.correct {
    background-color: rgba(25, 135, 84, 0.1);
    border: 1px solid rgba(25, 135, 84, 0.2);
    color: #198754;
}

.prediction-feedback.wrong {
    background-color: rgba(220, 53, 69, 0.1);
    border: 1px solid rgba(220, 53, 69, 0.2);
    color: #dc3545;
}

/* Key Insight Box */
.insight-box {
    background-color: rgba(13, 110, 253, 0.06);
    border-left: 3px solid #0d6efd;
    padding: 1rem 1.25rem;
    border-radius: 0 8px 8px 0;
    margin: 1.5rem 0;
}

.insight-box .insight-icon {
    color: #0d6efd;
    font-size: 1.1rem;
    margin-right: 0.5rem;
}

.insight-box p {
    margin-bottom: 0;
    font-size: 0.95rem;
}

/* Responsive */
@media (max-width: 768px) {
    .lesson-card {
        padding: 1.5rem;
    }

    .step-title {
        font-size: 1.25rem;
    }

    .token-grid {
        gap: 0.35rem;
    }

    .token-chip {
        font-size: 0.8rem;
        padding: 0.3rem 0.5rem;
    }

    .prediction-options {
        flex-direction: column;
        align-items: stretch;
    }
}
