/**
 * Coding Playground Styles
 * Interactive coding environment with challenges and gamification
 * Created for Michael John Peña's Interactive Portfolio
 */

/* Playground Container */
.vscode-coding-playground {
    height: 100%;
    display: flex;
    flex-direction: column;
    background: var(--vscode-bg-primary);
    overflow: hidden;
}

/* Playground Header */
.vscode-playground-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px 16px;
    background: var(--vscode-bg-secondary);
    border-bottom: 1px solid var(--vscode-border);
}

.vscode-playground-title {
    display: flex;
    align-items: center;
    gap: 12px;
    font-size: 14px;
    font-weight: 600;
    color: var(--vscode-text-primary);
}

.vscode-playground-title i {
    color: var(--vscode-accent-green);
    font-size: 16px;
}

/* Progress Indicator */
.vscode-progress-indicator {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 11px;
    color: var(--vscode-text-muted);
}

.vscode-progress-bar {
    width: 120px;
    height: 4px;
    background: var(--vscode-bg-tertiary);
    border-radius: 2px;
    overflow: hidden;
}

.vscode-progress-fill {
    height: 100%;
    background: var(--vscode-accent-green);
    border-radius: 2px;
    transition: width 0.3s ease;
}

/* Playground Controls */
.vscode-playground-controls {
    display: flex;
    align-items: center;
    gap: 8px;
}

.vscode-difficulty-select {
    background: var(--vscode-bg-primary);
    color: var(--vscode-text-primary);
    border: 1px solid var(--vscode-border);
    padding: 4px 8px;
    border-radius: 3px;
    font-size: 12px;
}

.vscode-new-challenge-btn {
    display: flex;
    align-items: center;
    gap: 4px;
    padding: 6px 12px;
    background: var(--vscode-accent-blue);
    color: white;
    border: none;
    border-radius: 3px;
    font-size: 12px;
    cursor: pointer;
    transition: background 0.1s ease;
}

.vscode-new-challenge-btn:hover {
    background: var(--vscode-accent-blue-hover);
}

/* Playground Content */
.vscode-playground-content {
    flex: 1;
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0;
    min-height: 0;
}

/* Challenge Panel */
.vscode-challenge-panel {
    background: var(--vscode-bg-primary);
    border-right: 1px solid var(--vscode-border);
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.vscode-challenge-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    padding: 16px;
    background: var(--vscode-bg-secondary);
    border-bottom: 1px solid var(--vscode-border);
}

.vscode-challenge-info h3 {
    margin: 0 0 8px 0;
    font-size: 16px;
    color: var(--vscode-text-primary);
}

.vscode-challenge-meta {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
}

.vscode-difficulty-badge,
.vscode-points-badge,
.vscode-language-badge {
    padding: 2px 6px;
    border-radius: 10px;
    font-size: 10px;
    font-weight: 600;
    text-transform: uppercase;
}

.vscode-difficulty-badge {
    background: var(--vscode-accent-blue);
    color: white;
}

.vscode-points-badge {
    background: var(--vscode-accent-yellow);
    color: var(--vscode-bg-primary);
}

.vscode-language-badge {
    background: var(--vscode-accent-green);
    color: white;
}

.vscode-challenge-actions {
    display: flex;
    gap: 4px;
}

.vscode-hint-btn,
.vscode-solution-btn {
    display: flex;
    align-items: center;
    gap: 4px;
    padding: 6px 10px;
    background: var(--vscode-bg-primary);
    border: 1px solid var(--vscode-border);
    color: var(--vscode-text-secondary);
    border-radius: 3px;
    font-size: 11px;
    cursor: pointer;
    transition: all 0.1s ease;
}

.vscode-hint-btn:hover:not(:disabled),
.vscode-solution-btn:hover:not(:disabled) {
    background: var(--vscode-bg-hover);
    color: var(--vscode-text-primary);
    border-color: var(--vscode-accent-blue);
}

.vscode-hint-btn:disabled,
.vscode-solution-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

