:root {
    --terminal-bg: #1a1a1a;
    --terminal-text: #00ff00;
    --terminal-prompt: #00ff00;
    --terminal-cursor: #00ff00;
    --terminal-link: #00ff00;
    --terminal-border: #333;
    --terminal-input-bg: #2a2a2a;
}

/* Terminal Theme */
.terminal-theme {
    background-color: var(--terminal-bg);
    color: var(--terminal-text);
    font-family: 'Courier New', monospace;
    line-height: 1.6;
}

/* Navigation */
.terminal-nav {
    border-bottom: 1px solid var(--terminal-border);
    padding: 1rem 0;
    margin-bottom: 2rem;
}

.terminal-brand {
    color: var(--terminal-text);
    text-decoration: none;
    font-weight: bold;
    font-size: 1.2rem;
}

.terminal-controls {
    display: flex;
    gap: 1rem;
    align-items: center;
}

/* Forms */
.terminal-form {
    max-width: 600px;
    margin: 0 auto;
    padding: 2rem;
    border: 1px solid var(--terminal-border);
    border-radius: 4px;
}

.terminal-input {
    background-color: var(--terminal-input-bg);
    border: 1px solid var(--terminal-border);
    color: var(--terminal-text);
    padding: 0.5rem;
    width: 100%;
    margin-bottom: 1rem;
}

/* Terminal Elements */
.prompt {
    color: var(--terminal-prompt);
    margin-right: 0.5rem;
}

.refresh-spinner {
    animation: spin 1s linear infinite;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

#refresh-content {
    background: transparent;
    border: 1px solid var(--terminal-text);
    color: var(--terminal-text);
    padding: 0.5rem 1rem;
    border-radius: 4px;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    transition: all 0.2s ease;
}

#refresh-content:hover {
    background: var(--terminal-text);
    color: var(--terminal-bg);
}

#refresh-content:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.cursor {
    display: inline-block;
    width: 8px;
    height: 1.2em;
    background-color: var(--terminal-cursor);
    animation: blink 1s infinite;
}

/* Topics Grid */
.topics-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 1.5rem;
    margin-top: 2rem;
}

.topic-card {
    border: 1px solid var(--terminal-border);
    padding: 1rem;
    border-radius: 4px;
}

/* Questions */
.question-card {
    border: 1px solid var(--terminal-border);
    margin-bottom: 1.5rem;
    padding: 1.5rem;
    border-radius: 4px;
    background: rgba(0, 0, 0, 0.2);
}

.question-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1rem;
    border-bottom: 1px solid var(--terminal-border);
    padding-bottom: 0.8rem;
}

.question-text {
    font-family: 'Courier New', monospace;
    color: var(--terminal-text);
    font-size: 1.1rem;
}

.answer-content {
    margin-top: 1.5rem;
    padding: 2rem;
    background: rgba(0, 0, 0, 0.3);
    border-radius: 4px;
    font-family: 'Courier New', monospace;
    line-height: 1.8;
    white-space: normal;
    border-left: 3px solid var(--terminal-text);
    position: relative;
}

.answer-content .answer-body {
    padding: 0.5rem;
}

.answer-content .answer-body p {
    margin-bottom: 1rem;
    line-height: 1.6;
}

.answer-content .answer-body ul,
.answer-content .answer-body ol {
    margin: 1rem 0;
    padding-left: 2rem;
}

.answer-content .answer-body li {
    margin: 0.5rem 0;
}

.answer-content .answer-body blockquote {
    margin: 1rem 0;
    padding-left: 1rem;
    border-left: 3px solid var(--terminal-text);
    color: #888;
}

.answer-content .answer-body pre {
    margin: 1.5rem 0;
    padding: 1.5rem;
    background: #1E1E1E;
    border-radius: 6px;
    overflow-x: auto;
    border: 1px solid #333;
    position: relative;
    font-size: 0.95em;
    line-height: 1.6;
    color: #D4D4D4;
    white-space: pre;
    font-family: 'Monaco', 'Consolas', 'Courier New', monospace;
}

.answer-content .answer-body pre code {
    background: transparent;
    border: none;
    padding: 0;
    color: inherit;
    white-space: pre;
    display: block;
}

