/**
 * TeachCloud YAML for Cloud & DevOps Studio Stylesheet
 * Interactive Dual-Pane Editor, Real-Time JSON Tree & Syntax Diagnostic Studio
 */

/* ── Container & Hero ──────────────────────────────────────────────────────── */
.yaml-master-container {
    max-width: 1400px;
    margin: 0 auto;
    padding: 2rem 1.25rem 4rem;
}

.yaml-hero-section {
    text-align: center;
    margin-bottom: 2.5rem;
}

.yaml-hero-badge {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.8rem;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: #38bdf8;
    background: rgba(56, 189, 248, 0.12);
    border: 1px solid rgba(56, 189, 248, 0.3);
    padding: 0.35rem 0.9rem;
    border-radius: 999px;
    margin-bottom: 0.75rem;
}

.yaml-hero-title {
    font-size: 2.3rem;
    font-weight: 900;
    color: var(--text-primary, #ffffff);
    margin: 0 0 0.6rem;
    letter-spacing: -0.02em;
}

.yaml-hero-desc {
    max-width: 780px;
    margin: 0 auto;
    font-size: 1.02rem;
    color: var(--text-secondary, #94a3b8);
    line-height: 1.6;
}

/* ── 3 Golden Rules Quick Cards ────────────────────────────────────────────── */
.yaml-rules-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 1.25rem;
    margin-bottom: 2.5rem;
}

.yaml-rule-card {
    background: var(--bg-card, #1e293b);
    border: 1.5px solid var(--border-color, #334155);
    border-radius: 12px;
    padding: 1.4rem;
    transition: transform 0.2s ease, border-color 0.2s ease;
}

.yaml-rule-card:hover {
    transform: translateY(-2px);
    border-color: #38bdf8;
}

.yaml-rule-number {
    font-size: 0.75rem;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    padding: 0.2rem 0.6rem;
    border-radius: 999px;
    display: inline-block;
    margin-bottom: 0.6rem;
}

.yaml-rule-title {
    font-size: 1.1rem;
    font-weight: 800;
    color: var(--text-primary);
    margin: 0 0 0.45rem;
}

.yaml-rule-desc {
    font-size: 0.88rem;
    color: var(--text-secondary);
    line-height: 1.55;
    margin: 0 0 0.75rem;
}

.yaml-rule-example {
    background: #090d16;
    border: 1px solid #1e293b;
    border-radius: 6px;
    padding: 0.6rem 0.8rem;
    font-family: 'JetBrains Mono', 'Fira Code', monospace;
    font-size: 0.82rem;
    line-height: 1.5;
    color: #34d399;
}

/* ── Studio Split Screen Card ──────────────────────────────────────────────── */
.yaml-studio-card {
    background: var(--bg-card, #1e293b);
    border: 1.5px solid var(--border-color, #334155);
    border-radius: 14px;
    padding: 1.75rem;
    margin-bottom: 2.5rem;
    box-shadow: 0 8px 30px rgba(0, 0, 0, 0.25);
}

.yaml-studio-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 1rem;
    margin-bottom: 1.25rem;
    padding-bottom: 1rem;
    border-bottom: 1px solid var(--border-color, #334155);
}

.yaml-template-selector {
    display: flex;
    gap: 0.5rem;
    flex-wrap: wrap;
    align-items: center;
}

.yaml-template-btn {
    background: var(--bg-primary, #0f172a);
    border: 1px solid var(--border-color, #334155);
    color: var(--text-secondary, #94a3b8);
    font-size: 0.82rem;
    font-weight: 700;
    padding: 0.45rem 0.85rem;
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.15s ease;
}

.yaml-template-btn:hover {
    color: #38bdf8;
    border-color: #38bdf8;
}

.yaml-template-btn.active {
    background: linear-gradient(135deg, rgba(37, 99, 235, 0.2), rgba(6, 182, 212, 0.2));
    border-color: #38bdf8;
    color: #38bdf8;
    box-shadow: 0 2px 8px rgba(56, 189, 248, 0.25);
}

/* Split Panes */
.yaml-split-panes {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
    gap: 1.25rem;
    margin-bottom: 1.25rem;
    width: 100%;
    max-width: 100%;
    box-sizing: border-box;
}

@media (max-width: 900px) {
    .yaml-split-panes {
        grid-template-columns: minmax(0, 1fr);
    }
}

.yaml-pane-wrapper {
    display: flex;
    flex-direction: column;
    min-width: 0;
    max-width: 100%;
    width: 100%;
    overflow: hidden;
    box-sizing: border-box;
}

.yaml-pane-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: #0f172a;
    border: 1px solid #1e293b;
    border-bottom: none;
    border-radius: 8px 8px 0 0;
    padding: 0.5rem 0.85rem;
    font-size: 0.82rem;
    font-weight: 700;
    color: #94a3b8;
    gap: 0.5rem;
    flex-wrap: wrap;
}

/* View Mode Selector Tabs */
.yaml-view-selector {
    display: flex;
    align-items: center;
    gap: 0.35rem;
}

.yaml-view-btn {
    background: #1e293b;
    border: 1px solid #334155;
    color: #94a3b8;
    font-size: 0.74rem;
    font-weight: 700;
    padding: 0.25rem 0.55rem;
    border-radius: 5px;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 0.3rem;
    transition: all 0.15s ease;
}

.yaml-view-btn:hover {
    color: #38bdf8;
    border-color: #38bdf8;
}

.yaml-view-btn.active {
    background: rgba(56, 189, 248, 0.18);
    border-color: #38bdf8;
    color: #38bdf8;
    box-shadow: 0 1px 6px rgba(56, 189, 248, 0.2);
}

/* Execution Info / Run Status Banner */
.yaml-run-banner {
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: #0a0f1d;
    border-left: 1px solid #1e293b;
    border-right: 1px solid #1e293b;
    border-bottom: 1px solid #1e293b;
    padding: 0.35rem 0.85rem;
    font-size: 0.76rem;
    font-family: 'JetBrains Mono', 'Fira Code', monospace;
    transition: background 0.2s ease, border-color 0.2s ease;
}

.yaml-run-banner.success {
    background: rgba(16, 185, 129, 0.08);
    border-bottom-color: rgba(16, 185, 129, 0.25);
}

.yaml-run-banner.running {
    background: rgba(56, 189, 248, 0.1);
    border-bottom-color: rgba(56, 189, 248, 0.35);
}

.yaml-run-banner.error {
    background: rgba(239, 68, 68, 0.08);
    border-bottom-color: rgba(239, 68, 68, 0.25);
}

.yaml-run-badge-group, .yaml-run-stats-group {
    display: flex;
    align-items: center;
    gap: 0.6rem;
}

.yaml-run-indicator-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: #34d399;
    box-shadow: 0 0 6px rgba(52, 211, 153, 0.6);
    display: inline-block;
}

.yaml-run-banner.error .yaml-run-indicator-dot {
    background: #f87171;
    box-shadow: 0 0 6px rgba(248, 113, 113, 0.6);
}

.yaml-run-banner.running .yaml-run-indicator-dot {
    background: #38bdf8;
    box-shadow: 0 0 8px rgba(56, 189, 248, 0.8);
    animation: yamlRunPulse 0.8s infinite alternate;
}

@keyframes yamlRunPulse {
    from { opacity: 0.4; transform: scale(0.85); }
    to { opacity: 1; transform: scale(1.15); }
}

.yaml-run-time-badge {
    color: #64748b;
    font-size: 0.73rem;
}

.yaml-run-banner.success .yaml-run-time-badge {
    color: #94a3b8;
}

#yaml-run-status-text {
    font-weight: 700;
    color: #34d399;
}

.yaml-run-banner.error #yaml-run-status-text {
    color: #f87171;
}

.yaml-run-banner.running #yaml-run-status-text {
    color: #38bdf8;
}

#yaml-run-type-badge, #yaml-run-duration-badge {
    background: rgba(15, 23, 42, 0.8);
    border: 1px solid #1e293b;
    padding: 0.1rem 0.4rem;
    border-radius: 4px;
    font-size: 0.72rem;
    color: #cbd5e1;
}

/* Output Display Container */
.yaml-output-display-container {
    display: flex;
    flex-direction: column;
    height: 380px;
    width: 100%;
    max-width: 100%;
    min-width: 0;
    box-sizing: border-box;
    overflow: hidden;
}

/* Run Execution Console (Terminal) */
.yaml-run-console {
    width: 100%;
    max-width: 100%;
    min-width: 0;
    background: #050811;
    color: #cbd5e1;
    border: 1px solid #1e293b;
    padding: 0.85rem 1rem;
    font-family: 'JetBrains Mono', 'Fira Code', Consolas, monospace;
    font-size: 0.82rem;
    line-height: 1.6;
    overflow-y: auto;
    overflow-x: auto;
    white-space: pre-wrap;
    word-break: break-word;
    overflow-wrap: break-word;
    box-sizing: border-box;
    transition: box-shadow 0.25s ease, border-color 0.25s ease;
}

.yaml-run-console.run-pulse {
    border-color: #38bdf8 !important;
    box-shadow: 0 0 16px rgba(56, 189, 248, 0.4) !important;
}

.yaml-run-console .log-run { color: #38bdf8; font-weight: 700; }
.yaml-run-console .log-verify { color: #34d399; font-weight: 700; }
.yaml-run-console .log-memory { color: #c084fc; font-weight: 700; }
.yaml-run-console .log-compiled { color: #fbbf24; font-weight: 700; }
.yaml-run-console .log-serialize { color: #38bdf8; font-weight: 700; }
.yaml-run-console .log-status { color: #34d399; font-weight: 700; }
.yaml-run-console .log-error { color: #f87171; font-weight: 700; }
.yaml-run-console .log-info { color: #94a3b8; }

/* View Modes Layout Switching */
.yaml-output-display-container.view-mode-json .yaml-run-console,
.yaml-output-display-container.view-mode-json #yaml-python-output {
    display: none !important;
}

.yaml-output-display-container.view-mode-json #yaml-json-output {
    display: block !important;
    height: 100% !important;
    border-radius: 0 0 8px 8px;
}

.yaml-output-display-container.view-mode-python .yaml-run-console,
.yaml-output-display-container.view-mode-python #yaml-json-output {
    display: none !important;
}

.yaml-output-display-container.view-mode-python #yaml-python-output {
    display: block !important;
    height: 100% !important;
    border-radius: 0 0 8px 8px;
    background: #090d16;
    padding: 1.25rem;
    overflow-y: auto;
}

.yaml-output-display-container.view-mode-console #yaml-json-output,
.yaml-output-display-container.view-mode-console #yaml-python-output {
    display: none !important;
}

.yaml-output-display-container.view-mode-console .yaml-run-console {
    display: block !important;
    height: 100% !important;
    border-radius: 0 0 8px 8px;
}

/* Unified Single-Scroll Split View (No double scrollbars) */
.yaml-output-display-container.view-mode-split {
    overflow-y: auto !important;
    overflow-x: hidden !important;
    border: 1px solid #1e293b;
    border-radius: 0 0 8px 8px;
    background: #090d16;
}

.yaml-output-display-container.view-mode-split .yaml-run-console {
    display: block !important;
    height: auto !important;
    min-height: auto !important;
    max-height: none !important;
    overflow-y: visible !important;
    border: none !important;
    border-bottom: 1px solid #1e293b !important;
    border-radius: 0 !important;
}

.yaml-output-display-container.view-mode-split .yaml-json-viewer {
    display: block !important;
    height: auto !important;
    min-height: 200px !important;
    max-height: none !important;
    overflow-y: visible !important;
    border: none !important;
    border-radius: 0 !important;
}

textarea.yaml-code-editor {
    width: 100%;
    max-width: 100%;
    min-width: 0;
    height: 420px;
    background: #090d16 !important;
    color: #ffffff !important;
    border: 1px solid #1e293b !important;
    border-radius: 0 0 8px 8px !important;
    padding: 1rem 1.25rem !important;
    font-family: 'JetBrains Mono', 'Fira Code', Consolas, monospace !important;
    font-size: 0.86rem !important;
    line-height: 1.65 !important;
    tab-size: 2 !important;
    -moz-tab-size: 2 !important;
    resize: vertical;
    outline: none !important;
    box-sizing: border-box !important;
    caret-color: #38bdf8 !important;
    white-space: pre-wrap !important;
    word-break: break-word !important;
    overflow-wrap: break-word !important;
}

textarea.yaml-code-editor:focus {
    border-color: #38bdf8 !important;
    box-shadow: 0 0 0 2px rgba(56, 189, 248, 0.25) !important;
}

.yaml-json-viewer {
    width: 100%;
    max-width: 100%;
    min-width: 0;
    height: 380px;
    background: #090d16;
    color: #e2e8f0;
    border: 1px solid #1e293b;
    border-radius: 0 0 8px 8px;
    padding: 1rem 1.25rem;
    font-family: 'JetBrains Mono', 'Fira Code', Consolas, monospace;
    font-size: 0.86rem;
    line-height: 1.65;
    overflow-y: auto;
    overflow-x: auto;
    white-space: pre-wrap;
    word-break: break-word;
    overflow-wrap: break-word;
    box-sizing: border-box;
    transition: box-shadow 0.25s ease, border-color 0.25s ease;
}

.yaml-json-viewer.run-pulse {
    border-color: #38bdf8 !important;
    box-shadow: 0 0 16px rgba(56, 189, 248, 0.4) !important;
}

.yaml-json-key {
    color: #38bdf8;
    font-weight: 700;
}

.yaml-json-string {
    color: #34d399;
}

.yaml-json-number {
    color: #fbbf24;
}

.yaml-json-boolean {
    color: #c084fc;
    font-weight: 700;
}

.yaml-json-null {
    color: #94a3b8;
    font-style: italic;
}

/* Diagnostic & Controls Bar */
.yaml-controls-bar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 0.75rem;
    padding: 0.75rem 0.25rem;
}

.yaml-action-btn-primary {
    display: inline-flex;
    align-items: center;
    gap: 0.45rem;
    background: linear-gradient(135deg, #2563eb, #1d4ed8);
    border: 1px solid #3b82f6;
    color: #ffffff;
    padding: 0.55rem 1.2rem;
    font-weight: 700;
    font-size: 0.85rem;
    border-radius: 8px;
    cursor: pointer;
    box-shadow: 0 3px 12px rgba(37, 99, 235, 0.35);
    transition: all 0.15s ease;
}

.yaml-action-btn-primary:hover {
    transform: translateY(-1px);
    box-shadow: 0 5px 16px rgba(37, 99, 235, 0.45);
}

.yaml-action-btn-secondary {
    display: inline-flex;
    align-items: center;
    gap: 0.45rem;
    background: var(--bg-primary, #0f172a);
    border: 1px solid var(--border-color, #334155);
    color: var(--text-primary, #ffffff);
    padding: 0.55rem 1rem;
    font-weight: 600;
    font-size: 0.85rem;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.15s ease;
}

.yaml-action-btn-secondary:hover {
    border-color: #38bdf8;
    color: #38bdf8;
}

.yaml-status-badge {
    padding: 0.45rem 0.85rem;
    border-radius: 6px;
    font-size: 0.84rem;
    font-weight: 700;
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
}

.yaml-status-badge.valid {
    background: rgba(16, 185, 129, 0.15);
    border: 1px solid rgba(16, 185, 129, 0.4);
    color: #34d399;
}

.yaml-status-badge.invalid {
    background: rgba(239, 68, 68, 0.15);
    border: 1px solid rgba(239, 68, 68, 0.4);
    color: #f87171;
}

/* ── Curriculum Lessons Accordion ─────────────────────────────────────────── */
.yaml-curriculum-section {
    margin-top: 3rem;
}

.yaml-curriculum-tabs {
    display: flex;
    gap: 0.5rem;
    margin-bottom: 1.25rem;
    flex-wrap: wrap;
    border-bottom: 1px solid var(--border-color, #334155);
    padding-bottom: 0.75rem;
}

.yaml-level-tab-btn {
    background: var(--bg-primary, #0f172a);
    border: 1px solid var(--border-color, #334155);
    color: var(--text-secondary, #94a3b8);
    font-size: 0.86rem;
    font-weight: 700;
    padding: 0.55rem 1rem;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.15s ease;
}

.yaml-level-tab-btn:hover {
    color: #38bdf8;
    border-color: #38bdf8;
}

.yaml-level-tab-btn.active {
    background: linear-gradient(135deg, rgba(37, 99, 235, 0.25), rgba(6, 182, 212, 0.15));
    border-color: #38bdf8;
    color: #38bdf8;
    box-shadow: 0 2px 10px rgba(56, 189, 248, 0.2);
}

.yaml-level-content {
    background: var(--bg-card, #1e293b);
    border: 1.5px solid var(--border-color, #334155);
    border-radius: 12px;
    padding: 1.75rem;
    display: none;
    animation: yamlFade 0.2s ease-out;
}

.yaml-level-content.active {
    display: block;
}

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

/* ── Google AdSense Container (Under 5-Star Rating Track) ──────────────────── */
.adsense-under-rating {
    transition: transform 0.2s ease, border-color 0.2s ease;
}

.adsense-under-rating:hover {
    border-color: rgba(56, 189, 248, 0.4);
}

/* ── Interactive YAML 24-Q Quiz Styling (High Contrast & Clear Readability) ── */
.yaml-quiz-card {
    background: #111827;
    border: 1.5px solid #2d3b52;
    border-radius: 12px;
    padding: 1.35rem;
    box-shadow: 0 4px 14px rgba(0, 0, 0, 0.25);
    transition: all 0.2s ease;
}

.yaml-quiz-card.answered-correct {
    border-color: #10b981;
    background: linear-gradient(135deg, #111827, #062419);
}

.yaml-quiz-card.answered-wrong {
    border-color: #ef4444;
    background: linear-gradient(135deg, #111827, #240b0e);
}

.yaml-quiz-qhead {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 0.65rem;
}

.yaml-quiz-qnum {
    font-size: 0.78rem;
    color: #38bdf8;
    background: rgba(56, 189, 248, 0.15);
    border: 1px solid #38bdf8;
    padding: 0.2rem 0.6rem;
    border-radius: 6px;
    font-weight: 800;
    letter-spacing: 0.03em;
}

.yaml-quiz-qtitle {
    color: #ffffff !important;
    font-size: 1.05rem;
    font-weight: 800;
    margin: 0 0 1rem;
    line-height: 1.5;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.5);
}

.yaml-quiz-options {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
    gap: 0.75rem;
}

.yaml-quiz-btn {
    background: #1e293b;
    border: 1.5px solid #475569;
    color: #ffffff !important;
    border-radius: 8px;
    padding: 0.75rem 1rem;
    text-align: left;
    font-size: 0.9rem;
    font-weight: 600;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 0.7rem;
    transition: all 0.15s ease;
}

.yaml-quiz-btn:hover:not(:disabled) {
    background: #0f172a;
    border-color: #38bdf8;
    color: #38bdf8 !important;
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(56, 189, 248, 0.2);
}

.yaml-quiz-opt-tag {
    background: #0f172a;
    border: 1px solid #38bdf8;
    border-radius: 6px;
    font-weight: 800;
    font-size: 0.8rem;
    padding: 0.15rem 0.5rem;
    color: #38bdf8;
    flex-shrink: 0;
}

.yaml-quiz-btn.correct {
    background: #064e3b !important;
    border-color: #34d399 !important;
    color: #ffffff !important;
    font-weight: 800;
    box-shadow: 0 0 12px rgba(52, 211, 153, 0.35);
}

.yaml-quiz-btn.correct .yaml-quiz-opt-tag {
    background: #10b981;
    color: #ffffff;
    border-color: #34d399;
}

.yaml-quiz-btn.wrong {
    background: #7f1d1d !important;
    border-color: #f87171 !important;
    color: #ffffff !important;
    font-weight: 800;
}

.yaml-quiz-btn.wrong .yaml-quiz-opt-tag {
    background: #ef4444;
    color: #ffffff;
    border-color: #f87171;
}

.yaml-quiz-explain {
    margin-top: 1rem;
    padding: 0.85rem 1.15rem;
    background: #090e1a;
    border-left: 4px solid #38bdf8;
    border-radius: 0 8px 8px 0;
    font-size: 0.88rem;
    color: #e2e8f0 !important;
    line-height: 1.6;
    display: none;
}

.yaml-quiz-explain.visible {
    display: block;
    animation: yamlFade 0.2s ease-out;
}


