/* ============================= */
/* Base Container */
/* ============================= */

.markdown {
    color: #e4e4e7;
    line-height: 1.7;
    font-size: 0.95rem;
}

.markdown > :first-child {
    margin-top: 0;
}

.markdown > :last-child {
    margin-bottom: 0;
}

/* ============================= */
/* Headings */
/* ============================= */

.markdown h1,
.markdown h2,
.markdown h3,
.markdown h4,
.markdown h5,
.markdown h6 {
    font-weight: 700;
    line-height: 1.3;
    margin: 1.2em 0 0.5em;
    color: #34d399;
}

.markdown h1 {
    font-size: 1.8rem;
    border-bottom: 1px solid #27272a;
    padding-bottom: 0.3em;
}

.markdown h2 {
    font-size: 1.5rem;
    border-bottom: 1px solid #27272a;
    padding-bottom: 0.25em;
}

.markdown h3 {
    font-size: 1.25rem;
}

.markdown h4 {
    font-size: 1.1rem;
}

.markdown h5 {
    font-size: 1rem;
    opacity: 0.9;
}

.markdown h6 {
    font-size: 0.9rem;
    opacity: 0.7;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

/* ============================= */
/* Paragraphs */
/* ============================= */

.markdown p {
    margin: 0.8em 0;
}

/* ============================= */
/* Links */
/* ============================= */

.markdown a {
    color: #4ade80;
    text-decoration: none;
    border-bottom: 1px dotted #4ade80;
    transition: color 0.2s ease;
}

.markdown a:hover {
    color: #86efac;
    border-bottom-color: #86efac;
}

/* ============================= */
/* Lists */
/* ============================= */

.markdown ul,
.markdown ol {
    margin: 0.8em 0 0.8em 1.5rem;
    padding-left: 1rem;
}

.markdown ul {
    list-style: disc;
}

.markdown ul ul {
    list-style: circle;
}

.markdown ul ul ul {
    list-style: square;
}

.markdown ol {
    list-style: decimal;
}

.markdown li {
    margin: 0.35em 0;
}

/* Task lists */
.markdown input[type="checkbox"] {
    margin-right: 0.5rem;
}

/* ============================= */
/* Blockquotes */
/* ============================= */

.markdown blockquote {
    border-left: 4px solid #52525b;
    padding: 0.6em 1em;
    margin: 1em 0;
    background: #18181b;
    color: #a1a1aa;
    border-radius: 6px;
}

/* ============================= */
/* Alert Blocks / Admonitions */
/* ============================= */

.markdown .markdown-alert {
    padding: 0.8em 1em;
    margin: 1.2em 0;
    border-left: 4px solid;
    border-radius: 6px;
    background: #18181b;
    color: #e4e4e7;
}

.markdown .markdown-alert > :first-child {
    margin-top: 0;
}

.markdown .markdown-alert > :last-child {
    margin-bottom: 0;
}

.markdown .markdown-alert-title {
    display: flex;
    align-items: center;
    gap: 0.5em;
    font-weight: 700;
    font-size: 0.9rem;
    margin-bottom: 0.4em;
}

.markdown .markdown-alert-title svg {
    width: 16px;
    height: 16px;
    flex-shrink: 0;
    fill: currentColor;
}

.markdown .markdown-alert-note {
    border-left-color: #60a5fa;
}

.markdown .markdown-alert-note .markdown-alert-title {
    color: #60a5fa;
}

.markdown .markdown-alert-tip {
    border-left-color: #34d399;
}

.markdown .markdown-alert-tip .markdown-alert-title {
    color: #34d399;
}

.markdown .markdown-alert-important {
    border-left-color: #c084fc;
}

.markdown .markdown-alert-important .markdown-alert-title {
    color: #c084fc;
}

.markdown .markdown-alert-warning {
    border-left-color: #fbbf24;
}

.markdown .markdown-alert-warning .markdown-alert-title {
    color: #fbbf24;
}

.markdown .markdown-alert-caution {
    border-left-color: #f87171;
}

.markdown .markdown-alert-caution .markdown-alert-title {
    color: #f87171;
}

/* ============================= */
/* Abstract / Summary Container */
/* ============================= */

.markdown .abstract {
    padding: 0.8em 1em;
    margin: 1.2em 0;
    border-left: 4px solid #22d3ee;
    border-radius: 6px;
    background: #18181b;
    color: #e4e4e7;
}

.markdown .abstract::before {
    content: "Abstract";
    display: flex;
    align-items: center;
    gap: 0.5em;
    font-weight: 700;
    font-size: 0.9rem;
    margin-bottom: 0.4em;
    color: #22d3ee;
}

.markdown .abstract > :first-child {
    margin-top: 0;
}

.markdown .abstract > :last-child {
    margin-bottom: 0;
}

/* ============================= */
/* Horizontal Rule */
/* ============================= */

.markdown hr {
    border: none;
    border-top: 1px solid #27272a;
    margin: 2em 0;
}

/* ============================= */
/* Inline Code */
/* ============================= */

.markdown code {
    background: #27272a;
    padding: 3px 6px;
    border-radius: 5px;
    font-size: 0.85em;
    font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
    color: #facc15;
}

/* ============================= */
/* Code Blocks */
/* ============================= */

.markdown pre {
    background: #18181b;
    padding: 1rem;
    border-radius: 10px;
    overflow-x: auto;
    border: 1px solid #27272a;
    margin: 1.2em 0;
}

.markdown pre code {
    background: transparent;
    padding: 0;
    color: #e4e4e7;
}

/* Scrollbar styling */
.markdown pre::-webkit-scrollbar {
    height: 8px;
}

.markdown pre::-webkit-scrollbar-thumb {
    background: #3f3f46;
    border-radius: 4px;
}

/* ============================= */
/* Tables */
/* ============================= */

.markdown table {
    width: 100%;
    border-collapse: collapse;
    margin: 1.2em 0;
    font-size: 0.9rem;
}

.markdown th,
.markdown td {
    border: 1px solid #27272a;
    padding: 0.6em 0.8em;
}

.markdown th {
    background: #18181b;
    text-align: left;
    color: #34d399;
}

.markdown tr:nth-child(even) {
    background: #1f1f23;
}

/* ============================= */
/* Images */
/* ============================= */

.markdown img {
    max-width: 100%;
    border-radius: 8px;
    margin: 1em 0;
    border: 1px solid #27272a;
}

/* ============================= */
/* Definition Lists */
/* ============================= */

.markdown dt {
    font-weight: 600;
    margin-top: 1em;
}

.markdown dd {
    margin-left: 1.2rem;
    color: #a1a1aa;
}

/* ============================= */
/* Keyboard */
/* ============================= */

.markdown kbd {
    background: #27272a;
    border: 1px solid #3f3f46;
    border-radius: 4px;
    padding: 2px 6px;
    font-size: 0.8em;
    box-shadow: inset 0 -2px 0 #3f3f46;
}

/* ============================= */
/* Superscript / Subscript */
/* ============================= */

.markdown sup,
.markdown sub {
    font-size: 0.75em;
}

/* ============================= */
/* Details / Summary */
/* ============================= */

.markdown details {
    background: #18181b;
    border: 1px solid #27272a;
    padding: 0.8em;
    border-radius: 8px;
    margin: 1em 0;
}

.markdown summary {
    cursor: pointer;
    font-weight: 600;
    color: #34d399;
}

/* ============================= */
/* Footnotes */
/* ============================= */

.markdown .footnotes {
    margin-top: 2em;
    font-size: 0.85rem;
    color: #a1a1aa;
    border-top: 1px solid #27272a;
    padding-top: 1em;
}

/* ============================= */
/* Selection */
/* ============================= */

.markdown ::selection {
    background: #065f46;
    color: #ffffff;
}
