/* DSA Practice Styles */

.dsa-container {
    display: grid;
    grid-template-columns: 300px 1fr;
    gap: 20px;
    height: calc(100vh - 120px);
}

/* List Panel */
.problem-list-panel {
    background: var(--card-bg);
    border: 1px solid var(--border);
    border-radius: 12px;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.panel-header {
    padding: 15px;
    border-bottom: 1px solid var(--border);
}

.filter-chips {
    display: flex;
    gap: 8px;
    margin-top: 10px;
    flex-wrap: wrap;
}

.chip {
    font-size: 0.75rem;
    padding: 4px 10px;
    background: rgba(255, 255, 255, 0.05);
    border-radius: 12px;
    cursor: pointer;
    border: 1px solid transparent;
}

.chip.active,
.chip:hover {
    background: var(--primary);
    color: white;
}

.scrollable-list {
    flex: 1;
    overflow-y: auto;
}

.prob-item {
    padding: 15px;
    border-bottom: 1px solid var(--border);
    cursor: pointer;
    transition: background 0.2s;
}

.prob-item:hover {
    background: rgba(255, 255, 255, 0.03);
}

.prob-info {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 5px;
}

.prob-title {
    font-weight: 500;
}

.prob-meta {
    font-size: 0.8rem;
    color: var(--text-muted);
}

.badge {
    font-size: 0.7rem;
    padding: 2px 6px;
    border-radius: 4px;
    text-transform: uppercase;
    font-weight: bold;
}

.badge.easy {
    background: rgba(34, 197, 94, 0.2);
    color: #22c55e;
}

.badge.medium {
    background: rgba(234, 179, 8, 0.2);
    color: #eab308;
}

.badge.hard {
    background: rgba(239, 68, 68, 0.2);
    color: #ef4444;
}

/* Workspace */
.problem-workspace {
    background: var(--card-bg);
    border: 1px solid var(--border);
    border-radius: 12px;
    overflow: hidden;
    position: relative;
}

.workspace-placeholder {
    height: 100%;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    color: var(--text-muted);
}

.editor-view {
    height: 100%;
    display: flex;
    flex-direction: column;
}

.problem-desc {
    padding: 20px;
    border-bottom: 1px solid var(--border);
    max-height: 30%;
    overflow-y: auto;
}

.desc-header {
    display: flex;
    gap: 10px;
    align-items: center;
    margin-bottom: 10px;
}

.companies-tag {
    margin-top: 10px;
    font-size: 0.85rem;
    color: var(--text-muted);
    display: flex;
    align-items: center;
    gap: 6px;
}

/* Controls */
.editor-controls {
    padding: 10px 20px;
    background: rgba(0, 0, 0, 0.2);
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 1px solid var(--border);
}

#prog-lang {
    background: transparent;
    border: 1px solid var(--border);
    color: white;
    padding: 5px 10px;
    border-radius: 6px;
}

.ctrl-right {
    display: flex;
    gap: 10px;
}

.btn-primary-sm,
.btn-secondary-sm {
    padding: 6px 12px;
    border-radius: 6px;
    border: none;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 0.9rem;
}

.btn-primary-sm {
    background: var(--primary);
    color: white;
}

.btn-secondary-sm {
    background: rgba(255, 255, 255, 0.1);
    color: white;
}

/* Code Area */
.code-editor-container {
    flex: 1;
    background: #0d1117;
    /* GitHub Dark Dimmed approximation */
    overflow: hidden;
}

#code-area {
    width: 100%;
    height: 100%;
    background: transparent;
    color: #c9d1d9;
    border: none;
    padding: 20px;
    font-family: 'Courier New', Courier, monospace;
    font-size: 14px;
    line-height: 1.5;
    resize: none;
    outline: none;
}

/* Output Panel */
.output-panel {
    height: 30%;
    border-top: 1px solid var(--border);
    display: flex;
    flex-direction: column;
}

.tabs {
    display: flex;
    background: rgba(0, 0, 0, 0.3);
}

.tab {
    background: transparent;
    border: none;
    color: var(--text-muted);
    padding: 10px 20px;
    cursor: pointer;
    border-bottom: 2px solid transparent;
}

.tab.active {
    color: white;
    border-bottom-color: var(--primary);
}

.tab-content {
    flex: 1;
    padding: 20px;
    overflow-y: auto;
    font-family: monospace;
    font-size: 0.9rem;
}

.ai-hint-box {
    background: rgba(59, 130, 246, 0.1);
    /* Blue tint */
    border-left: 3px solid #3b82f6;
    padding: 10px 15px;
    margin-bottom: 10px;
    border-radius: 0 4px 4px 0;
}

.result-success {
    color: #22c55e;
}

.result-fail {
    color: #ef4444;
}

.test-cases {
    margin-top: 10px;
    background: rgba(0, 0, 0, 0.3);
    padding: 10px;
    border-radius: 6px;
    color: #ccc;
}

.case {
    margin-bottom: 4px;
}

.case.failed {
    color: #ef4444;
}

.case.passed {
    color: #22c55e;
}

@media (max-width: 768px) {
    .dsa-container {
        grid-template-columns: 1fr;
        /* Stack */
    }

    .problem-list-panel {
        max-height: 200px;
    }
}