:root {
    --bg-color: #f4f4f4;
    --text-color: #333;
    --header-bg: #333;
    --header-text: #fff;
    --article-bg: #fff;
    --code-bg: #2b2b2b;
    --link-color: #ffb347;
}

body {
    font-family: Arial, sans-serif;
    margin: 0;
    padding: 0;
    line-height: 1.6;
    color: var(--text-color);
    background-color: var(--bg-color);
    transition: background-color 0.3s, color 0.3s;
}

body.dark {
    --bg-color: #333;
    --text-color: #f4f4f4;
    --header-bg: #f4f4f4;
    --header-text: #333;
    --article-bg: #333;
    --code-bg: #555;
    --link-color: #ffeb3b;
}

a {
    color: var(--link-color);
    text-decoration: none;
    transition: 0.3s;
}

a:hover {
    opacity: 0.8;
}

header {
    background-color: var(--header-bg);
    color: var(--header-text);
    padding: 1rem;
    text-align: center;
    position: relative;
}

#theme-toggle {
    position: absolute;
    top: 10px;
    right: 10px;
    background: var(--article-bg);
    color: var(--text-color);
    border: 1px solid var(--text-color);
    padding: 0.5rem;
    cursor: pointer;
    border-radius: 5px;
}

header h1 {
    margin: 0;
}

header a {
    color: var(--header-text);
    text-decoration: none;
}

main {
    width: 100%;
    margin: 0;
    padding: 1rem;
    background-color: var(--article-bg);
}

article {
    max-width: 1200px;
    margin: 0 auto 2rem auto;
    padding: 0 1rem;
}

article h1, article h2, article h3 {
    color: var(--text-color);
}

footer {
    text-align: center;
    padding: 1rem;
    background-color: var(--header-bg);
    color: var(--header-text);
}

.social-links {
    margin-top: 1rem;
}

.social-links a {
    color: var(--header-text);
    margin: 0 0.5rem;
    font-size: 1.5rem;
    transition: 0.3s;
}

.social-links a:hover {
    opacity: 0.7;
}

dt {
    font-weight: bold;
    margin-bottom: 0.5rem;
}

dd {
    margin-left: 1rem;
    margin-bottom: 1rem;
}

code {
    background-color: #2b2b2b;
    color: #f8f8f2;
    padding: 0.2rem 0.4rem;
    border-radius: 3px;
    font-family: 'Courier New', monospace;
}

pre {
    background-color: #2b2b2b;
    color: #f8f8f2;
    padding: 1rem;
    border-radius: 5px;
    overflow-x: auto;
    font-family: 'Courier New', monospace;
    line-height: 1.4;
    border: 1px solid #444;
}

pre::before {
    content: "Terminal";
    position: absolute;
    top: -25px;
    left: 80px;
    background: #2b2b2b;
    color: #f8f8f2;
    padding: 2px 8px;
    border-radius: 5px 5px 0 0;
    font-size: 0.8rem;
    font-weight: bold;
}

/* Pygments syntax highlighting (dark theme) */
.highlight {
    background: #2b2b2b;
    border-radius: 5px;
    border: 1px solid #444;
    margin: 1rem 0;
}

.highlight pre {
    background: none;
    padding: 1rem;
    margin: 0;
    color: #f8f8f2;
}

.highlight .c { color: #75715e; } /* Comment */
.highlight .k { color: #66d9ef; font-weight: bold; } /* Keyword */
.highlight .s { color: #e6db74; } /* String */
.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; font-style: italic; } /* Comment.Special */
.highlight .kd { color: #66d9ef; font-weight: bold; } /* Keyword.Declaration */
.highlight .kn { color: #66d9ef; font-weight: bold; } /* Keyword.Namespace */
.highlight .kp { color: #66d9ef; } /* Keyword.Pseudo */
.highlight .kr { color: #66d9ef; font-weight: bold; } /* Keyword.Reserved */
.highlight .kt { color: #66d9ef; font-weight: bold; } /* Keyword.Type */
.highlight .m { color: #ae81ff; } /* Literal.Number */
.highlight .s1 { color: #e6db74; } /* Literal.String.Single */
.highlight .s2 { color: #e6db74; } /* Literal.String.Double */
.highlight .se { color: #e6db74; } /* 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 .ss { color: #e6db74; } /* Literal.String.Symbol */
.highlight .bp { color: #f8f8f2; } /* Name.Builtin.Pseudo */
.highlight .vc { color: #f92672; } /* Name.Variable.Class */
.highlight .vg { color: #f92672; } /* Name.Variable.Global */
.highlight .vi { color: #f92672; } /* Name.Variable.Instance */
.highlight .il { color: #ae81ff; } /* Literal.Number.Integer.Long */

/* Responsive */
@media (max-width: 600px) {
    main {
        padding: 0.5rem;
    }
    header, footer {
        padding: 0.5rem;
    }
}