/**
 * DSA Problem Lab — Frontend Styles
 *
 * Layout: Split panel (left: tabs/content, right: editor/output)
 * Theme:  Dark (GitHub Dark / VS Code inspired)
 */

/* ════════════════════════════════════════════════════════════════
   RESET & CONTAINER
   ════════════════════════════════════════════════════════════════ */

.dsa-problem-container {
    font-family: 'Work Sans', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    font-size: 14px;
    color: #c9d1d9;
    background: #0d1117;
    border-radius: 0;
    overflow: hidden;
    border: none;
    margin: 0;
    line-height: 1.6;
    min-height: calc(100vh - 80px);
    display: flex;
    flex-direction: column;
    padding-bottom: 0;
    width: 100% !important;
    max-width: 100% !important;
    border-bottom: 1px solid #30363d;
}

.dsa-problem-container *,
.dsa-problem-container *::before,
.dsa-problem-container *::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

/* ════════════════════════════════════════════════════════════════
   TOP HEADER BAR
   ════════════════════════════════════════════════════════════════ */

.dsa-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: #1a1a2e;
    padding: 12px 20px 8px;
}

.dsa-header-left {
    display: flex;
    align-items: center;
    gap: 12px;
}

.dsa-header-title {
    font-size: 16px;
    font-weight: 600;
    color: #e6edf3;
    letter-spacing: -0.2px;
}

.dsa-badge-difficulty {
    padding: 3px 10px;
    border-radius: 12px;
    font-size: 12px;
    font-weight: 600;
    text-transform: capitalize;
    line-height: 1;
}

.dsa-badge-easy {
    background: rgba(46, 160, 67, 0.15);
    color: #2ea043;
    border: 1px solid rgba(46, 160, 67, 0.3);
}

.dsa-badge-medium {
    background: rgba(210, 153, 34, 0.15);
    color: #d29922;
    border: 1px solid rgba(210, 153, 34, 0.3);
}

.dsa-badge-hard {
    background: rgba(248, 81, 73, 0.15);
    color: #f85149;
    border: 1px solid rgba(248, 81, 73, 0.3);
}

/* ════════════════════════════════════════════════════════════════
   MAIN TAB NAVIGATION — LeetCode-style flat tabs with icons
   ════════════════════════════════════════════════════════════════ */

.dsa-main-tabs {
    display: flex;
    align-items: center;
    background: #1a1a2e;
    padding: 0 12px;
    gap: 0;
    height: 40px;
    border-bottom: 1px solid #30363d;
}

.dsa-main-tab {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 0 14px;
    height: 40px;
    background: none !important;
    border: none !important;
    outline: none !important;
    box-shadow: none !important;
    -webkit-appearance: none;
    -moz-appearance: none;
    appearance: none;
    color: #8b949e;
    font-size: 13px;
    font-weight: 500;
    font-family: 'Work Sans', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    cursor: pointer;
    white-space: nowrap;
    position: relative;
    line-height: 1;
}

.dsa-main-tab:hover,
.dsa-main-tab:focus,
.dsa-main-tab:active,
.dsa-main-tab:focus-visible {
    color: #e6edf3;
    background: none !important;
    border: none !important;
    outline: none !important;
    box-shadow: none !important;
}

.dsa-main-tab.active,
.dsa-main-tab.active:hover,
.dsa-main-tab.active:focus {
    color: #e6edf3;
    background: none !important;
    border: none !important;
    outline: none !important;
    box-shadow: none !important;
}

/* Pipe divider between tabs */
.dsa-main-tab + .dsa-main-tab::before {
    content: '';
    position: absolute;
    left: 0;
    top: 50%;
    transform: translateY(-50%);
    width: 1px;
    height: 14px;
    background: #3d3d5c;
}

/* Tab icons */
.dsa-tab-icon {
    display: inline-flex;
    align-items: center;
    font-size: 14px;
    flex-shrink: 0;
    line-height: 1;
}

.dsa-tab-icon-learn { font-size: 13px; }
.dsa-tab-icon-interview { font-size: 13px; }
.dsa-tab-icon-challenge {
    font-size: 12px;
    font-family: 'SF Mono', 'Consolas', 'Courier New', monospace;
    color: #f0883e;
    font-weight: 700;
}
.dsa-tab-icon-solution { font-size: 13px; }

