/* Django Master Coder — oddiy, toza IDE dizayni (site.css tokenlari ustiga) */
:root {
    --dj: #0c4b33;
    --dj-2: #44b78b;
    --ed-bg: #0f1420;
    --ed-panel: #121826;
    --ed-line: rgba(255, 255, 255, .07);
    --code-size: 15px;
}

.mc-page { width: min(1680px, calc(100% - 32px)); margin: 0 auto; padding: 18px 0 24px; }

.mc-head { display: flex; align-items: center; justify-content: space-between; gap: 16px; flex-wrap: wrap; margin-bottom: 14px; }
.mc-head h1 { font-size: clamp(1.3rem, 2.4vw, 1.8rem); font-weight: 900; display: flex; align-items: center; gap: 12px; }
.mc-head h1 .dj-logo { width: 40px; height: 40px; border-radius: 10px; display: grid; place-items: center; font: 900 1.2rem var(--mono); color: #fff; background: var(--dj); }

.editor-container { display: grid; grid-template-columns: 240px 1fr; grid-template-rows: 1fr auto; height: calc(100vh - 250px); min-height: 500px;
    border-radius: 14px; overflow: hidden; background: var(--ed-bg); border: 1px solid var(--ed-line); box-shadow: 0 20px 50px rgba(0, 0, 0, .45); }

/* Fayllar paneli */
.file-explorer { grid-row: 1 / 3; background: var(--ed-panel); border-right: 1px solid var(--ed-line); display: flex; flex-direction: column; min-height: 0; }
.file-explorer h3 { font: 700 .7rem Inter, sans-serif; letter-spacing: 1.5px; text-transform: uppercase; color: var(--muted); padding: 14px 16px 8px; display: flex; gap: 8px; align-items: center; }
.file-explorer ul { list-style: none; padding: 0; margin: 0; }
#fileTree { flex: 1; overflow: auto; padding: 0 8px 8px; }
.file-explorer li > span { display: flex; align-items: center; gap: 8px; padding: 5px 10px; border-radius: 6px; font: 500 .86rem var(--mono); color: #c3cad9;
    cursor: pointer; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.file-explorer li > span::before { font-family: 'Font Awesome 6 Free'; font-weight: 900; width: 16px; text-align: center; flex-shrink: 0; font-size: .8rem; }
.file-explorer li.file > span::before { content: '\f15b'; color: #7c8db5; }
.file-explorer li.file[data-path$=".py"] > span::before { content: '\f3e2'; font-family: 'Font Awesome 6 Brands'; font-weight: 400; color: #60a5fa; }
.file-explorer li.file[data-path$=".html"] > span::before { content: '\f13b'; font-family: 'Font Awesome 6 Brands'; font-weight: 400; color: #f97316; }
.file-explorer li.folder > span::before { content: '\f07c'; color: #e5b454; }
.file-explorer li.folder.collapsed > span::before { content: '\f07b'; }
.file-explorer li.folder.collapsed > ul { display: none; }
.file-explorer li > span:hover { background: rgba(255, 255, 255, .05); color: #fff; }
.file-explorer li.active > span { background: rgba(68, 183, 139, .18); color: #fff; }
.file-explorer li.done > span { color: #86efac; }
.file-explorer li.done > span::after { content: '\f00c'; font-family: 'Font Awesome 6 Free'; font-weight: 900; margin-left: auto; color: var(--dj-2); font-size: .7rem; }
.file-explorer li.empty > span { opacity: .4; cursor: default; }
.file-explorer ul ul { margin-left: 12px; padding-left: 6px; border-left: 1px solid var(--ed-line); }

.project-card { border-top: 1px solid var(--ed-line); padding: 12px 16px 14px; }
.project-row { display: flex; justify-content: space-between; font: 700 .8rem Inter, sans-serif; color: var(--muted); margin-bottom: 8px; }
.project-row b { color: var(--dj-2); }
.project-bar { height: 6px; border-radius: 6px; background: rgba(255, 255, 255, .07); overflow: hidden; }
.project-bar span { display: block; height: 100%; width: 0; background: var(--dj-2); transition: width .4s; }
.project-card small { display: block; margin-top: 8px; color: var(--muted); font-size: .75rem; }

/* Kod maydoni */
.code-area { display: grid; grid-template-columns: 1fr 1fr; min-width: 0; min-height: 0; }
.code-reference, .code-input { display: flex; flex-direction: column; min-width: 0; min-height: 0; position: relative; }
.code-input { border-left: 1px solid var(--ed-line); }
.code-reference h4, .code-input h4 { font: 700 .7rem Inter, sans-serif; letter-spacing: 1.5px; text-transform: uppercase; color: var(--muted);
    padding: 0 14px; height: 40px; display: flex; gap: 8px; align-items: center; background: var(--ed-panel); border-bottom: 1px solid var(--ed-line); flex-shrink: 0; }
.code-reference h4 .fname { margin-left: auto; text-transform: none; letter-spacing: 0; color: #e2e8f0; font: 600 .8rem var(--mono); }
.code-input h4 { padding-right: 52px; }
.code-wrapper { display: flex; position: relative; flex: 1; min-height: 0; }
.line-numbers { width: 48px; flex-shrink: 0; padding: 12px 12px 12px 0; text-align: right; font: 400 var(--code-size)/1.65 var(--mono); color: #3b4560; user-select: none; overflow: hidden; }
.code-display { flex: 1; overflow: auto; padding: 12px 16px 12px 4px; min-width: 0; }
.code-overlay-display { position: static; }
.code-content { font: 400 var(--code-size)/1.65 var(--mono); white-space: pre; color: #5c6785; user-select: none; }
.code-content span.default { color: #5c6785; }
.code-content span.correct { color: #d1fae5; }
.code-content span.error { color: #fff; background: rgba(239, 68, 68, .6); border-radius: 2px; }
.code-content span.current { color: #0f1420; background: var(--gold); border-radius: 2px; }
.code-input textarea { flex: 1; min-width: 0; margin: 0; padding: 12px 16px 12px 4px; border: 0; outline: none; resize: none; background: transparent;
    color: #e2e8f0; font: 400 var(--code-size)/1.65 var(--mono); tab-size: 4; white-space: pre; overflow-wrap: normal; overflow: auto; caret-color: var(--gold); }
.code-input textarea.err { background: rgba(239, 68, 68, .06); }
.code-input textarea:disabled { opacity: .6; }
.code-overlay { display: none; }
.stats { display: none; }
.download-icon { position: absolute; top: 5px; right: 10px; width: 30px; height: 30px; border-radius: 8px; display: grid; place-items: center; cursor: pointer;
    color: var(--muted); transition: color .15s, background .15s; }
.download-icon:hover { color: #fff; background: rgba(255, 255, 255, .07); }

.mc-combo { position: absolute; right: 22px; bottom: 16px; z-index: 4; pointer-events: none; text-align: right; font: 800 1.2rem var(--mono); color: var(--gold); opacity: 0; transition: opacity .2s; }
.mc-combo small { display: block; font: 700 .6rem Inter, sans-serif; letter-spacing: 2px; color: var(--muted); }
.mc-combo.on { opacity: .9; }

.file-progress { grid-column: 2; height: 3px; background: rgba(255, 255, 255, .05); }
.file-progress span { display: block; height: 100%; width: 0; background: var(--dj-2); transition: width .2s; }

@media (max-width: 1000px) {
    .editor-container { grid-template-columns: 1fr; grid-template-rows: auto 1fr auto; height: auto; }
    .file-explorer { grid-row: auto; border-right: 0; border-bottom: 1px solid var(--ed-line); }
    #fileTree { max-height: 180px; }
    .file-progress { grid-column: 1; }
    .code-wrapper { height: 60vh; }
}
@media (max-width: 720px) {
    :root { --code-size: 13px; }
    .code-area { grid-template-columns: 1fr; }
    .code-input { border-left: 0; border-top: 1px solid var(--ed-line); }
    .code-wrapper { height: 45vh; }
}
