/* DocHub Style - Linear/Stripe Inspired */

:root {
    --bg: #ffffff;
    --bg-secondary: #fafafa;
    --text: #0a0a0a;
    --text-secondary: #6b7280;
    --border: #e5e7eb;
    --accent: #5e6ad2;
    --accent-hover: #4b55c0;
    --card-bg: #ffffff;
    --card-border: #e5e7eb;
    --shadow: 0 1px 3px rgba(0,0,0,0.04);
    --shadow-hover: 0 4px 12px rgba(0,0,0,0.08);
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    background: var(--bg-secondary);
    color: var(--text);
    line-height: 1.6;
    min-height: 100vh;
}

.container {
    max-width: 800px;
    margin: 0 auto;
    padding: 40px 20px;
}

/* Header */
.header {
    text-align: center;
    margin-bottom: 32px;
}

.logo {
    font-size: 32px;
    font-weight: 700;
    letter-spacing: -0.5px;
    margin-bottom: 8px;
}

.subtitle {
    color: var(--text-secondary);
    font-size: 14px;
}

/* Search */
.search-box {
    margin-bottom: 24px;
}

.search-box input {
    width: 100%;
    padding: 14px 16px;
    font-size: 15px;
    border: 1px solid var(--border);
    border-radius: 10px;
    background: var(--card-bg);
    outline: none;
    transition: all 0.2s ease;
}

.search-box input:focus {
    border-color: var(--accent);
    box-shadow: 0 0 0 3px rgba(94,106,210,0.1);
}

/* Doc List */
.doc-list {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.loading {
    text-align: center;
    color: var(--text-secondary);
    padding: 40px;
}

/* Date Group */
.date-group {
    margin-bottom: 24px;
}

.date-label {
    font-size: 13px;
    font-weight: 600;
    color: var(--text-secondary);
    margin-bottom: 12px;
    padding-left: 4px;
}

/* Doc Card */
.doc-card {
    background: var(--card-bg);
    border: 1px solid var(--card-border);
    border-radius: 12px;
    padding: 16px 20px;
    cursor: pointer;
    transition: all 0.2s ease;
    box-shadow: var(--shadow);
}

.doc-card:hover {
    border-color: var(--accent);
    box-shadow: var(--shadow-hover);
    transform: translateY(-1px);
}

.doc-card h3 {
    font-size: 16px;
    font-weight: 600;
    margin-bottom: 6px;
    color: var(--text);
}

.doc-card p {
    font-size: 13px;
    color: var(--text-secondary);
    line-height: 1.5;
}

.doc-card .meta {
    font-size: 12px;
    color: var(--text-secondary);
    margin-top: 10px;
    display: flex;
    gap: 12px;
}

/* Empty State */
.empty {
    text-align: center;
    color: var(--text-secondary);
    padding: 40px;
}

/* Preview Modal */
.modal-overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0,0,0,0.5);
    z-index: 100;
    overflow-y: auto;
}

.modal-overlay.active {
    display: block;
}

.modal-content {
    background: var(--bg);
    max-width: 800px;
    margin: 40px auto;
    border-radius: 16px;
    box-shadow: 0 20px 60px rgba(0,0,0,0.2);
    min-height: 100vh;
}

@media (min-width: 801px) {
    .modal-content {
        margin: 40px auto;
        min-height: auto;
    }
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px 24px;
    border-bottom: 1px solid var(--border);
    position: sticky;
    top: 0;
    background: var(--bg);
    border-radius: 16px 16px 0 0;
}

.modal-header h2 {
    font-size: 18px;
    font-weight: 600;
}

.header-actions {
    display: flex;
    gap: 8px;
}

.modal-copy {
    width: 36px;
    height: 36px;
    border: none;
    background: var(--bg-secondary);
    border-radius: 8px;
    cursor: pointer;
    font-size: 16px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s;
}

.modal-copy:hover {
    background: var(--border);
}

/* Toast */
.toast {
    position: fixed;
    bottom: 40px;
    left: 50%;
    transform: translateX(-50%) translateY(100px);
    background: #1d1d1f;
    color: white;
    padding: 12px 24px;
    border-radius: 10px;
    font-size: 14px;
    opacity: 0;
    transition: all 0.3s ease;
    z-index: 200;
    box-shadow: 0 4px 20px rgba(0,0,0,0.3);
}

.toast.show {
    opacity: 1;
    transform: translateX(-50%) translateY(0);
}

.modal-close {
    width: 36px;
    height: 36px;
    border: none;
    background: var(--bg-secondary);
    border-radius: 8px;
    cursor: pointer;
    font-size: 18px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.2s;
}

.modal-close:hover {
    background: var(--border);
}

.modal-body {
    padding: 24px;
}

/* Markdown Content */
.markdown-body {
    font-size: 15px;
    line-height: 1.75;
}

.markdown-body h1 {
    font-size: 28px;
    font-weight: 700;
    margin: 24px 0 16px;
    letter-spacing: -0.5px;
}

.markdown-body h2 {
    font-size: 22px;
    font-weight: 600;
    margin: 20px 0 12px;
    letter-spacing: -0.3px;
}

.markdown-body h3 {
    font-size: 18px;
    font-weight: 600;
    margin: 16px 0 10px;
}

.markdown-body p {
    margin: 12px 0;
}

.markdown-body ul, .markdown-body ol {
    margin: 12px 0;
    padding-left: 24px;
}

.markdown-body li {
    margin: 6px 0;
}

.markdown-body code {
    background: var(--bg-secondary);
    padding: 2px 6px;
    border-radius: 4px;
    font-size: 13px;
    font-family: 'SF Mono', Monaco, monospace;
}

.markdown-body pre {
    background: #1e1e1e;
    color: #d4d4d4;
    padding: 16px;
    border-radius: 10px;
    overflow-x: auto;
    margin: 16px 0;
}

.markdown-body pre code {
    background: none;
    padding: 0;
    color: inherit;
}

.markdown-body table {
    width: 100%;
    border-collapse: collapse;
    margin: 16px 0;
}

.markdown-body th, .markdown-body td {
    border: 1px solid var(--border);
    padding: 10px 14px;
    text-align: left;
}

.markdown-body th {
    background: var(--bg-secondary);
    font-weight: 600;
}

.markdown-body blockquote {
    border-left: 3px solid var(--accent);
    padding-left: 16px;
    margin: 16px 0;
    color: var(--text-secondary);
}

.markdown-body hr {
    border: none;
    border-top: 1px solid var(--border);
    margin: 24px 0;
}

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

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

/* Mobile Responsive */
@media (max-width: 600px) {
    .container {
        padding: 24px 16px;
    }

    .logo {
        font-size: 26px;
    }

    .doc-card {
        padding: 14px 16px;
    }

    .modal-header {
        padding: 16px 20px;
    }

    .modal-body {
        padding: 20px;
    }

    .markdown-body {
        font-size: 14px;
    }

    .markdown-body h1 {
        font-size: 24px;
    }

    .markdown-body h2 {
        font-size: 20px;
    }
}