.dsa-main-tab-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 18px;
    height: 18px;
    padding: 0 5px;
    margin-left: 2px;
    border-radius: 9px;
    font-size: 10px;
    font-weight: 600;
    line-height: 1;
}

.dsa-main-tab-badge-done {
    background: rgba(46, 160, 67, 0.2);
    color: #2ea043;
}

.dsa-main-tab-badge-count {
    background: rgba(139, 148, 158, 0.15);
    color: #8b949e;
}

/* ════════════════════════════════════════════════════════════════
   TAB PANELS
   ════════════════════════════════════════════════════════════════ */

.dsa-tab-panel {
    display: none;
    flex: 1;
}

.dsa-tab-panel.active {
    display: flex;
    flex-direction: column;
    animation: dsaFadeIn 0.2s ease;
}

@keyframes dsaFadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

/* ════════════════════════════════════════════════════════════════
   LEARN TAB (Markdown content)
   ════════════════════════════════════════════════════════════════ */

.dsa-learn-panel {
    padding: 24px;
    flex: 1;
    overflow-y: auto;
}

.dsa-learn-panel::-webkit-scrollbar {
    width: 6px;
}

.dsa-learn-panel::-webkit-scrollbar-track {
    background: #0d1117;
}

.dsa-learn-panel::-webkit-scrollbar-thumb {
    background: #30363d;
    border-radius: 3px;
}

.dsa-learn-panel::-webkit-scrollbar-thumb:hover {
    background: #484f58;
}

/* Markdown rendered content */
.dsa-learn-content h1,
.dsa-learn-content h2,
.dsa-learn-content h3,
.dsa-learn-content h4 {
    color: #e6edf3;
    margin-top: 24px;
    margin-bottom: 12px;
    font-weight: 600;
    line-height: 1.3;
}