.answer-content .answer-body ol {
    counter-reset: list-counter;
    list-style: none;
    padding-left: 2.5rem;
}

.answer-content .answer-body ol li {
    position: relative;
    margin: 1rem 0;
    padding-left: 1rem;
}

.answer-content .answer-body ol li::before {
    counter-increment: list-counter;
    content: counter(list-counter) ".";
    position: absolute;
    left: -2.5rem;
    width: 2rem;
    text-align: right;
    color: var(--terminal-text);
}

.answer-content .answer-body strong {
    color: #7CB342;
    font-weight: 600;
}

.terminal-output {
    font-family: 'Monaco', 'Consolas', 'Courier New', monospace;
    white-space: pre-wrap;
    padding: 1.5rem;
    background-color: #1a1a1a;
    border-radius: 4px;
    margin: 1rem 0;
    line-height: 1.6;
    position: relative;
    border: 1px solid #333;
    color: #00ff00;
}

.terminal-output pre {
    margin: 0;
    padding: 0;
    background: transparent;
    border: none;
}

.terminal-output code {
    display: block;
    padding-left: 1.5em;
    position: relative;
    color: inherit;
}

.terminal-output code:before {
    content: '$';
    position: absolute;
    left: 0;
    color: #00ff00;
    opacity: 0.8;
}

.code-block {
    position: relative;
    margin: 1.5rem 0;
    padding: 1.5rem;
    background: #272822;
    border-radius: 4px;
    border: 1px solid #333;
    overflow-x: auto;
}

.code-block.has-error {
    border-color: #ff5555;
}

.code-block .error-message {
    position: absolute;
    top: -1.2rem;
    right: 1rem;
    background: #ff5555;
    color: #fff;
    padding: 0.2rem 0.5rem;
    border-radius: 3px;
    font-size: 0.8em;
    z-index: 1;
}

.code-block .warning-line {
    background: rgba(255, 85, 85, 0.1);
    display: block;
    margin: 0 -1.5rem;
    padding: 0 1.5rem;
    border-left: 2px solid #ff5555;
}

/* Style for auto-formatted indicator */
.code-block .format-indicator {
    position: absolute;
    top: -1.2rem;
    left: 1rem;
    background: #50fa7b;
    color: #282a36;
    padding: 0.2rem 0.5rem;
    border-radius: 3px;
    font-size: 0.8em;
    opacity: 0.8;
}

.code-block pre {
    margin: 0;
    padding: 0;
    background: transparent;
    border: none;
}

.code-block code {
    font-family: 'Monaco', 'Consolas', 'Courier New', monospace;
    font-size: 0.95em;
    line-height: 1.6;
    color: #f8f8f2;
    display: block;
}

.code-block .highlight {
    background: transparent;
    padding: 0;
    margin: 0;
}

.code-block span {
    font-family: inherit;
}

.code-block:before {
    content: attr(data-lang);
    position: absolute;
    top: -12px;
    right: 10px;
    background: #1E1E1E;
    padding: 0 8px;
    font-size: 0.8em;
    color: #666;
    border: 1px solid #333;
    border-radius: 3px;
    text-transform: uppercase;
}

.code-block pre {
    margin: 0;
    padding: 0;
    background: transparent;
    border: none;
}

.code-block code {
    font-family: 'Monaco', 'Consolas', 'Courier New', monospace;
    font-size: 0.95em;
    line-height: 1.6;
    display: block;
    color: #f8f8f2;
}

.highlight {
    background: transparent;
    padding: 0;
    margin: 0;
    border: none;
}

.highlight pre {
    margin: 0;
    padding: 0;
}

.highlight code {
    padding: 0;
    font-size: inherit;
    color: inherit;
    background-color: transparent;
    border-radius: 0;
}

code:not(pre code) {
    color: #e6db74;
    background: #2d2d2d !important;
    padding: 0.2em 0.4em !important;
    border-radius: 3px !important;
    font-size: 0.9em !important;
    border: 1px solid #444 !important;
}

