/* Minimal Dark Theme for Developer 2.0 */

/* CSS Reset & Base */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

:root {
    --bg-primary: #1a1a1a;
    --bg-secondary: #252525;
    --text-primary: #e0e0e0;
    --text-secondary: #a0a0a0;
    --accent: #4a9eff;
    --accent-hover: #6bb0ff;
    --border: #333;
    --code-bg: #1a1a1a;
    --warning: #ff6b6b;
    --info: #4a9eff;
    --question: #64b5f6;
}

html {
    font-size: 16px;
}

body {
    background-color: var(--bg-primary);
    color: var(--text-primary);
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Oxygen-Sans, Ubuntu, Cantarell, sans-serif;
    line-height: 1.6;
    min-height: 100vh;
}

/* Typography */
h1, h2, h3, h4, h5, h6 {
    color: var(--text-primary);
    margin: 1.5em 0 0.5em;
    line-height: 1.3;
}

h1 { font-size: 2rem; }
h2 { font-size: 1.5rem; }
h3 { font-size: 1.25rem; }
h4 { font-size: 1.1rem; }

p {
    margin-bottom: 1rem;
}

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

a:hover {
    color: var(--accent-hover);
    text-decoration: underline;
}

/* Navigation */
.nav {
    background-color: var(--bg-secondary);
    padding: 1rem 0;
    border-bottom: 1px solid var(--border);
}

.nav-container {
    max-width: 900px;
    margin: 0 auto;
    padding: 0 1rem;
}

.post-title {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: 1rem;
}

.navbar {
    display: flex;
    flex-wrap: wrap;
    gap: 1rem;
    align-items: center;
    justify-content: center;
}

.navbar a {
    color: var(--text-secondary);
    padding: 0.5rem;
    transition: color 0.2s;
}

.navbar a:hover {
    color: var(--accent);
    text-decoration: none;
}

/* Dropdown */
.dropdown {
    position: relative;
}

.dropbtn {
    background: none;
    border: none;
    color: var(--text-secondary);
    padding: 0.5rem;
    cursor: pointer;
    font-size: 1rem;
    font-family: inherit;
}

.dropbtn:hover {
    color: var(--accent);
}

.dropdown-content {
    display: none;
    position: absolute;
    background-color: var(--bg-secondary);
    min-width: 160px;
    border: 1px solid var(--border);
    z-index: 100;
    top: 100%;
    left: 0;
}

.dropdown-content a {
    display: block;
    padding: 0.75rem 1rem;
    color: var(--text-secondary);
}

.dropdown-content a:hover {
    background-color: var(--bg-primary);
    color: var(--accent);
}

.dropdown:hover .dropdown-content {
    display: block;
}

/* Search */
.search {
    position: relative;
}

.autocomplete {
    position: relative;
}

.autocomplete input {
    background-color: var(--bg-primary);
    border: 1px solid var(--border);
    color: var(--text-primary);
    padding: 0.5rem;
    font-size: 0.9rem;
    width: 200px;
}

.autocomplete input:focus {
    outline: none;
    border-color: var(--accent);
}

.autocomplete-items {
    position: absolute;
    background-color: var(--bg-secondary);
    border: 1px solid var(--border);
    z-index: 99;
    top: 100%;
    left: 0;
    right: 0;
}

.autocomplete-items div {
    padding: 0.75rem;
    cursor: pointer;
    border-bottom: 1px solid var(--border);
}

.autocomplete-items div:hover {
    background-color: var(--bg-primary);
}

.autocomplete-active {
    background-color: var(--accent) !important;
    color: #fff;
}

/* Main Content */
main {
    max-width: 900px;
    margin: 2rem auto;
    padding: 0 1rem;
}

.catalogue-item {
    margin-bottom: 2rem;
    padding-bottom: 2rem;
    border-bottom: 1px solid var(--border);
}

.catalogue-time {
    color: var(--text-secondary);
    font-size: 0.9rem;
}