/* Challenge Description */
.vscode-challenge-description {
    padding: 16px;
    color: var(--vscode-text-primary);
    line-height: 1.5;
    font-size: 14px;
    flex: 1;
    overflow-y: auto;
}

/* Hints Panel */
.vscode-hints-panel {
    background: var(--vscode-bg-secondary);
    border-top: 1px solid var(--vscode-border);
    max-height: 200px;
    overflow-y: auto;
}

.vscode-hints-header {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 8px 16px;
    background: var(--vscode-bg-tertiary);
    font-size: 12px;
    font-weight: 600;
    color: var(--vscode-accent-yellow);
}

.vscode-hints-content {
    padding: 12px 16px;
}

.vscode-hint-item {
    display: flex;
    gap: 8px;
    margin-bottom: 8px;
}

.vscode-hint-number {
    background: var(--vscode-accent-blue);
    color: white;
    width: 20px;
    height: 20px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 10px;
    font-weight: 600;
    flex-shrink: 0;
}

.vscode-hint-text {
    font-size: 12px;
    color: var(--vscode-text-secondary);
    line-height: 1.4;
}

/* Code Panel */
.vscode-code-panel {
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

/* Code Editor Header */
.vscode-code-editor-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: var(--vscode-bg-secondary);
    border-bottom: 1px solid var(--vscode-border);
}

.vscode-editor-tabs {
    display: flex;
}

.vscode-editor-tab {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 8px 16px;
    background: var(--vscode-bg-primary);
    border-right: 1px solid var(--vscode-border);
    font-size: 13px;
    color: var(--vscode-text-primary);
}

.vscode-editor-tab.active {
    background: var(--vscode-bg-primary);
    border-bottom: 1px solid var(--vscode-bg-primary);
}

.vscode-editor-actions {
    display: flex;
    gap: 8px;
    padding: 8px 12px;
}

.vscode-run-code-btn,
.vscode-submit-btn {
    display: flex;
    align-items: center;
    gap: 4px;
    padding: 6px 12px;
    border: none;
    border-radius: 3px;
    font-size: 12px;
    cursor: pointer;
    transition: all 0.1s ease;
}

.vscode-run-code-btn {
    background: var(--vscode-accent-green);
    color: white;
}

.vscode-run-code-btn:hover:not(:disabled) {
    background: var(--vscode-accent-green-hover);
}

.vscode-submit-btn {
    background: var(--vscode-accent-blue);
    color: white;
}

.vscode-submit-btn:hover:not(:disabled) {
    background: var(--vscode-accent-blue-hover);
}

.vscode-run-code-btn:disabled,
.vscode-submit-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

/* Code Editor Area */
.vscode-code-editor-area {
    flex: 1;
    position: relative;
    overflow: hidden;
}

.vscode-code-editor-content {
    height: 100%;
    display: flex;
    background: var(--vscode-bg-primary);
}

.vscode-line-numbers {
    width: 50px;
    background: var(--vscode-bg-secondary);
    border-right: 1px solid var(--vscode-border);
    padding: 8px 4px;
    font-family: var(--vscode-font-code);
    font-size: 12px;
    color: var(--vscode-text-muted);
    overflow: hidden;
    user-select: none;
}

.vscode-line-number {
    text-align: right;
    line-height: 1.5;
    padding-right: 8px;
}

.vscode-code-textarea {
    flex: 1;
    background: var(--vscode-bg-primary);
    color: var(--vscode-text-primary);
    border: none;
    outline: none;
    padding: 8px 12px;
    font-family: var(--vscode-font-code);
    font-size: 14px;
    line-height: 1.5;
    resize: none;
    white-space: pre;
    overflow-wrap: normal;
    overflow: auto;
}

.vscode-code-textarea::placeholder {
    color: var(--vscode-text-muted);
}

/* Output Panel */
.vscode-output-panel {
    background: var(--vscode-bg-secondary);
    border-top: 1px solid var(--vscode-border);
    height: 200px;
    display: flex;
    flex-direction: column;
}

