/* ── Ask Ekho Body Layout (flex row: main + side panel) ── */

.ask-ekho-body {
    display: flex;
    flex-direction: row;
    flex: 1;
    overflow: hidden;
    min-height: 0;
}

.ask-ekho-main {
    flex: 1;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    min-width: 0;
}

/* ── Right-Side Visual Panel ── */

.ekho-side-panel {
    width: 380px;
    flex-shrink: 0;
    border-left: 1px solid #1f1f2a;
    background: rgba(10, 10, 15, 0.98);
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.ekho-side-panel.hidden {
    display: none;
}

.ekho-side-panel-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 10px 14px;
    background: rgba(18, 18, 26, 0.95);
    border-bottom: 1px solid #1f1f2a;
    font-size: 11px;
    font-weight: 700;
    color: #71717a;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    flex-shrink: 0;
}

.ekho-voice-visual-close {
    background: none;
    border: none;
    color: #71717a;
    cursor: pointer;
    font-size: 16px;
    line-height: 1;
    padding: 0 2px;
}

.ekho-voice-visual-close:hover {
    color: #f4f4f5;
}

.ekho-side-panel-content {
    flex: 1;
    overflow-y: auto;
    padding: 12px;
}

.ekho-side-panel-content::-webkit-scrollbar {
    width: 4px;
}

.ekho-side-panel-content::-webkit-scrollbar-thumb {
    background: #1f1f2a;
    border-radius: 2px;
}

.ekho-side-panel-content .ekho-rich-block {
    margin-top: 0;
}

.ekho-side-panel-content .ekho-rich-block + .ekho-rich-block {
    margin-top: 12px;
}

/* ── Rich Content Blocks in Ekho Chat ── */

#askEkhoGeneralModal .feedback-message.has-rich-content {
    max-width: 95%;
    padding: 10px 14px 6px 14px;
}

.ekho-text-content {
    white-space: pre-wrap;
    margin-bottom: 8px;
}

.ekho-rich-block {
    background: rgba(18, 18, 26, 0.7);
    border: 1px solid #1f1f2a;
    border-radius: 10px;
    padding: 10px 12px;
    margin-top: 8px;
    font-size: 12px;
    white-space: normal;
}

.ekho-widget-header {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 12px;
    font-weight: 700;
    color: #f4f4f5;
    margin-bottom: 8px;
    padding-bottom: 6px;
    border-bottom: 1px solid rgba(255,255,255,0.06);
}

.ekho-widget-header svg {
    flex-shrink: 0;
}

/* Inline Skills Bar Chart */
.ekho-skills-chart .ekho-skill-row {
    display: flex;
    align-items: center;
    gap: 6px;
    margin-bottom: 4px;
}

.ekho-skill-label {
    width: 80px;
    font-size: 10px;
    color: #a1a1aa;
    text-align: right;
    flex-shrink: 0;
}

.ekho-skill-bar-bg {
    flex: 1;
    height: 14px;
    background: rgba(255,255,255,0.05);
    border-radius: 7px;
    overflow: hidden;
}

