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

body {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
    height: 100vh;
    overflow: hidden;
    background-color: #f3f4f6;
    color: #1f2937;
}

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

/* Header */
.app-header {
    background-color: #fff;
    border-bottom: 1px solid #e5e7eb;
    padding: 0.75rem 1.5rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-shrink: 0;
    z-index: 10;
    box-shadow: 0 1px 2px rgba(0,0,0,0.05);
}

.logo-area h1 {
    font-size: 1.25rem;
    font-weight: 700;
    color: #4f46e5;
}

.settings-bar {
    display: flex;
    align-items: center;
    gap: 1.5rem;
}

.setting-group {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
}

.setting-group label {
    font-size: 0.75rem;
    font-weight: 600;
    color: #6b7280;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.setting-group.checkbox-group {
    flex-direction: row;
    align-items: center;
    gap: 0.5rem;
}

.setting-group.checkbox-group label {
    margin-bottom: 0;
    cursor: pointer;
}

input[type="text"],
select {
    padding: 0.375rem 0.5rem;
    border: 1px solid #d1d5db;
    border-radius: 0.375rem;
    font-size: 0.875rem;
    color: #374151;
    background-color: #fff;
    transition: border-color 0.15s;
}

input[type="text"]:focus,
select:focus {
    outline: none;
    border-color: #4f46e5;
    box-shadow: 0 0 0 2px rgba(79, 70, 229, 0.1);
}

input[type="file"] {
    display: none;
}

.file-label {
    cursor: pointer;
    color: #4f46e5;
    font-size: 0.875rem !important;
    text-transform: none !important;
}

.file-label:hover {
    text-decoration: underline;
}

.primary-btn {
    background-color: #4f46e5;
    color: white;
    border: none;
    padding: 0.5rem 1rem;
    border-radius: 0.375rem;
    font-weight: 500;
    cursor: pointer;
    transition: background-color 0.15s;
    font-size: 0.875rem;
}

.primary-btn:hover {
    background-color: #4338ca;
}

/* Main Content Split Pane */
.main-content {
    display: flex;
    flex: 1;
    overflow: hidden;
}

.editor-pane,
.preview-pane {
    flex: 1;
    overflow: hidden;
    display: flex;
    flex-direction: column;
}

.editor-pane {
    border-right: 1px solid #e5e7eb;
    background-color: #1e1e1e; /* Dark editor */
}

.preview-pane {
    background-color: #e5e7eb; /* Contrast background for paper look */
    padding: 2rem;
    overflow-y: auto;
    display: flex;
    justify-content: center;
}

/* Editor */
#markdown-input {
    width: 100%;
    height: 100%;
    border: none;
    resize: none;
    padding: 1.5rem;
    font-family: 'Fira Code', 'Consolas', monospace;
    font-size: 14px;
    line-height: 1.6;
    background-color: #1e1e1e;
    color: #d4d4d4;
    outline: none;
}

/* Preview Paper Look */
#preview-content {
    background-color: white;
    width: 21cm; /* A4 width */
    min-height: 29.7cm; /* A4 height */
    padding: 2cm; /* A4 margins approx */
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
    margin-bottom: 2rem;
    /* Allow height to grow with content */
    height: auto;
    overflow: visible;
}

/* Hide print elements in screen view */
@media screen {
    .pagedjs_pages {
        display: none;
    }
}