.vscode-output-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 6px 12px;
    background: var(--vscode-bg-tertiary);
    border-bottom: 1px solid var(--vscode-border);
}

.vscode-output-tabs {
    display: flex;
}

.vscode-output-tab {
    display: flex;
    align-items: center;
    gap: 4px;
    padding: 4px 8px;
    font-size: 11px;
    cursor: pointer;
    border-radius: 2px;
    color: var(--vscode-text-muted);
    transition: all 0.1s ease;
}

.vscode-output-tab:hover {
    background: var(--vscode-bg-hover);
    color: var(--vscode-text-primary);
}

.vscode-output-tab.active {
    background: var(--vscode-accent-blue);
    color: white;
}

.vscode-clear-output-btn {
    background: none;
    border: none;
    color: var(--vscode-text-muted);
    cursor: pointer;
    padding: 4px;
    border-radius: 2px;
    font-size: 11px;
    transition: all 0.1s ease;
}

.vscode-clear-output-btn:hover {
    background: var(--vscode-bg-hover);
    color: var(--vscode-text-primary);
}

.vscode-output-content {
    flex: 1;
    position: relative;
    overflow: hidden;
}

.vscode-output-pane {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    padding: 8px 12px;
    overflow-y: auto;
    display: none;
}

.vscode-output-pane.active {
    display: block;
}

/* Console Output */
.vscode-console {
    font-family: var(--vscode-font-code);
    font-size: 12px;
    line-height: 1.4;
}

.vscode-console-message {
    margin: 2px 0;
    padding: 2px 0;
}

.vscode-console-message.info {
    color: var(--vscode-accent-blue);
}

.vscode-console-message.error {
    color: var(--vscode-accent-red);
    background: rgba(220, 53, 69, 0.1);
    padding: 4px 6px;
    border-radius: 3px;
}

.vscode-console-message.output {
    color: var(--vscode-text-primary);
    white-space: pre-wrap;
}

/* Test Results */
.vscode-test-results {
    font-size: 12px;
}

.vscode-test-placeholder {
    color: var(--vscode-text-muted);
    text-align: center;
    padding: 20px;
    font-style: italic;
}

.vscode-test-running {
    color: var(--vscode-accent-blue);
    text-align: center;
    padding: 20px;
}

.vscode-test-summary {
    padding: 12px;
    margin-bottom: 8px;
    border-radius: 4px;
    background: var(--vscode-bg-primary);
    border: 1px solid var(--vscode-border);
}

.vscode-test-summary.passed {
    border-color: var(--vscode-accent-green);
    background: rgba(40, 167, 69, 0.1);
}

.vscode-test-summary.failed {
    border-color: var(--vscode-accent-orange);
    background: rgba(255, 193, 7, 0.1);
}

.vscode-test-score {
    font-weight: 600;
    font-size: 14px;
    color: var(--vscode-text-primary);
}

.vscode-test-status {
    margin-top: 4px;
    font-size: 12px;
}

.vscode-test-case {
    padding: 8px;
    margin: 4px 0;
    border-radius: 3px;
    border-left: 3px solid var(--vscode-border);
}

.vscode-test-case.passed {
    border-left-color: var(--vscode-accent-green);
    background: rgba(40, 167, 69, 0.05);
}

.vscode-test-case.failed {
    border-left-color: var(--vscode-accent-red);
    background: rgba(220, 53, 69, 0.05);
}

.vscode-test-name {
    font-weight: 500;
    margin-bottom: 2px;
}

.vscode-test-message {
    color: var(--vscode-text-muted);
    font-size: 11px;
}

/* AI Hints */
.vscode-ai-hints {
    font-size: 12px;
    max-height: 160px;
    overflow-y: auto;
}

.vscode-ai-hint-message {
    color: var(--vscode-text-muted);
    padding: 12px;
    text-align: center;
    border-bottom: 1px solid var(--vscode-border);
}