.dsa-learn-content h1 { font-size: 24px; padding-bottom: 8px; border-bottom: 1px solid #30363d; }
.dsa-learn-content h2 { font-size: 20px; padding-bottom: 6px; border-bottom: 1px solid #30363d; }
.dsa-learn-content h3 { font-size: 17px; }
.dsa-learn-content h4 { font-size: 15px; }

.dsa-learn-content p {
    margin-bottom: 16px;
    color: #c9d1d9;
}

.dsa-learn-content a {
    color: #58a6ff;
    text-decoration: none;
}

.dsa-learn-content a:hover {
    text-decoration: underline;
}

.dsa-learn-content strong {
    color: #e6edf3;
    font-weight: 600;
}

.dsa-learn-content em {
    color: #c9d1d9;
    font-style: italic;
}

.dsa-learn-content ul,
.dsa-learn-content ol {
    margin-bottom: 16px;
    padding-left: 24px;
}

.dsa-learn-content li {
    margin-bottom: 6px;
}

.dsa-learn-content code {
    background: #161b22;
    padding: 2px 8px;
    border-radius: 4px;
    font-family: 'SF Mono', 'Consolas', 'Courier New', monospace;
    font-size: 13px;
    color: #79c0ff;
    border: 1px solid #30363d;
}

.dsa-learn-content pre {
    background: #161b22;
    border: 1px solid #30363d;
    border-radius: 6px;
    padding: 16px;
    margin-bottom: 16px;
    overflow-x: auto;
}

.dsa-learn-content pre code {
    background: transparent;
    padding: 0;
    border: none;
    border-radius: 0;
    color: #c9d1d9;
    font-size: 13px;
    line-height: 1.5;
}

.dsa-learn-content blockquote {
    border-left: 3px solid #58a6ff;
    padding: 8px 16px;
    margin: 0 0 16px 0;
    background: rgba(88, 166, 255, 0.05);
    color: #8b949e;
}

.dsa-learn-content table {
    width: 100%;
    border-collapse: collapse;
    margin-bottom: 16px;
}

.dsa-learn-content th,
.dsa-learn-content td {
    border: 1px solid #30363d;
    padding: 8px 12px;
    text-align: left;
}

.dsa-learn-content th {
    background: #161b22;
    font-weight: 600;
    color: #e6edf3;
}

.dsa-learn-content hr {
    border: none;
    border-top: 1px solid #30363d;
    margin: 24px 0;
}

.dsa-learn-empty {
    text-align: center;
    color: #484f58;
    padding: 60px 20px;
    font-size: 15px;
}

/* ════════════════════════════════════════════════════════════════
   INTERVIEW TAB
   ════════════════════════════════════════════════════════════════ */

.dsa-interview-panel {
    padding: 24px;
    flex: 1;
    overflow-y: auto;
}

.dsa-interview-panel::-webkit-scrollbar { width: 6px; }
.dsa-interview-panel::-webkit-scrollbar-track { background: #0d1117; }
.dsa-interview-panel::-webkit-scrollbar-thumb { background: #30363d; border-radius: 3px; }

/* Progress bar */
.dsa-iq-progress {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 20px;
}

.dsa-iq-progress-bar {
    flex: 1;
    height: 4px;
    background: #21262d;
    border-radius: 2px;
    overflow: hidden;
}

.dsa-iq-progress-fill {
    height: 100%;
    background: #58a6ff;
    border-radius: 2px;
    transition: width 0.3s ease;
}

.dsa-iq-progress-text {
    font-size: 13px;
    color: #8b949e;
    white-space: nowrap;
}

/* Question card */
.dsa-iq-question {
    font-size: 16px;
    font-weight: 500;
    color: #e6edf3;
    margin-bottom: 20px;
    line-height: 1.5;
}

/* Answer options */
.dsa-iq-options {
    display: flex;
    flex-direction: column;
    gap: 10px;
    margin-bottom: 20px;
}

.dsa-iq-option {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 14px 16px;
    background: #161b22;
    border: 1px solid #30363d;
    border-radius: 8px;
    color: #c9d1d9;
    font-size: 14px;
    cursor: pointer;
    transition: all 0.15s ease;
    text-align: left;
    width: 100%;
    font-family: inherit;
}

.dsa-iq-option:hover {
    background: #1c2129;
    border-color: #58a6ff;
}

.dsa-iq-option-key {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 28px;
    height: 28px;
    border-radius: 6px;
    background: #21262d;
    border: 1px solid #30363d;
    font-size: 12px;
    font-weight: 600;
    color: #8b949e;
    flex-shrink: 0;
}

.dsa-iq-option.selected {
    background: rgba(56, 139, 253, 0.1);
    border-color: #388bfd;
}

.dsa-iq-option.selected .dsa-iq-option-key {
    background: #388bfd;
    border-color: #388bfd;
    color: #fff;
}

.dsa-iq-option.correct {
    background: rgba(46, 160, 67, 0.1);
    border-color: #2ea043;
}

.dsa-iq-option.correct .dsa-iq-option-key {
    background: #2ea043;
    border-color: #2ea043;
    color: #fff;
}

.dsa-iq-option.incorrect {
    background: rgba(248, 81, 73, 0.1);
    border-color: #f85149;
}

.dsa-iq-option.incorrect .dsa-iq-option-key {
    background: #f85149;
    border-color: #f85149;
    color: #fff;
}

.dsa-iq-option.disabled {
    cursor: default;
    opacity: 0.6;
}

/* Explanation box */
.dsa-iq-explanation {
    padding: 14px 16px;
    border-radius: 8px;
    font-size: 14px;
    line-height: 1.6;
    margin-bottom: 20px;
    animation: dsaFadeIn 0.3s ease;
}

.dsa-iq-explanation-correct {
    background: rgba(46, 160, 67, 0.08);
    border: 1px solid rgba(46, 160, 67, 0.3);
    color: #7ee787;
}

.dsa-iq-explanation-incorrect {
    background: rgba(248, 81, 73, 0.08);
    border: 1px solid rgba(248, 81, 73, 0.3);
    color: #ffa198;
}

/* Interview controls */
.dsa-iq-controls {
    display: flex;
    gap: 8px;
    align-items: center;
}

.dsa-iq-complete {
    text-align: center;
    padding: 48px 20px;
}

.dsa-iq-complete-icon {
    font-size: 48px;
    margin-bottom: 16px;
}

.dsa-iq-complete-title {
    font-size: 20px;
    font-weight: 600;
    color: #e6edf3;
    margin-bottom: 8px;
}

.dsa-iq-complete-subtitle {
    font-size: 14px;
    color: #8b949e;
    margin-bottom: 24px;
}

/* ════════════════════════════════════════════════════════════════
   CODE CHALLENGE TAB (Split Panel)
   ════════════════════════════════════════════════════════════════ */

.dsa-challenge-panel {
    display: flex;
    flex: 1;
    height: calc(100vh - 160px);
    max-height: calc(100vh - 160px);
    overflow: hidden;
    position: relative;
}

/* ── Left side: Instructions ── */

.dsa-challenge-left {
    width: 40%;
    display: flex;
    flex-direction: column;
    border-right: 1px solid #30363d;
    background: #0d1117;
    overflow: hidden;
}

/* Inner wrapper from tab content must fill and flex */
.dsa-challenge-left > div {
    display: flex;
    flex-direction: column;
    flex: 1;
    min-height: 0;
    overflow: hidden;
}

.dsa-challenge-left-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0 16px;
    height: 44px;
    min-height: 44px;
    background: #161b22;
    border-bottom: 1px solid #30363d;
    flex-shrink: 0;
}

.dsa-challenge-left-title {
    font-size: 14px;
    font-weight: 500;
    color: #58a6ff;
}

.dsa-challenge-step-counter {
    background: #30363d;
    padding: 4px 10px;
    border-radius: 4px;
    font-size: 12px;
    color: #c9d1d9;
    line-height: 1.4;
    height: 26px;
    display: inline-flex;
    align-items: center;
}

.dsa-challenge-left-header-right {
    display: flex;
    align-items: center;
    gap: 8px;
}

/* Hint toggle button in header — matched to step counter */
.dsa-hint-toggle,
.dsa-problem-container .dsa-hint-toggle {
    display: inline-flex !important;
    align-items: center !important;
    padding: 4px 10px !important;
    height: 26px !important;
    border-radius: 4px !important;
    font-size: 12px !important;
    font-weight: 500 !important;
    font-family: inherit !important;
    color: #d29922 !important;
    background: #30363d !important;
    background-color: #30363d !important;
    border: none !important;
    cursor: pointer !important;
    line-height: 1.4 !important;
    white-space: nowrap !important;
    text-shadow: none !important;
    box-shadow: none !important;
    -moz-box-shadow: none !important;
    -webkit-box-shadow: none !important;
    margin: 0 !important;
}

.dsa-hint-toggle:hover,
.dsa-problem-container .dsa-hint-toggle:hover {
    background: #3d434d !important;
    background-color: #3d434d !important;
    color: #d29922 !important;
    border: none !important;
}

.dsa-hint-toggle.active,
.dsa-hint-toggle.active:hover,
.dsa-problem-container .dsa-hint-toggle.active {
    background: rgba(210, 153, 34, 0.2) !important;
    background-color: rgba(210, 153, 34, 0.2) !important;
    color: #f0c44d !important;
    border: none !important;
}

.dsa-challenge-left-content {
    flex: 1;
    padding: 20px;
    overflow-y: auto;
    overflow-x: hidden;
}

.dsa-challenge-left-content::-webkit-scrollbar { width: 6px; }
.dsa-challenge-left-content::-webkit-scrollbar-track { background: #0d1117; }
.dsa-challenge-left-content::-webkit-scrollbar-thumb { background: #30363d; border-radius: 3px; }

/* When Learn/Interview/Solution panels are inside the left content, reset their own padding/overflow */
.dsa-challenge-left-content .dsa-learn-panel,
.dsa-challenge-left-content .dsa-interview-panel,
.dsa-challenge-left-content .dsa-solution-panel {
    padding: 0;
    overflow: visible;
}

/* Step instruction */
.dsa-step-instruction {
    font-size: 15px;
    font-weight: 500;
    color: #e6edf3;
    margin-bottom: 16px;
    line-height: 1.5;
}

/* Hint panel (shown on toggle) */
.dsa-step-hint {
    background: rgba(210, 153, 34, 0.06);
    border: 1px solid rgba(210, 153, 34, 0.2);
    border-radius: 6px;
    padding: 14px 16px;
    font-size: 14px;
    line-height: 1.6;
    color: #c9d1d9;
    margin-top: 16px;
    animation: dsaSlideDown 0.2s ease;
}

@keyframes dsaSlideDown {
    from { opacity: 0; transform: translateY(-8px); }
    to { opacity: 1; transform: translateY(0); }
}

.dsa-step-hint-text {
    color: #c9d1d9;
}

/* Monaco gutter decorations */
.dsa-glyph-todo {
    background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16'%3E%3Ctext x='0' y='13' font-size='13'%3E💡%3C/text%3E%3C/svg%3E") center center no-repeat !important;
}

.dsa-glyph-pass {
    background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16'%3E%3Ctext x='0' y='13' font-size='13'%3E✅%3C/text%3E%3C/svg%3E") center center no-repeat !important;
}

.dsa-glyph-fail {
    background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16'%3E%3Ctext x='0' y='13' font-size='13'%3E❌%3C/text%3E%3C/svg%3E") center center no-repeat !important;
}

.dsa-line-fail {
    background: rgba(248, 81, 73, 0.08) !important;
}

/* Solution panel (main tab) */
.dsa-solution-panel {
    padding: 24px;
    flex: 1;
    overflow-y: auto;
}

.dsa-solution-code-block {
    background: #161b22;
    border: 1px solid #30363d;
    border-radius: 8px;
    padding: 20px;
    font-family: 'SF Mono', 'Consolas', 'Courier New', monospace;
    font-size: 13px;
    line-height: 1.6;
    color: #c9d1d9;
    white-space: pre-wrap;
    overflow-x: auto;
    margin: 0;
}

/* Validation feedback inline */
.dsa-step-feedback {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 14px;
    border-radius: 6px;
    font-size: 13px;
    margin-top: 16px;
    animation: dsaFadeIn 0.3s ease;
}

.dsa-step-feedback-pass {
    background: rgba(46, 160, 67, 0.1);
    border: 1px solid rgba(46, 160, 67, 0.3);
    color: #7ee787;
}

.dsa-step-feedback-fail {
    background: rgba(248, 81, 73, 0.1);
    border: 1px solid rgba(248, 81, 73, 0.3);
    color: #ffa198;
}

/* Circled icon in feedback */
.dsa-feedback-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 22px;
    height: 22px;
    border-radius: 50%;
    font-size: 12px;
    font-weight: 700;
    flex-shrink: 0;
    line-height: 1;
}

.dsa-feedback-icon-pass {
    background: rgba(46, 160, 67, 0.25);
    border: 1.5px solid #2ea043;
    color: #7ee787;
}

.dsa-feedback-icon-fail {
    background: rgba(248, 81, 73, 0.25);
    border: 1.5px solid #f85149;
    color: #ffa198;
}

/* Challenge controls — toolbar between editor and output */
.dsa-challenge-controls {
    display: flex;
    gap: 8px;
    align-items: center;
    padding: 6px 16px;
    background: #161b22;
    border-top: 1px solid #30363d;
    flex-shrink: 0;
}

/* Kill ALL hover/focus effects on control buttons */
.dsa-challenge-controls button,
.dsa-challenge-controls .dsa-btn {
    outline: none !important;
    box-shadow: none !important;
    transform: none !important;
    transition: none !important;
    -webkit-tap-highlight-color: transparent !important;
}

.dsa-challenge-controls button:hover,
.dsa-challenge-controls button:focus,
.dsa-challenge-controls button:active,
.dsa-challenge-controls button:focus-visible,
.dsa-challenge-controls .dsa-btn:hover,
.dsa-challenge-controls .dsa-btn:focus,
.dsa-challenge-controls .dsa-btn:active,
.dsa-challenge-controls .dsa-btn:focus-visible {
    outline: none !important;
    box-shadow: none !important;
    transform: none !important;
    filter: none !important;
}

.dsa-challenge-controls .dsa-challenge-timer {
    margin-left: auto;
    font-family: 'SF Mono', 'Consolas', 'Courier New', monospace;
    font-size: 13px;
    color: #8b949e;
    padding: 4px 10px;
    background: #21262d;
    border-radius: 4px;
    border: 1px solid #30363d;
}

/* ── Right side: Editor + Output ── */

.dsa-challenge-right {
    width: 60%;
    display: flex;
    flex-direction: column;
    background: #0d1117;
}

.dsa-challenge-right-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0 16px;
    height: 44px;
    min-height: 44px;
    background: #161b22;
    border-bottom: 1px solid #30363d;
    flex-shrink: 0;
}

.dsa-challenge-filename {
    font-size: 14px;
    font-weight: 500;
    color: #58a6ff;
    font-family: 'SF Mono', 'Consolas', 'Courier New', monospace;
}

.dsa-challenge-right-status {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 12px;
    color: #8b949e;
}

.dsa-challenge-status-dot {
    width: 8px;
    height: 8px;
    background: #2ea043;
    border-radius: 50%;
    animation: dsaPulse 2s infinite;
}

@keyframes dsaPulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.5; }
}

/* Monaco editor wrapper */
.dsa-editor-wrapper {
    flex: 1;
    min-height: 0;
}

/* Terminal / Output area */
.dsa-terminal {
    display: flex;
    flex-direction: column;
    flex-shrink: 0;
}

/* Drag handle to resize terminal */
.dsa-terminal-resize-handle {
    height: 6px;
    background: #161b22;
    border-top: 1px solid #30363d;
    cursor: ns-resize;
    flex-shrink: 0;
    position: relative;
}

.dsa-terminal-resize-handle::after {
    content: '';
    position: absolute;
    left: 50%;
    top: 50%;
    transform: translate(-50%, -50%);
    width: 32px;
    height: 2px;
    background: #484f58;
    border-radius: 1px;
}

.dsa-terminal-resize-handle:hover {
    background: #21262d;
}

.dsa-terminal-resize-handle:hover::after {
    background: #8b949e;
}

/* Fireworks canvas overlay */
.dsa-fireworks-canvas {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 100;
}

.dsa-terminal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 6px 16px;
    background: #161b22;
    border-bottom: 1px solid #30363d;
    font-size: 12px;
    color: #8b949e;
    flex-shrink: 0;
}

