:root {
    --bg-color: #0d1117;
    --text-color: #c9d1d9;
    --border-color: #30363d;
    --header-bg: #161b22;
    --input-bg: #0d1117;
    --accent-color: #238636;
    --font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Helvetica, Arial, sans-serif, "Apple Color Emoji", "Segoe UI Emoji";
}

* {
    box-sizing: border-box;
}

body,
html {
    margin: 0;
    padding: 0;
    height: 100%;
    font-family: var(--font-family);
    background-color: var(--bg-color);
    color: var(--text-color);
    overflow: hidden;
}

/* Layout Structure */
.app-container {
    display: flex;
    flex-direction: column;
    height: 100vh;
}

header {
    background-color: var(--header-bg);
    border-bottom: 1px solid var(--border-color);
    padding: 1rem 1.5rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
    z-index: 10;
}

.logo {
    font-weight: 600;
    color: #f0f6fc;
    font-size: 1.1rem;
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.title-container {
    display: flex;
    flex-direction: column;
    justify-content: center;
    line-height: 1.2;
}

.github-link {
    font-size: 0.75rem;
    color: rgba(240, 246, 252, 0.7);
    text-decoration: none;
    transition: color 0.2s;
}

.github-link:hover {
    color: #58a6ff;
    text-decoration: underline;
}

.github-link:visited {
    color: rgba(240, 246, 252, 0.7);
}

.main-editor {
    display: flex;
    flex: 1;
    overflow: hidden;
}

/* Editor Styles (Left) */
.editor-pane {
    width: 50%;
    height: 100%;
    border-right: 1px solid var(--border-color);
    display: flex;
    flex-direction: column;
    background-color: var(--input-bg);
}

#markdown-input {
    flex: 1;
    width: 100%;
    padding: 1.5rem;
    border: none;
    outline: none;
    resize: none;
    font-family: 'SFMono-Regular', Consolas, 'Liberation Mono', Menlo, monospace;
    font-size: 14px;
    line-height: 1.6;
    background: transparent;
    color: #e6edf3;
}

/* Preview Styles (Right) */
.preview-pane {
    flex: 1;
    height: 100%;
    overflow-y: auto;
    padding: 2rem 3rem;
    /* Force Light Theme for Preview */
    background-color: #ffffff;
    color: #24292f;
}

/* Button Styling */
.btn-group {
    display: flex;
    gap: 0.75rem;
}

.btn {
    background-color: var(--accent-color);
    color: white;
    border: 1px solid rgba(240, 246, 252, 0.1);
    border-radius: 6px;
    padding: 6px 16px;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.btn:hover {
    background-color: #2ea043;
    border-color: #8b949e;
}

.btn-secondary {
    background-color: #21262d;
    color: #c9d1d9;
    border: 1px solid rgba(240, 246, 252, 0.1);
}

.btn-secondary:hover {
    background-color: #30363d;
    border-color: #8b949e;
    color: #f0f6fc;
}

/* Custom Scrollbar for dark theme */
::-webkit-scrollbar {
    width: 10px;
    height: 10px;
}

::-webkit-scrollbar-track {
    background: var(--bg-color);
}

::-webkit-scrollbar-thumb {
    background: #30363d;
    border-radius: 5px;
    border: 2px solid var(--bg-color);
}

::-webkit-scrollbar-thumb:hover {
    background: #484f58;
}

/* PDF Generation Specifics */
#pdf-content {
    padding: 20px;
}

/* Media Query for Print */
@media print {

    header,
    .editor-pane {
        display: none !important;
    }

    .preview-pane {
        width: 100% !important;
        padding: 0;
        overflow: visible;
    }

    .markdown-body {
        padding: 0 !important;
        background-color: white !important;
        color: black !important;
    }

    body {
        background-color: white;
    }
}