.vscode-ai-input-area {
    display: flex;
    gap: 4px;
    padding: 8px;
    background: var(--vscode-bg-tertiary);
}

.vscode-ai-input {
    flex: 1;
    background: var(--vscode-bg-primary);
    border: 1px solid var(--vscode-border);
    color: var(--vscode-text-primary);
    padding: 6px 8px;
    border-radius: 3px;
    font-size: 11px;
}

.vscode-ai-ask-btn {
    background: var(--vscode-accent-blue);
    color: white;
    border: none;
    padding: 6px 8px;
    border-radius: 3px;
    cursor: pointer;
    transition: background 0.1s ease;
}

.vscode-ai-ask-btn:hover {
    background: var(--vscode-accent-blue-hover);
}

.vscode-ai-message {
    display: flex;
    gap: 8px;
    padding: 8px;
    margin: 4px 0;
}

.vscode-ai-message.user-message {
    flex-direction: row-reverse;
}

.vscode-ai-avatar {
    width: 24px;
    height: 24px;
    background: var(--vscode-bg-primary);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--vscode-accent-blue);
    font-size: 12px;
    flex-shrink: 0;
}

.user-message .vscode-ai-avatar {
    background: var(--vscode-accent-green);
    color: white;
}

.vscode-ai-content {
    background: var(--vscode-bg-primary);
    padding: 8px 10px;
    border-radius: 8px;
    font-size: 11px;
    line-height: 1.4;
    max-width: 80%;
}

.user-message .vscode-ai-content {
    background: var(--vscode-accent-green);
    color: white;
}

.vscode-ai-code {
    background: var(--vscode-bg-secondary) !important;
    border: 1px solid var(--vscode-border);
    border-radius: 3px;
    padding: 6px;
    margin: 4px 0;
    font-size: 10px;
    overflow-x: auto;
}

.vscode-ai-inline-code {
    background: var(--vscode-bg-secondary);
    padding: 1px 3px;
    border-radius: 2px;
    font-family: var(--vscode-font-code);
    font-size: 10px;
}

/* Leaderboard Panel */
.vscode-leaderboard-panel {
    position: absolute;
    top: 60px;
    right: 20px;
    width: 250px;
    background: var(--vscode-bg-secondary);
    border: 1px solid var(--vscode-border);
    border-radius: 6px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
    z-index: 100;
}