pre code {
    color: #abb2bf !important;
    background: transparent !important;
    border: none !important;
    padding: 0 !important;
    font-size: 0.95em !important;
    line-height: 1.6 !important;
}

.terminal-output code {
    color: #00ff00 !important;
    background: transparent !important;
    border: none !important;
    padding: 0 !important;
}

.language-javascript,
.language-python,
.language-bash,
.language-sh {
    color: #a6e22e !important;
}

.answer-content .answer-body pre {
    background: #1e1e1e;
    padding: 1.5rem;
    border-radius: 8px;
    margin: 2rem 0;
    overflow-x: auto;
    border: 1px solid #333;
    position: relative;
    box-shadow: 0 4px 6px rgba(0,0,0,0.1);
    max-width: 100%;
}

.code-block {
    margin: 0;
    padding: 0;
    background: transparent;
}

.answer-content .answer-body pre.code-block {
    position: relative;
    padding-top: 2rem;
}

.answer-content .answer-body pre.code-block::before {
    content: attr(data-lang);
    position: absolute;
    top: 0;
    right: 1rem;
    padding: 0.3rem 0.6rem;
    font-size: 0.8rem;
    color: #666;
    background: #333;
    border-radius: 0 0 4px 4px;
}

.answer-content .answer-body pre code {
    background: transparent;
    padding: 0;
    color: #abb2bf;
    display: block;
    line-height: 1.6;
    font-family: 'Monaco', 'Consolas', 'Courier New', monospace;
    font-size: 0.95em;
}