.catalogue-title {
    font-size: 1.5rem;
    margin: 0.5rem 0;
}

.catalogue-line {
    margin-bottom: 0.5rem;
}

/* Posts */
.post-info {
    color: var(--text-secondary);
    font-size: 0.9rem;
    margin-bottom: 1.5rem;
}

.post-content {
    line-height: 1.8;
}

.post-content img {
    max-width: 80%;
    height: auto;
    display: block;
    margin: 1.5rem auto;
}

@media (max-width: 768px) {
    .post-content img {
        max-width: 100%;
    }
}

.post pre {
    background-color: var(--code-bg);
    padding: 1rem;
    overflow-x: auto;
    border-radius: 4px;
}

.post-content code {
    background-color: var(--code-bg);
    padding: 0.2rem 0.4rem;
    border-radius: 3px;
    font-family: 'Courier New', monospace;
    font-size: 0.9em;
}

.post-content pre code {
    padding: 0;
    background: none;
}

.post-content blockquote {
    border-left: 3px solid var(--accent);
    padding-left: 1rem;
    margin: 1rem 0;
    color: var(--text-secondary);
    font-style: italic;
}

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

.post-content li {
    margin-bottom: 0.5rem;
    padding-left: 0.5rem;
}

.post-content ul ul,
.post-content ul ol,
.post-content ol ul,
.post-content ol ol {
    margin-top: 0.5rem;
    margin-bottom: 0.5rem;
}

/* Ensure list items display properly */
main ul,
main ol {
    margin-left: 0;
    padding-left: 2rem;
    margin-bottom: 1rem;
}

main li {
    margin-bottom: 0.5rem;
    padding-left: 0.5rem;
}

.post-content table {
    width: 100%;
    border-collapse: collapse;
    margin: 1rem 0;
}

.post-content th,
.post-content td {
    border: 1px solid var(--border);
    padding: 0.75rem;
    text-align: left;
}

.post-content th {
    background-color: var(--bg-secondary);
}

/* Code Highlighting */
.highlight {
    background-color: var(--code-bg) !important;
    border-radius: 4px;
    margin: 1rem 0;
    border: 5px solid #272822;
}

.highlight pre {
    background-color: transparent !important;
}

/* Custom Components */
.warning,
.info,
.question {
    margin: 1.5rem 0;
    padding: 1rem;
    border-radius: 4px;
    border-left: 4px solid;
}

.warning {
    background-color: rgba(255, 107, 107, 0.1);
    border-color: var(--warning);
}

.info {
    background-color: rgba(74, 158, 255, 0.1);
    border-color: var(--info);
}

.question {
    background-color: rgba(100, 181, 246, 0.1);
    border-color: var(--question);
}

.warning-header,
.info-header,
.question-header {
    font-weight: 700;
    margin-bottom: 0.5rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.warning-body,
.info-body,
.question-body {
    display: block;
}

/* Pagination */
.pagination {
    display: flex;
    justify-content: center;
    gap: 1rem;
    margin: 2rem 0;
}

.pagination a,
.pagination span {
    padding: 0.5rem 1rem;
    border: 1px solid var(--border);
    border-radius: 4px;
}

.pagination a:hover {
    background-color: var(--bg-secondary);
    text-decoration: none;
}

/* Footer */
footer {
    max-width: 900px;
    margin: 4rem auto 2rem;
    padding: 2rem 1rem;
    border-top: 1px solid var(--border);
    text-align: center;
    color: var(--text-secondary);
}

/* Responsive */
@media (max-width: 768px) {
    .navbar {
        flex-direction: column;
        align-items: flex-start;
    }

    .autocomplete input {
        width: 100%;
    }

    .dropdown-content {
        position: static;
        display: none;
        border: none;
        margin-left: 1rem;
    }

    .dropdown:hover .dropdown-content,
    .dropdown:focus-within .dropdown-content {
        display: block;
    }
}

img {
    max-width: 800px;
}
