/* Dark theme markdown styles - Based on MakerNeo */

/* Font imports */
@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700&family=JetBrains+Mono:wght@400;500&display=swap');

/* Global H1 gradient style */
h1 {
    font-weight: 700;
    line-height: 1.3;
    background: linear-gradient(90deg, #4ade80, #a3e635);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    -moz-background-clip: text;
    -moz-text-fill-color: transparent;
    background-clip: text;
    color: transparent;
}

/* H1 without gradient (for special cases like logo) */
h1.no-gradient {
    background: none;
    -webkit-background-clip: unset;
    -webkit-text-fill-color: unset;
    -moz-background-clip: unset;
    -moz-text-fill-color: unset;
    background-clip: unset;
    color: inherit;
}

/* Banner H1 override - white glass effect */
h1.banner-title {
    background: none;
    -webkit-background-clip: unset;
    -webkit-text-fill-color: #fff;
    -moz-background-clip: unset;
    -moz-text-fill-color: #fff;
    background-clip: unset;
    color: #fff;
    text-shadow: 0 0 40px rgba(255,255,255,0.5), 0 0 80px rgba(255,255,255,0.3);
}

/* Global link styles */
a {
    color: #4ade80;
    text-decoration: none;
    position: relative;
    transition: color 0.3s ease;
}

a:hover {
    color: #86efac;
}

/* Link underline effect - exclude nav, buttons, images, etc. */
.markdown-body a::after,
.article-container a:not(.no-underline):not(nav a):not(button a):not([class*="btn"]):not(:has(img))::after {
    content: '';
    position: absolute;
    width: 100%;
    height: 1px;
    bottom: 0;
    left: 0;
    background: linear-gradient(90deg, #4ade80, #a3e635);
    transform: scaleX(0);
    transform-origin: bottom right;
    transition: transform 0.3s ease;
}

.markdown-body a:hover::after,
.article-container a:not(.no-underline):not(nav a):not(button a):not([class*="btn"]):not(:has(img)):hover::after {
    transform: scaleX(1);
    transform-origin: bottom left;
}

/* Base markdown body */
.markdown-body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
    color: #e2e8f0;
    line-height: 1.8;
    font-size: 1.05rem;
    overflow-wrap: break-word;
    padding: 1.5rem;
    max-width: 100%;
    background-color: rgba(17, 24, 39, 0.4);
    border-radius: 0.5rem;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
}

.markdown-body::before {
    display: table;
    content: "";
}

.markdown-body::after {
    display: table;
    clear: both;
    content: "";
}

.markdown-body > *:first-child {
    margin-top: 0 !important;
}

.markdown-body > *:last-child {
    margin-bottom: 0 !important;
}

/* Typography & Rhythm */
.markdown-body h2,
.markdown-body h3,
.markdown-body h4,
.markdown-body h5,
.markdown-body h6 {
    font-weight: 700;
    line-height: 1.3;
    margin: 2.75rem 0 1.5rem;
    color: #fff;
    letter-spacing: -0.025em;
}

/* H1 with gradient effect */
.markdown-body h1 {
    font-size: 2.5rem;
    font-weight: 700;
    line-height: 1.3;
    margin: 20px 0 1.5rem;
    letter-spacing: -0.025em;
    background: linear-gradient(90deg, #4ade80, #a3e635);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    -moz-background-clip: text;
    -moz-text-fill-color: transparent;
    background-clip: text;
    color: transparent;
    position: relative;
    display: inline-block;
}

.markdown-body h1::after {
    content: '';
    position: absolute;
    bottom: -0.5rem;
    left: 0;
    height: 3px;
    width: 50%;
    background: linear-gradient(90deg, #4ade80, #a3e635);
    border-radius: 1rem;
}

.markdown-body h2 {
    font-size: 1.9rem;
    padding-bottom: 0.5rem;
    position: relative;
}

.markdown-body h2::before {
    content: '#';
    position: absolute;
    left: -1.5rem;
    color: #4ade80;
    font-weight: 700;
    opacity: 0.6;
}

.markdown-body h3 {
    font-size: 1.5rem;
    color: #a3e635;
}

.markdown-body h4 {
    font-size: 1.25rem;
    color: #86efac;
}

.markdown-body h5 {
    font-size: 1.1rem;
    color: #f9a8d4;
}

.markdown-body h6 {
    font-size: 1rem;
    color: #d8b4fe;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

/* Spacing and Content Flow */
.markdown-body p {
    margin: 1.5rem 0;
    line-height: 1.85;
}

.markdown-body p:first-of-type {
    font-size: 1.1em;
}

/* Links with hover effects */
.markdown-body a {
    color: #4ade80;
    text-decoration: none;
    position: relative;
    padding: 0 2px;
    font-weight: 500;
    transition: color 0.3s ease;
}

.markdown-body a::after {
    content: '';
    position: absolute;
    width: 100%;
    height: 1px;
    bottom: 0;
    left: 0;
    background: linear-gradient(90deg, #4ade80, #a3e635);
    transform: scaleX(0);
    transform-origin: bottom right;
    transition: transform 0.3s ease;
}

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

.markdown-body a:hover::after {
    transform: scaleX(1);
    transform-origin: bottom left;
}

/* Lists with custom bullets */
.markdown-body ul {
    list-style: none;
    padding-left: 1.5rem;
    margin: 1.5rem 0;
}

.markdown-body ul li {
    position: relative;
    margin-bottom: 0.75rem;
    padding-left: 1.25rem;
}

.markdown-body ul li::before {
    content: '•';
    position: absolute;
    left: 0;
    color: #4ade80;
    font-weight: bold;
    font-size: 1.2em;
}

.markdown-body ul ul li::before {
    content: '◦';
    color: #a3e635;
}

.markdown-body ul ul ul li::before {
    content: '▪';
    color: #f9a8d4;
}

/* Ordered lists with gradient numbers */
.markdown-body ol {
    list-style: none;
    counter-reset: item;
    padding-left: 1.5rem;
    margin: 1.5rem 0;
}

.markdown-body ol li {
    counter-increment: item;
    position: relative;
    margin-bottom: 0.75rem;
    padding-left: 1.25rem;
}

.markdown-body ol li::before {
    content: counter(item) ".";
    position: absolute;
    left: -1rem;
    font-weight: 600;
    background: linear-gradient(90deg, #4ade80, #a3e635);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

/* Blockquotes */
.markdown-body blockquote {
    border-left: 4px solid #4ade80;
    border-radius: 0.375rem;
    padding: 1rem 1.5rem;
    margin: 2rem 0;
    background: rgba(74, 85, 104, 0.3);
    position: relative;
    font-style: italic;
    color: #cbd5e0;
}

.markdown-body blockquote::before {
    content: '"';
    font-size: 4rem;
    position: absolute;
    left: 0.5rem;
    top: -1rem;
    color: rgba(74, 222, 128, 0.2);
    font-family: Georgia, serif;
}

.markdown-body blockquote p {
    margin: 0.5rem 0;
}

.markdown-body blockquote cite {
    display: block;
    margin-top: 1rem;
    font-size: 0.875rem;
    color: #a0aec0;
    font-style: normal;
}

/* Code blocks with modern styling */
.markdown-body pre {
    background: rgba(22, 27, 34, 0.9);
    border-radius: 0.5rem;
    border: 1px solid rgba(74, 85, 104, 0.5);
    padding: 1.25rem;
    margin: 1.75rem 0;
    overflow-x: auto;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.2);
    position: relative;
}

.markdown-body pre::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 32px;
    background: linear-gradient(180deg, rgba(74, 222, 128, 0.1) 0%, transparent 100%);
    border-radius: 0.5rem 0.5rem 0 0;
    pointer-events: none;
}

.markdown-body code {
    font-family: 'JetBrains Mono', 'Fira Code', Consolas, Monaco, 'Andale Mono', monospace;
    font-size: 0.9em;
    padding: 0.2rem 0.4rem;
    background: rgba(74, 85, 104, 0.3);
    border-radius: 0.25rem;
    color: #f9a8d4;
    font-weight: 500;
}

.markdown-body pre code {
    background: none;
    color: #e2e8f0;
    padding: 0;
    font-size: 0.95rem;
    line-height: 1.7;
    display: block;
}

/* Table styling */
.markdown-body table {
    width: 100%;
    margin: 2rem 0;
    border-collapse: separate;
    border-spacing: 0;
    border-radius: 0.5rem;
    overflow: hidden;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
    display: table;
}

.markdown-body thead {
    background: linear-gradient(90deg, rgba(74, 222, 128, 0.1), rgba(163, 230, 53, 0.1));
}

.markdown-body th {
    text-align: left;
    padding: 1rem;
    font-weight: 600;
    color: #fff;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    font-size: 0.875rem;
    border-bottom: 2px solid rgba(74, 222, 128, 0.3);
}

.markdown-body td {
    padding: 1rem;
    border-bottom: 1px solid rgba(74, 85, 104, 0.2);
    vertical-align: top;
}

.markdown-body tr:last-child td {
    border-bottom: none;
}

.markdown-body tr:hover {
    background-color: rgba(74, 85, 104, 0.1);
    transition: background-color 0.2s ease;
}

/* Images */
.markdown-body img {
    max-width: 100%;
    height: auto;
    border-radius: 0.5rem;
    margin: 2rem auto;
    display: block;
    box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
    transition: transform 0.3s ease;
}

.markdown-body img:hover {
    transform: scale(1.01);
}

/* Horizontal rule */
.markdown-body hr {
    border: 0;
    height: 3px;
    margin: 3rem 0;
    background-image: linear-gradient(to right, rgba(74, 222, 128, 0.2), rgba(74, 222, 128, 0.6), rgba(163, 230, 53, 0.6), rgba(163, 230, 53, 0.2));
    border-radius: 1rem;
}

/* Notes and callouts */
.markdown-body .note,
.markdown-body .warning,
.markdown-body .info,
.markdown-body .tip {
    padding: 1.25rem 1.5rem 1.25rem 4rem;
    margin: 2rem 0;
    border-radius: 0.5rem;
    position: relative;
}

.markdown-body .note {
    background-color: rgba(74, 222, 128, 0.1);
    border-left: 4px solid #4ade80;
}

.markdown-body .warning {
    background-color: rgba(251, 113, 133, 0.1);
    border-left: 4px solid #fb7185;
}

.markdown-body .info {
    background-color: rgba(163, 230, 53, 0.1);
    border-left: 4px solid #a3e635;
}

.markdown-body .tip {
    background-color: rgba(52, 211, 153, 0.1);
    border-left: 4px solid #34d399;
}

.markdown-body .note::before,
.markdown-body .warning::before,
.markdown-body .info::before,
.markdown-body .tip::before {
    position: absolute;
    left: 1.25rem;
    top: 1rem;
    font-size: 1.5rem;
}

.markdown-body .note::before {
    content: '📝';
}

.markdown-body .warning::before {
    content: '⚠️';
}

.markdown-body .info::before {
    content: 'ℹ️';
}

.markdown-body .tip::before {
    content: '💡';
}

/* Task lists */
.markdown-body .task-list-item {
    list-style-type: none;
    margin-left: -1.5rem;
}

.markdown-body input[type="checkbox"] {
    margin-right: 0.5rem;
}

/* Keyboard shortcuts */
.markdown-body kbd {
    background-color: #2d3748;
    border: 1px solid #4a5568;
    border-radius: 0.25rem;
    box-shadow: 0 1px 0 1px rgba(0, 0, 0, 0.2);
    color: #e2e8f0;
    display: inline-block;
    font-size: 0.85em;
    font-family: 'JetBrains Mono', 'Fira Code', monospace;
    line-height: 1;
    padding: 0.25rem 0.5rem;
    vertical-align: middle;
    margin: 0 0.25rem;
}

/* Definition lists */
.markdown-body dl {
    margin: 1.5rem 0;
}

.markdown-body dt {
    font-weight: 700;
    color: #86efac;
    margin-top: 1rem;
}

.markdown-body dd {
    margin-left: 1.5rem;
    color: #cbd5e0;
}

/* Strong and emphasis */
.markdown-body strong {
    font-weight: 600;
    color: #fff;
}

.markdown-body em {
    font-style: italic;
}

/* Mark/Highlight */
.markdown-body mark {
    background-color: rgba(210, 153, 34, 0.4);
    color: #e6edf3;
    padding: 0.1em 0.2em;
    border-radius: 3px;
}

/* Abbreviations */
.markdown-body abbr[title] {
    border-bottom: 1px dotted #8b949e;
    text-decoration: none;
    cursor: help;
}

/* Subscript and superscript */
.markdown-body sub,
.markdown-body sup {
    font-size: 75%;
    line-height: 0;
    position: relative;
    vertical-align: baseline;
}

.markdown-body sub {
    bottom: -0.25em;
}

.markdown-body sup {
    top: -0.5em;
}

/* Details/Summary */
.markdown-body details {
    margin-bottom: 16px;
}

.markdown-body details summary {
    cursor: pointer;
    color: #4ade80;
}

.markdown-body details summary:hover {
    text-decoration: underline;
}

/* Animation for elements */
@keyframes pulse {
    0% { box-shadow: 0 0 0 0 rgba(74, 222, 128, 0.4); }
    70% { box-shadow: 0 0 0 10px rgba(74, 222, 128, 0); }
    100% { box-shadow: 0 0 0 0 rgba(74, 222, 128, 0); }
}

/* Responsive adjustments */
@media (max-width: 768px) {
    .markdown-body {
        padding: 1rem;
        font-size: 1rem;
    }

    .markdown-body h1 {
        font-size: 2rem;
    }

    .markdown-body h2 {
        font-size: 1.6rem;
    }

    .markdown-body h3 {
        font-size: 1.3rem;
    }

    .markdown-body pre {
        padding: 1rem;
    }
}