/* Syntax highlighting */
.highlight .k { color: #c678dd; } /* Keyword */
.highlight .s { color: #98c379; } /* String */
.highlight .n { color: #e06c75; } /* Name */
.highlight .o { color: #56b6c2; } /* Operator */
.highlight .p { color: #abb2bf; } /* Punctuation */
.highlight .c { color: #7f848e; font-style: italic; } /* Comment */

.answer-content .answer-body pre::before {
    content: 'code';
    position: absolute;
    top: -12px;
    left: 15px;
    background: var(--terminal-bg);
    padding: 0 10px;
    font-size: 0.8em;
    color: #666;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.answer-content .answer-body ul,
.answer-content .answer-body ol {
    margin: 1.2rem 0;
    padding-left: 2.5rem;
    list-style-position: outside;
}

.answer-content .answer-body ul li,
.answer-content .answer-body ol li {
    margin: 0.7rem 0;
    line-height: 1.6;
    padding-left: 0.5rem;
    position: relative;
}

.answer-content .answer-body ul li::marker {
    color: var(--terminal-text);
    content: "• ";
}

.answer-content .answer-body ol li::marker {
    color: var(--terminal-text);
}

.answer-content .answer-body p {
    margin: 1rem 0;
    line-height: 1.7;
    color: #d4d4d4;
}

.answer-content .answer-body strong {
    color: #fff;
    font-weight: bold;
}

.answer-content .answer-body em {
    font-style: italic;
    color: #b3e5fc;
}

.language-javascript,
.language-python,
.language-bash,
.language-sh {
    color: #a6e22e !important;
}

.answer-content::before {
    content: '$>';
    position: absolute;
    left: -2.5rem;
    top: 1rem;
    color: var(--terminal-text);
    opacity: 0.7;
}

.answer-content code {
    background: var(--terminal-input-bg);
    padding: 0.3rem 0.6rem;
    border-radius: 3px;
    font-family: 'Courier New', monospace;
    margin: 0 0.2rem;
    color: #ffeb3b;
}

.answer-content pre {
    background: var(--terminal-input-bg);
    padding: 1.2rem;
    border-radius: 4px;
    overflow-x: auto;
    margin: 1.2rem 0;
    border: 1px solid var(--terminal-border);
    position: relative;
}

.answer-content pre::before {
    content: 'code:';
    position: absolute;
    top: -0.8rem;
    left: 1rem;
    background: var(--terminal-bg);
    padding: 0 0.5rem;
    color: var(--terminal-text);
    font-size: 0.9rem;
    opacity: 0.8;
}

.toggle-answer {
    background: var(--terminal-input-bg);
    color: var(--terminal-text);
    border: 1px solid var(--terminal-border);
    padding: 0.6rem 1.2rem;
    border-radius: 4px;
    cursor: pointer;
    font-family: 'Courier New', monospace;
    transition: all 0.2s ease;
    position: relative;
    overflow: hidden;
}

.toggle-answer:hover {
    background: var(--terminal-text);
    color: var(--terminal-bg);
    transform: translateY(-1px);
    box-shadow: 0 2px 4px rgba(0,0,0,0.2);
}

.toggle-answer:active {
    transform: translateY(0);
    box-shadow: none;
}

.toggle-answer::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 2px;
    background: var(--terminal-text);
    transition: all 0.3s ease;
}

.toggle-answer:hover::before {
    left: 0;
}

/* Progress Bar */
.progress {
    background-color: var(--terminal-input-bg);
    height: 0.5rem;
    border-radius: 4px;
    overflow: hidden;
}

.progress-bar {
    background-color: var(--terminal-prompt);
    transition: width 0.3s ease;
}

/* Animations */
@keyframes blink {
    0%, 100% { opacity: 1; }
    50% { opacity: 0; }
}

/* Dark/Light Mode Toggle */
.dark-mode {
    --terminal-bg: #1a1a1a;
    --terminal-text: #00ff00;
}

.light-mode {
    --terminal-bg: #f4f4f4;
    --terminal-text: #333;
    --terminal-prompt: #0066cc;
    --terminal-cursor: #333;
    --terminal-border: #ddd;
    --terminal-input-bg: #fff;
}

/* Responsive Design */
/* Footer Styles */
.terminal-footer {
    border-top: 1px solid var(--terminal-border);
    padding: 2rem 0;
    margin-top: 3rem;
}

.terminal-footer p {
    margin-bottom: 0.5rem;
}

.terminal-footer .terminal-link {
    color: var(--terminal-text);
    text-decoration: none;
    border-bottom: 1px dashed var(--terminal-text);
}

.terminal-footer .terminal-link:hover {
    opacity: 0.8;
}

@media (max-width: 768px) {
    .topics-grid {
        grid-template-columns: 1fr;
    }

    .terminal-nav {
        padding: 0.5rem;
    }

    .terminal-controls {
        flex-wrap: wrap;
    }
}

/* Kubernetes Troubleshooting Scenarios Styles */
.scenario {
    background: #1e1e1e;
    border-radius: 8px;
    padding: 20px;
    margin-bottom: 20px;
}

.scenario-header {
    display: flex;
    justify-content: space-between;
    margin-bottom: 15px;
}

.scenario-header span {
    background: #2d2d2d;
    padding: 5px 10px;
    border-radius: 4px;
    font-size: 0.9em;
}

.scenario-summary {
    background: #2d2d2d;
    padding: 15px;
    border-radius: 4px;
    margin-bottom: 20px;
}

.scenario-details h4 {
    color: #4ec9b0;
    margin: 20px 0 10px;
}

.scenario-details .content {
    background: #2d2d2d;
    padding: 15px;
    border-radius: 4px;
    margin-bottom: 10px;
}

.scenario-details .content ul {
    margin: 0;
    padding-left: 20px;
}

.scenario-details .content li {
    margin-bottom: 8px;
}

/* Code block styling */
.scenario pre {
    background: #1a1a1a !important;
    padding: 15px;
    border-radius: 4px;
    margin: 10px 0;
    overflow-x: auto;
}

.scenario code {
    font-family: 'Fira Code', monospace;
    font-size: 0.9em;
    line-height: 1.4;
}

/* Syntax highlighting */
.language-bash { color: #d4d4d4; }
.language-python { color: #9cdcfe; }
.language-yaml { color: #ce9178; }
.language-json { color: #d7ba7d; }

/* Inline code */
.scenario p code {
    background: #1a1a1a;
    padding: 2px 5px;
    border-radius: 3px;
}

/* Lists */
.scenario ul {
    list-style-type: disc;
    margin-left: 20px;
}

.scenario ol {
    list-style-type: decimal;
    margin-left: 20px;
}

/* Links in scenarios */
.scenario a {
    color: #569cd6;
    text-decoration: none;
}

.scenario a:hover {
    text-decoration: underline;
}

.terminal-card {
    background-color: var(--terminal-bg);
    border: 1px solid var(--terminal-border);
    padding: 2rem;
    margin-bottom: 1.5rem;
    border-radius: 4px;
    font-family: 'Courier New', monospace;
}

.terminal-card pre {
    background-color: rgba(0, 0, 0, 0.2);
    padding: 1.5rem;
    border-radius: 4px;
    overflow-x: auto;
    margin: 1rem 0;
}

.terminal-card code {
    font-family: 'Courier New', monospace;
    color: var(--terminal-text);
    line-height: 1.6;
}

.terminal-card output {
    display: block;
    padding: 1.5rem;
    background-color: rgba(0, 0, 0, 0.1);
    border-radius: 4px;
    margin: 1rem 0;
    white-space: pre-wrap;
}

.terminal-output {
    font-family: 'Monaco', 'Consolas', 'Courier New', monospace;
    white-space: pre-wrap;
    padding: 1.5rem;
    background-color: var(--terminal-input-bg);
    border-radius: 4px;
    margin: 1rem 0;
    line-height: 1.6;
    position: relative;
    border: 1px solid var(--terminal-border);
}

.terminal-output pre,
.answer-content pre {
    background-color: #1E1E1E;
    padding: 1.5rem;
    border-radius: 4px;
    margin: 1rem 0;
    overflow-x: auto;
    border: 1px solid #333;
    position: relative;
}

.terminal-output pre code,
.answer-content pre code {
    font-family: 'Monaco', 'Consolas', 'Courier New', monospace;
    font-size: 0.95em;
    line-height: 1.6;
    tab-size: 4;
}

/* Syntax highlighting - Monokai theme */
.highlight .hll { background-color: #49483e }
.highlight { background: #272822; color: #f8f8f2; border-radius: 4px; padding: 1em; margin: 0.5em 0; }
.highlight .c { color: #75715e } /* Comment */
.highlight .err { color: #960050; background-color: #1e0010 } /* Error */
.highlight .k { color: #66d9ef } /* Keyword */
.highlight .l { color: #ae81ff } /* Literal */
.highlight .n { color: #f8f8f2 } /* Name */
.highlight .o { color: #f92672 } /* Operator */
.highlight .p { color: #f8f8f2 } /* Punctuation */
.highlight .cm { color: #75715e } /* Comment.Multiline */
.highlight .cp { color: #75715e } /* Comment.Preproc */
.highlight .c1 { color: #75715e } /* Comment.Single */
.highlight .cs { color: #75715e } /* Comment.Special */
.highlight .ge { font-style: italic } /* Generic.Emph */
.highlight .gs { font-weight: bold } /* Generic.Strong */
.highlight .kc { color: #66d9ef } /* Keyword.Constant */
.highlight .kd { color: #66d9ef } /* Keyword.Declaration */
.highlight .kn { color: #f92672 } /* Keyword.Namespace */
.highlight .kp { color: #66d9ef } /* Keyword.Pseudo */
.highlight .kr { color: #66d9ef } /* Keyword.Reserved */
.highlight .kt { color: #66d9ef } /* Keyword.Type */
.highlight .ld { color: #e6db74 } /* Literal.Date */
.highlight .m { color: #ae81ff } /* Literal.Number */
.highlight .s { color: #e6db74 } /* Literal.String */
.highlight .na { color: #a6e22e } /* Name.Attribute */
.highlight .nb { color: #f8f8f2 } /* Name.Builtin */
.highlight .nc { color: #a6e22e } /* Name.Class */
.highlight .no { color: #66d9ef } /* Name.Constant */
.highlight .nd { color: #a6e22e } /* Name.Decorator */
.highlight .ni { color: #f8f8f2 } /* Name.Entity */
.highlight .ne { color: #a6e22e } /* Name.Exception */
.highlight .nf { color: #a6e22e } /* Name.Function */
.highlight .nl { color: #f8f8f2 } /* Name.Label */
.highlight .nn { color: #f8f8f2 } /* Name.Namespace */
.highlight .nx { color: #a6e22e } /* Name.Other */
.highlight .py { color: #f8f8f2 } /* Name.Property */
.highlight .nt { color: #f92672 } /* Name.Tag */
.highlight .nv { color: #f8f8f2 } /* Name.Variable */
.highlight .ow { color: #f92672 } /* Operator.Word */
.highlight .w { color: #f8f8f2 } /* Text.Whitespace */
.highlight .mf { color: #ae81ff } /* Literal.Number.Float */
.highlight .mh { color: #ae81ff } /* Literal.Number.Hex */
.highlight .mi { color: #ae81ff } /* Literal.Number.Integer */
.highlight .mo { color: #ae81ff } /* Literal.Number.Oct */
.highlight .sb { color: #e6db74 } /* Literal.String.Backtick */
.highlight .sc { color: #e6db74 } /* Literal.String.Char */
.highlight .sd { color: #e6db74 } /* Literal.String.Doc */
.highlight .s2 { color: #e6db74 } /* Literal.String.Double */
.highlight .se { color: #ae81ff } /* Literal.String.Escape */
.highlight .sh { color: #e6db74 } /* Literal.String.Heredoc */
.highlight .si { color: #e6db74 } /* Literal.String.Interpol */
.highlight .sx { color: #e6db74 } /* Literal.String.Other */
.highlight .sr { color: #e6db74 } /* Literal.String.Regex */
.highlight .s1 { color: #e6db74 } /* Literal.String.Single */
.highlight .ss { color: #e6db74 } /* Literal.String.Symbol */
.highlight .bp { color: #f8f8f2 } /* Name.Builtin.Pseudo */
.highlight .vc { color: #f8f8f2 } /* Name.Variable.Class */
.highlight .vg { color: #f8f8f2 } /* Name.Variable.Global */
.highlight .vi { color: #f8f8f2 } /* Name.Variable.Instance */
.highlight .il { color: #ae81ff } /* Literal.Number.Integer.Long */

/* List formatting */
.answer-content ul,
.answer-content ol {
    padding-left: 2.5rem;
    margin: 1.2rem 0;
    list-style-position: outside;
}

.answer-content li {
    margin: 0.8rem 0;
    line-height: 1.6;
    padding-left: 0.5rem;
    color: #d4d4d4;
}

.answer-content ul {
    list-style: none;
}

.answer-content ul li {
    position: relative;
}

.answer-content ul li::before {
    content: "•";
    color: #00ff00;
    position: absolute;
    left: -1.5rem;
    font-size: 1.2em;
}

.answer-content ol {
    counter-reset: item;
}

.answer-content ol li {
    position: relative;
}

.answer-content ol {
    counter-reset: item;
    list-style: none;
    padding-left: 3rem;
}

.answer-content ol li {
    counter-increment: item;
    position: relative;
    padding-left: 1rem;
    margin: 0.8rem 0;
}

.answer-content ol li::before {
    content: counter(item) ".";
    color: #00ff00;
    position: absolute;
    left: -2rem;
    width: 1.5rem;
    text-align: right;
    font-weight: bold;
}

.answer-content ul li::before {
    content: "•";
    color: var(--terminal-text);
    display: inline-block;
    width: 1em;
    margin-left: -1em;
}

.answer-content ol {
    counter-reset: item;
}

.answer-content ol li {
    counter-increment: item;
    position: relative;
}

.answer-content ol li::before {
    content: counter(item) ".";
    color: var(--terminal-text);
    position: absolute;
    left: -2rem;
    width: 1.5rem;
    text-align: right;
}

.terminal-output .prompt {
    color: var(--terminal-prompt);
    margin-right: 0.5rem;
}

.terminal-output pre {
    margin: 1rem 0;
    padding: 1rem;
    background-color: rgba(0, 0, 0, 0.2);
    border-radius: 4px;
    overflow-x: auto;
}

.terminal-output code {
    display: block;
    padding-left: 2rem;
    position: relative;
}

.terminal-output code:before {
    content: '$';
    position: absolute;
    left: 0.5rem;
    color: var(--terminal-prompt);
}