@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;700&family=Fira+Code:wght@400;500&display=swap');

:root {
    --bg-primary: #1e1e1e;
    --bg-secondary: #252526;
    --text-primary: #d4d4d4;
    --text-secondary: #858585;
    --accent: #5e81f4;
    --accent-hover: #4e6cd2;
    --border: #333;
    --font: 'Inter', system-ui, -apple-system, sans-serif;
}

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

body {
    background-color: var(--bg-primary);
    color: var(--text-primary);
    font-family: var(--font);
    display: flex;
    height: 100vh;
    overflow: hidden;
}

.container {
    display: flex;
    width: 100%;
    height: 100%;
}

.sidebar {
    width: 250px;
    background-color: var(--bg-secondary);
    border-right: 1px solid var(--border);
    display: flex;
    flex-direction: column;
    padding: 1rem;
    overflow-y: auto;
}

.brand {
    font-size: 1.2rem;
    font-weight: 700;
    margin-bottom: 1.5rem;
    color: var(--text-primary);
}

.nav-item {
    margin-bottom: 0.5rem;
    cursor: pointer;
    padding: 0.5rem;
    border-radius: 4px;
    transition: background 0.2s;
    font-size: 0.95rem;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.nav-item:hover,
.nav-item.active {
    background-color: #333;
    color: var(--text-primary);
}

.loading {
    color: var(--text-secondary);
    text-align: center;
    padding: 1rem;
}

.content {
    flex: 1;
    display: flex;
    flex-direction: column;
    height: 100%;
    overflow-y: auto;
    padding: 2rem 4rem;
}

.top-bar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 2rem;
    border-bottom: 1px solid var(--border);
    padding-bottom: 1rem;
}

h1 {
    font-size: 2rem;
    font-weight: 700;
    color: var(--text-primary);
}

.markdown-body {
    line-height: 1.6;
    font-size: 1.1rem;
    max-width: 800px;
}

/* Editor Styles */
.editor-container {
    display: flex;
    flex-direction: column;
    gap: 1rem;
    height: 100%;
}

input,
textarea {
    background-color: var(--bg-secondary);
    border: 1px solid var(--border);
    color: var(--text-primary);
    padding: 0.8rem;
    border-radius: 4px;
    font-family: var(--font);
    font-size: 1rem;
}

input:focus,
textarea:focus {
    outline: none;
    border-color: var(--accent);
}

textarea {
    flex: 1;
    resize: none;
    font-family: 'Fira Code', monospace;
}

.editor-actions {
    display: flex;
    gap: 1rem;
    justify-content: flex-end;
}

.btn {
    padding: 0.6rem 1.2rem;
    border-radius: 4px;
    border: none;
    cursor: pointer;
    font-weight: 500;
    transition: background 0.2s;
}

.primary {
    background-color: var(--accent);
    color: white;
}

.primary:hover {
    background-color: var(--accent-hover);
}

.secondary {
    background-color: transparent;
    border: 1px solid var(--border);
    color: var(--text-secondary);
}

.secondary:hover {
    border-color: var(--text-primary);
    color: var(--text-primary);
}

/* Markdown Rendering details */
.markdown-body h1,
.markdown-body h2,
.markdown-body h3 {
    margin-top: 1.5rem;
    margin-bottom: 0.8rem;
    border-bottom: 1px solid var(--border);
    padding-bottom: 0.3rem;
}

.markdown-body p {
    margin-bottom: 1rem;
}

.markdown-body code {
    background-color: #333;
    padding: 0.2rem 0.4rem;
    border-radius: 3px;
    font-family: 'Fira Code', monospace;
}

.markdown-body pre {
    background-color: #111;
    padding: 1rem;
    border-radius: 4px;
    overflow-x: auto;
    margin-bottom: 1rem;
}

.markdown-body a {
    color: var(--accent);
    text-decoration: none;
}