.ekho-skill-bar-fill {
    height: 100%;
    min-height: 14px;
    border-radius: 7px;
    transition: width 0.6s ease;
    display: block;
    background: linear-gradient(90deg, #f97316, #fb923c);
}

.ekho-skill-bar-fill.excellent { background: linear-gradient(90deg, #22c55e, #4ade80); }
.ekho-skill-bar-fill.good { background: linear-gradient(90deg, #00d4ff, #38bdf8); }
.ekho-skill-bar-fill.average { background: linear-gradient(90deg, #fbbf24, #fcd34d); }
.ekho-skill-bar-fill.needs-work { background: linear-gradient(90deg, #f97316, #fb923c); }
.ekho-skill-bar-fill.poor { background: linear-gradient(90deg, #ef4444, #f87171); }

.ekho-skill-value {
    width: 32px;
    font-size: 10px;
    color: #d4d4d8;
    font-weight: 600;
    text-align: right;
    flex-shrink: 0;
}

/* Inline Line Chart */
.ekho-line-chart .ekho-line-canvas {
    width: 100%;
    height: 160px;
    border-radius: 6px;
}

.ekho-chart-legend {
    display: flex;
    flex-wrap: wrap;
    gap: 6px 10px;
    margin-top: 6px;
}

.ekho-legend-item {
    display: flex;
    align-items: center;
    gap: 3px;
    font-size: 9px;
    color: #a1a1aa;
}

.ekho-legend-dot {
    width: 6px;
    height: 6px;
    border-radius: 50%;
    display: inline-block;
    flex-shrink: 0;
}

/* Inline Video Player */
.ekho-video-embed .ekho-video-iframe-wrap {
    position: relative;
    width: 100%;
    padding-bottom: 56.25%;
    border-radius: 8px;
    overflow: hidden;
    background: #000;
}

.ekho-video-embed .ekho-video-iframe-wrap iframe {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    border: none;
}

.ekho-video-actions {
    display: flex;
    justify-content: flex-end;
    margin-top: 6px;
}

.ekho-video-popout-btn {
    display: flex;
    align-items: center;
    gap: 4px;
    padding: 4px 10px;
    font-size: 10px;
    font-weight: 600;
    color: #a1a1aa;
    background: rgba(255,255,255,0.05);
    border: 1px solid rgba(255,255,255,0.1);
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.2s;
}

.ekho-video-popout-btn:hover {
    color: #f4f4f5;
    background: rgba(255,255,255,0.1);
}

.ekho-video-thumbnail {
    position: relative;
    border-radius: 8px;
    overflow: hidden;
    cursor: pointer;
}

.ekho-video-thumbnail img {
    width: 100%;
    display: block;
}

.ekho-video-play-overlay {
    position: absolute;
    top: 0; left: 0; right: 0; bottom: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(0,0,0,0.4);
}

.ekho-video-placeholder {
    padding: 16px;
    text-align: center;
    color: #71717a;
}

/* Gamification Widget */
.ekho-gamification .ekho-level-card {
    text-align: center;
    padding: 6px 0;
}

.ekho-level-badge {
    display: inline-block;
    padding: 2px 10px;
    border-radius: 12px;
    font-size: 10px;
    font-weight: 700;
    background: linear-gradient(135deg, #934e86, #243baa);
    color: white;
}

.ekho-level-name {
    font-size: 16px;
    font-weight: 800;
    color: #f4f4f5;
    margin: 4px 0;
}

.ekho-xp-display {
    font-size: 20px;
    font-weight: 800;
    color: #00d4ff;
    margin: 2px 0;
}

.ekho-level-progress-bar {
    height: 8px;
    background: rgba(255,255,255,0.08);
    border-radius: 4px;
    overflow: hidden;
    margin: 6px 0 4px 0;
}

.ekho-level-progress-fill {
    height: 100%;
    background: linear-gradient(90deg, #934e86, #243baa);
    border-radius: 4px;
    transition: width 0.6s ease;
}

.ekho-level-progress-text {
    font-size: 10px;
    color: #71717a;
}

/* Development Areas */
.ekho-dev-areas-list {
    list-style: none;
    padding: 0;
    margin: 0;
}

.ekho-dev-areas-list li {
    padding: 5px 8px;
    font-size: 11px;
    color: #d4d4d8;
    border-left: 3px solid #f97316;
    margin-bottom: 4px;
    background: rgba(249, 115, 22, 0.06);
    border-radius: 0 6px 6px 0;
}

.ekho-empty-state {
    text-align: center;
    color: #71717a;
    font-size: 11px;
    padding: 12px;
}

/* Recent Activity */
.ekho-activity-item {
    padding: 6px 0;
    border-bottom: 1px solid rgba(255,255,255,0.04);
}

.ekho-activity-item:last-child {
    border-bottom: none;
}

.ekho-activity-title {
    font-size: 11px;
    font-weight: 600;
    color: #f4f4f5;
}

.ekho-activity-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    font-size: 10px;
    color: #71717a;
    margin-top: 2px;
}

.ekho-activity-score {
    color: #00d4ff;
    font-weight: 600;
}

/* Leaderboard */
.ekho-leaderboard-list {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.ekho-leaderboard-item {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 5px 8px;
    border-radius: 6px;
    font-size: 11px;
}

.ekho-leaderboard-item.gold { background: rgba(251, 191, 36, 0.08); }
.ekho-leaderboard-item.silver { background: rgba(168, 162, 158, 0.08); }
.ekho-leaderboard-item.bronze { background: rgba(249, 115, 22, 0.06); }

.ekho-lb-rank {
    width: 18px;
    height: 18px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    font-size: 9px;
    font-weight: 700;
    background: rgba(255,255,255,0.08);
    color: #a1a1aa;
    flex-shrink: 0;
}

.gold .ekho-lb-rank { background: rgba(251, 191, 36, 0.2); color: #fbbf24; }
.silver .ekho-lb-rank { background: rgba(168, 162, 158, 0.2); color: #a8a29e; }
.bronze .ekho-lb-rank { background: rgba(249, 115, 22, 0.15); color: #f97316; }

.ekho-lb-name {
    flex: 1;
    color: #d4d4d8;
    font-weight: 500;
}

.ekho-lb-points {
    color: #00d4ff;
    font-weight: 600;
    font-size: 10px;
}

.ekho-leaderboard-loading {
    text-align: center;
    color: #71717a;
    font-size: 11px;
    padding: 12px;
}

/* Suggested Videos */
.ekho-suggested-video-item {
    display: flex;
    gap: 8px;
    padding: 6px 0;
    cursor: pointer;
    border-bottom: 1px solid rgba(255,255,255,0.04);
    transition: background 0.15s;
}

.ekho-suggested-video-item:hover {
    background: rgba(255,255,255,0.03);
}

.ekho-suggested-video-item:last-child {
    border-bottom: none;
}

.ekho-sv-thumb {
    width: 64px;
    height: 42px;
    border-radius: 4px;
    overflow: hidden;
    background: #1f1f2a;
    flex-shrink: 0;
}

.ekho-sv-thumb img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.ekho-sv-thumb-placeholder {
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
}

.ekho-sv-info {
    flex: 1;
    min-width: 0;
}

.ekho-sv-title {
    font-size: 11px;
    font-weight: 600;
    color: #f4f4f5;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.ekho-sv-duration {
    font-size: 9px;
    color: #71717a;
}

.ekho-sv-badges {
    display: flex;
    flex-wrap: wrap;
    gap: 3px;
    margin-top: 2px;
}

.ekho-video-badge {
    display: inline-block;
    padding: 1px 6px;
    border-radius: 8px;
    font-size: 8px;
    font-weight: 600;
    background: rgba(147, 78, 134, 0.15);
    color: #c084fc;
}

@media (max-width: 600px) {
    #askEkhoGeneralModal .feedback-modal {
        max-width: 100%;
        max-height: 95vh;
    }
    #askEkhoGeneralModal .feedback-modal.has-side-panel {
        max-width: 100%;
    }
    #askEkhoGeneralModal .ask-ekho-body {
        flex-direction: column;
    }
    #askEkhoGeneralModal .ekho-side-panel {
        width: 100%;
        border-left: none;
        border-top: 1px solid #1f1f2a;
        max-height: 45vh;
    }
    #askEkhoGeneralModal .ask-ekho-main {
        flex: 1;
        min-height: 200px;
    }
    #askEkhoGeneralModal .feedback-mode-toggle {
        margin: 8px 12px;
    }
    #askEkhoGeneralModal .feedback-messages {
        padding: 12px;
    }
    #askEkhoGeneralModal .feedback-input-area {
        padding: 8px 12px 12px 12px;
    }
    .ekho-skill-label {
        width: 60px;
        font-size: 9px;
    }
    .ekho-line-chart .ekho-line-canvas {
        height: 130px;
    }
}

/* Voice Feedback Call Styles */
.feedback-mode-toggle {
    display: flex;
    gap: 8px;
    padding: 12px 24px;
    background: var(--bg-card);
    border-bottom: 1px solid var(--border);
}

.feedback-mode-btn {
    flex: 1;
    padding: 10px 16px;
    font-size: 13px;
    font-weight: 500;
    border: 1px solid var(--border);
    border-radius: 8px;
    background: transparent;
    color: var(--text-secondary);
    cursor: pointer;
    transition: all 0.2s;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
}

.feedback-mode-btn:hover {
    background: var(--bg-elevated);
    color: var(--text-primary);
}

.feedback-mode-btn.active {
    background: var(--accent);
    color: white;
    border-color: transparent;
}

.feedback-voice-container {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 24px;
    gap: 16px;
    overflow-y: auto;
}

.voice-call-status {
    font-size: 16px;
    color: var(--text-secondary);
    text-align: center;
}

.voice-call-status.connecting {
    color: var(--warning);
}

.voice-call-status.active {
    color: var(--success);
}

.voice-call-avatar {
    width: 120px;
    height: 120px;
    border-radius: 50%;
    background: var(--accent);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 48px;
    position: relative;
}

.voice-call-avatar.speaking::after {
    content: '';
    position: absolute;
    inset: -8px;
    border-radius: 50%;
    border: 3px solid var(--success);
    animation: pulse-ring 1.5s ease-out infinite;
}

@keyframes pulse-ring {
    0% {
        transform: scale(1);
        opacity: 1;
    }
    100% {
        transform: scale(1.2);
        opacity: 0;
    }
}

.voice-call-name {
    font-size: 20px;
    font-weight: 600;
    color: var(--text-primary);
}

.voice-call-timer {
    font-size: 14px;
    color: var(--text-muted);
    font-family: 'JetBrains Mono', monospace;
}

.voice-call-controls {
    display: flex;
    gap: 16px;
    margin-top: 16px;
}

.voice-control-btn {
    width: 56px;
    height: 56px;
    border-radius: 50%;
    border: none;
    cursor: pointer;
    font-size: 24px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s;
}

.voice-control-btn.start-call {
    background: linear-gradient(135deg, #243baa, #1a2d80);
    color: white;
}

.voice-control-btn.start-call:hover {
    transform: scale(1.05);
    box-shadow: 0 4px 20px rgba(36, 59, 170, 0.4);
}

.voice-control-btn.end-call {
    background: linear-gradient(135deg, var(--danger), #dc2626);
    color: white;
}

.voice-control-btn.end-call:hover {
    transform: scale(1.05);
    box-shadow: 0 4px 20px rgba(239, 68, 68, 0.3);
}

.voice-control-btn.mute {
    background: var(--bg-elevated);
    color: var(--text-primary);
    border: 1px solid var(--border);
}

.voice-control-btn.mute:hover {
    background: var(--bg-card);
}

.voice-control-btn.mute.muted {
    background: var(--warning);
    color: white;
    border-color: transparent;
}

.voice-control-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    transform: none !important;
}

.voice-call-hint {
    font-size: 13px;
    color: var(--text-muted);
    text-align: center;
    max-width: 300px;
}

.voice-transcript-area {
    width: 100%;
    flex: 1;
    min-height: 120px;
    max-height: 300px;
    overflow-y: auto;
    padding: 16px;
    background: var(--bg-elevated);
    border: 1px solid var(--border);
    border-radius: 12px;
    margin-top: 12px;
    -webkit-overflow-scrolling: touch;
}

.voice-transcript-text {
    font-size: 14px;
    color: var(--text-secondary);
    line-height: 1.6;
}

.voice-transcript-text p {
    margin-bottom: 12px;
    padding: 10px 14px;
    background: var(--bg-card);
    border-radius: 10px;
}

.voice-transcript-text p:last-child {
    margin-bottom: 0;
}

.voice-transcript-text .speaker-you,
.voice-transcript-text strong:first-child {
    color: var(--accent);
    font-weight: 600;
    display: block;
    margin-bottom: 4px;
    font-size: 12px;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.voice-transcript-text .speaker-coach {
    color: var(--success);
    font-weight: 600;
    display: block;
    margin-bottom: 4px;
    font-size: 12px;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

/* Processing/thinking animation */
.voice-call-avatar.thinking::after {
    content: '';
    position: absolute;
    inset: -8px;
    border-radius: 50%;
    border: 3px solid var(--warning);
    border-top-color: transparent;
    animation: thinking-spin 1s linear infinite;
}

@keyframes thinking-spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* Listening indicator */
.voice-call-avatar.listening::before {
    content: '';
    position: absolute;
    bottom: -4px;
    left: 50%;
    transform: translateX(-50%);
    width: 12px;
    height: 12px;
    background: var(--success);
    border-radius: 50%;
    animation: listening-pulse 1.5s ease-in-out infinite;
}

@keyframes listening-pulse {
    0%, 100% { opacity: 1; transform: translateX(-50%) scale(1); }
    50% { opacity: 0.5; transform: translateX(-50%) scale(1.3); }
}

.voice-status-prompt {
    font-size: 14px;
    font-weight: 500;
    padding: 8px 16px;
    border-radius: 20px;
    margin-top: 8px;
}

.voice-status-prompt.speak-now {
    background: var(--success-glow);
    color: var(--success);
    border: 1px solid var(--success);
}

.voice-status-prompt.ai-speaking {
    background: rgba(245, 158, 11, 0.15);
    color: var(--warning);
    border: 1px solid var(--warning);
}

.voice-status-prompt.processing {
    background: rgba(99, 102, 241, 0.15);
    color: var(--accent);
    border: 1px solid var(--accent);
}

@media (max-width: 600px) {
    .feedback-mode-toggle {
        padding: 10px 16px;
    }

    .feedback-mode-btn {
        padding: 8px 12px;
        font-size: 12px;
    }

    .voice-call-avatar {
        width: 100px;
        height: 100px;
        font-size: 40px;
    }

    .voice-control-btn {
        width: 48px;
        height: 48px;
        font-size: 20px;
    }
}