.dsa-terminal-output {
    flex: 1;
    padding: 12px 16px;
    font-family: 'SF Mono', 'Consolas', 'Courier New', monospace;
    font-size: 13px;
    line-height: 1.5;
    color: #c9d1d9;
    overflow-y: auto;
    white-space: pre-wrap;
    background: #0d1117;
}

.dsa-terminal-output::-webkit-scrollbar { width: 6px; }
.dsa-terminal-output::-webkit-scrollbar-track { background: #0d1117; }
.dsa-terminal-output::-webkit-scrollbar-thumb { background: #30363d; border-radius: 3px; }

.dsa-terminal-prompt {
    color: #56d364;
    font-weight: 500;
}

.dsa-terminal-error {
    color: #ffa198;
}

.dsa-terminal-success {
    color: #7ee787;
}

.dsa-terminal-compiling {
    color: #8b949e;
    font-style: italic;
}

/* ════════════════════════════════════════════════════════════════
   SHARED BUTTONS
   ════════════════════════════════════════════════════════════════ */

.dsa-btn {
    padding: 8px 16px;
    border: none;
    border-radius: 6px;
    font-size: 13px;
    font-weight: 500;
    font-family: inherit;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    line-height: 1;
    white-space: nowrap;
    outline: none !important;
    box-shadow: none !important;
    transform: none !important;
    -webkit-appearance: none !important;
}

.dsa-btn:hover,
.dsa-btn:focus,
.dsa-btn:active,
.dsa-btn:focus-visible {
    outline: none !important;
    box-shadow: none !important;
    transform: none !important;
    border: none !important;
}

.dsa-btn-secondary:hover,
.dsa-btn-secondary:focus,
.dsa-btn-secondary:active,
.dsa-btn-secondary:focus-visible {
    border: 1px solid #30363d !important;
}

.dsa-btn:disabled {
    opacity: 0.4;
    cursor: not-allowed;
}

.dsa-btn-primary {
    background: #238636;
    color: #fff;
}

.dsa-btn-primary:hover:not(:disabled) {
    background: #238636;
}

.dsa-btn-secondary {
    background: #21262d;
    color: #c9d1d9;
    border: 1px solid #30363d !important;
}

.dsa-btn-secondary:hover:not(:disabled) {
    background: #21262d;
    border: 1px solid #30363d !important;
}

.dsa-btn-blue {
    background: #1f6feb;
    color: #fff;
}

.dsa-btn-blue:hover:not(:disabled) {
    background: #1f6feb;
}

.dsa-btn-danger {
    background: #da3633;
    color: #fff;
}

.dsa-btn-danger:hover:not(:disabled) {
    background: #da3633;
}

/* Spinner for loading states */
.dsa-spinner {
    display: inline-block;
    width: 14px;
    height: 14px;
    border: 2px solid rgba(255, 255, 255, 0.3);
    border-top-color: #fff;
    border-radius: 50%;
    animation: dsaSpin 0.6s linear infinite;
}

@keyframes dsaSpin {
    to { transform: rotate(360deg); }
}

/* ════════════════════════════════════════════════════════════════
   CHALLENGE COMPLETE OVERLAY
   ════════════════════════════════════════════════════════════════ */

.dsa-challenge-complete {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 48px 24px;
    text-align: center;
}

.dsa-challenge-complete-icon {
    font-size: 48px;
    margin-bottom: 16px;
}

.dsa-challenge-complete-title {
    font-size: 20px;
    font-weight: 600;
    color: #e6edf3;
    margin-bottom: 8px;
}

.dsa-challenge-complete-subtitle {
    font-size: 14px;
    color: #8b949e;
    margin-bottom: 24px;
}

/* Test case results */
.dsa-test-results {
    width: 100%;
    margin-top: 12px;
}

.dsa-test-result-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 14px;
    background: #161b22;
    border: 1px solid #30363d;
    border-radius: 6px;
    margin-bottom: 8px;
    font-size: 13px;
    font-family: 'SF Mono', 'Consolas', 'Courier New', monospace;
}

.dsa-test-result-icon {
    font-size: 16px;
    flex-shrink: 0;
}

.dsa-test-result-pass {
    border-color: rgba(46, 160, 67, 0.3);
}

.dsa-test-result-fail {
    border-color: rgba(248, 81, 73, 0.3);
}

/* ════════════════════════════════════════════════════════════════
   KEYBOARD SHORTCUTS BAR
   ════════════════════════════════════════════════════════════════ */

.dsa-keyboard-bar {
    display: flex;
    justify-content: center;
    gap: 12px;
    padding: 8px 16px;
    background: #161b22;
    border-top: 1px solid #30363d;
    font-size: 11px;
    color: #484f58;
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    z-index: 100;
}

.dsa-keyboard-bar kbd {
    background: #21262d;
    border: 1px solid #30363d;
    border-radius: 3px;
    padding: 1px 6px;
    font-family: 'SF Mono', 'Consolas', 'Courier New', monospace;
    font-size: 10px;
    color: #8b949e;
}

/* ════════════════════════════════════════════════════════════════
   RESPONSIVE
   ════════════════════════════════════════════════════════════════ */

@media (max-width: 900px) {
    .dsa-challenge-panel {
        flex-direction: column;
        min-height: auto;
    }

    .dsa-challenge-left,
    .dsa-challenge-right {
        width: 100%;
    }

    .dsa-challenge-left {
        border-right: none;
        border-bottom: 1px solid #30363d;
    }

    .dsa-challenge-left-content {
        max-height: none;
    }

    .dsa-challenge-right {
        min-height: 500px;
    }

    .dsa-keyboard-bar {
        flex-wrap: wrap;
    }
}

@media (max-width: 600px) {
    .dsa-header {
        flex-direction: column;
        gap: 8px;
        align-items: flex-start;
    }

    .dsa-main-tabs {
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
    }

    .dsa-main-tab {
        padding: 0 10px;
        font-size: 12px;
    }

    .dsa-learn-panel,
    .dsa-interview-panel {
        padding: 16px;
    }
}