.vscode-leaderboard-header {
    padding: 12px 16px;
    background: var(--vscode-bg-tertiary);
    border-bottom: 1px solid var(--vscode-border);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.vscode-leaderboard-header h3 {
    margin: 0;
    font-size: 14px;
}

.vscode-user-stats {
    display: flex;
    gap: 12px;
}

.vscode-stat {
    text-align: center;
}

.vscode-stat-value {
    display: block;
    font-weight: 600;
    font-size: 14px;
    color: var(--vscode-text-primary);
}

.vscode-stat-label {
    font-size: 10px;
    color: var(--vscode-text-muted);
}

.vscode-leaderboard-content {
    padding: 8px;
    max-height: 200px;
    overflow-y: auto;
}

.vscode-leaderboard-entry {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 6px 8px;
    font-size: 12px;
    border-radius: 3px;
}

.vscode-leaderboard-entry:hover {
    background: var(--vscode-bg-hover);
}

.vscode-rank {
    font-weight: 600;
    width: 20px;
    color: var(--vscode-accent-yellow);
}

.vscode-username {
    flex: 1;
}

.vscode-score {
    font-family: var(--vscode-font-code);
    color: var(--vscode-accent-green);
}

/* Completion Notification */
.vscode-completion-notification {
    position: fixed;
    top: 20px;
    right: 20px;
    background: var(--vscode-accent-green);
    color: white;
    padding: 12px 16px;
    border-radius: 6px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
    z-index: 1000;
    animation: slideInRight 0.3s ease-out;
}

@keyframes slideInRight {
    from {
        transform: translateX(100%);
        opacity: 0;
    }
    to {
        transform: translateX(0);
        opacity: 1;
    }
}

@keyframes slideOut {
    to {
        transform: translateX(100%);
        opacity: 0;
    }
}

.vscode-completion-content {
    display: flex;
    align-items: center;
    gap: 8px;
}

.vscode-completion-icon {
    font-size: 20px;
}

.vscode-completion-title {
    font-weight: 600;
    margin-bottom: 2px;
}

.vscode-completion-details {
    font-size: 12px;
    opacity: 0.9;
}

/* Responsive Design */
@media (max-width: 1200px) {
    .vscode-playground-content {
        grid-template-columns: 1fr;
        grid-template-rows: auto 1fr;
    }

    .vscode-challenge-panel {
        border-right: none;
        border-bottom: 1px solid var(--vscode-border);
        max-height: 300px;
    }
}

@media (max-width: 768px) {
    .vscode-playground-header {
        flex-direction: column;
        gap: 8px;
        padding: 8px 12px;
    }

    .vscode-progress-indicator {
        order: -1;
    }

    .vscode-challenge-header {
        flex-direction: column;
        gap: 8px;
        align-items: flex-start;
    }

    .vscode-code-editor-header {
        flex-direction: column;
        align-items: stretch;
    }

    .vscode-editor-actions {
        justify-content: center;
        border-top: 1px solid var(--vscode-border);
    }

    .vscode-output-panel {
        height: 150px;
    }

    .vscode-leaderboard-panel {
        position: relative;
        top: auto;
        right: auto;
        width: 100%;
        margin-top: 8px;
    }
}

@media (max-width: 480px) {
    .vscode-playground-controls {
        flex-direction: column;
        width: 100%;
    }

    .vscode-difficulty-select,
    .vscode-new-challenge-btn {
        width: 100%;
        justify-content: center;
    }

    .vscode-challenge-meta {
        flex-direction: column;
        gap: 4px;
    }

    .vscode-challenge-actions {
        width: 100%;
        justify-content: stretch;
    }

    .vscode-hint-btn,
    .vscode-solution-btn {
        flex: 1;
        justify-content: center;
    }

    .vscode-code-textarea {
        font-size: 12px;
    }

    .vscode-output-panel {
        height: 120px;
    }
}

/* Accessibility */
@media (prefers-reduced-motion: reduce) {
    * {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
}

/* Focus indicators */
.vscode-code-textarea:focus,
.vscode-ai-input:focus {
    box-shadow: 0 0 0 2px var(--vscode-accent-blue);
}

.vscode-run-code-btn:focus,
.vscode-submit-btn:focus,
.vscode-hint-btn:focus,
.vscode-solution-btn:focus {
    outline: 2px solid var(--vscode-accent-blue);
    outline-offset: 2px;
}

/* Scrollbar styling */
.vscode-output-pane,
.vscode-challenge-description,
.vscode-hints-panel {
    scrollbar-width: thin;
    scrollbar-color: var(--vscode-bg-tertiary) var(--vscode-bg-secondary);
}

.vscode-output-pane::-webkit-scrollbar,
.vscode-challenge-description::-webkit-scrollbar,
.vscode-hints-panel::-webkit-scrollbar {
    width: 6px;
}

.vscode-output-pane::-webkit-scrollbar-track,
.vscode-challenge-description::-webkit-scrollbar-track,
.vscode-hints-panel::-webkit-scrollbar-track {
    background: var(--vscode-bg-secondary);
}

.vscode-output-pane::-webkit-scrollbar-thumb,
.vscode-challenge-description::-webkit-scrollbar-thumb,
.vscode-hints-panel::-webkit-scrollbar-thumb {
    background: var(--vscode-bg-tertiary);
    border-radius: 3px;
}

.vscode-output-pane::-webkit-scrollbar-thumb:hover,
.vscode-challenge-description::-webkit-scrollbar-thumb:hover,
.vscode-hints-panel::-webkit-scrollbar-thumb:hover {
    background: var(--vscode-text-muted);
}