.markdown-body a:hover {
    text-decoration: underline;
}/* Modal Styles */
.modal {
    display: none;
    position: fixed;
    z-index: 1000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    overflow: auto;
    background-color: rgba(0, 0, 0, 0.6);
}

.modal-content {
    background-color: var(--bg-secondary);
    margin: 15% auto;
    padding: 20px;
    border: 1px solid var(--border);
    width: 80%;
    max-width: 600px;
    color: var(--text-primary);
    border-radius: 8px;
    position: relative;
}

.close {
    color: #aaa;
    float: right;
    font-size: 28px;
    font-weight: bold;
    cursor: pointer;
}

.close:hover,
.close:focus {
    color: var(--text-primary);
    text-decoration: none;
}

/* Danger Button */
.danger {
    color: #ff6b6b;
    border: 1px solid #ff6b6b;
    background-color: transparent;
}

.danger:hover {
    background-color: rgba(255, 107, 107, 0.1);
}

/* Toolbar & Meta */
.toolbar {
    margin: 0.5rem 0;
    display: flex;
    align-items: center;
    gap: 10px;
}

.btn.small {
    font-size: 0.8rem;
    padding: 0.4rem 0.8rem;
}

.meta-info {
    margin-top: 0.5rem;
    color: var(--text-secondary);
    font-size: 0.85rem;
}

.title-container {
    display: flex;
    flex-direction: column;
}

#upload-status {
    font-size: 0.8rem;
    color: var(--accent);
}
/* ... Previous styles ... */

.auth-section {
    margin-bottom: 2rem;
    padding-bottom: 2rem;
    border-bottom: 1px solid var(--border);
    display: flex;
    flex-direction: column;
    align-items: flex-start;
}

.auth-info {
    font-size: 0.9rem;
    color: var(--text-primary);
    margin-bottom: 1rem;
}

.auth-email {
    display: block;
    color: var(--accent);
    margin-bottom: 0.5rem;
}

.small-modal {
    max-width: 400px;
    padding: 2rem;
}

input {
    width: 100%;
    margin-bottom: 1rem;
    background-color: var(--bg-primary);
}

.full-width {
    width: 100%;
    margin-top: 1rem;
}

.auth-link {
    text-align: center;
    margin-top: 1rem;
    color: var(--text-secondary);
    cursor: pointer;
    font-size: 0.9rem;
}

.auth-link:hover {
    color: var(--accent);
}

.warning {
    color: #ffd700;
    font-size: 0.9rem;
    margin-bottom: 1rem;
}

/* Modal default hide */
#auth-modal {
    display: none;
}
/* ... Previous styles ... */
/* Auth Styles */
.auth-section {
    margin-bottom: 2rem;
    padding-bottom: 2rem;
    border-bottom: 1px solid var(--border);
    display: flex;
    flex-direction: column;
    align-items: flex-start;
}

/* ... etc ... */

/* Tag Styles */
.tag-input-container {
    display: flex;
    gap: 0.5rem;
    margin-bottom: 0.5rem;
}

.tag-badge {
    display: inline-block;
    background-color: var(--bg-card);
    border: 1px solid var(--border);
    padding: 0.2rem 0.6rem;
    border-radius: 99px;
    font-size: 0.8rem;
    color: var(--text-primary);
    margin-right: 0.5rem;
    margin-bottom: 0.5rem;
}

.tag-badge.edit {
    padding-right: 0.4rem;
    display: inline-flex;
    align-items: center;
}

.remove-tag {
    cursor: pointer;
    margin-left: 0.4rem;
    color: var(--danger);
    font-weight: bold;
    font-size: 1rem;
    line-height: 1;
}

.remove-tag:hover {
    color: #ff6b6b;
}

/* Tag Filter Select */
#tag-filter {
    cursor: pointer;
    font-size: 0.9rem;
}

#tag-filter:hover {
    border-color: var(--accent);
}
