:root {
    --primary-color: #0d6efd;
    --sidebar-bg: #f8f9fa;
    --section-bg: #ffffff;
    --border-color: #dee2e6;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    background-color: #f5f5f5;
}

.top-bar {
    background-color: #343a40;
    color: white;
    padding: 0.75rem 1rem;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.main-container {
    display: flex;
    height: calc(100vh - 60px);
}

.content-area {
    flex: 1;
    overflow-y: auto;
    padding: 2rem;
    background-color: white;
}

.right-sidebar {
    width: 400px;
    background-color: var(--sidebar-bg);
    border-left: 1px solid var(--border-color);
    overflow-y: auto;
    padding: 1rem;
}

.section-card {
    background: white;
    border: 1px solid var(--border-color);
    border-radius: 8px;
    margin-bottom: 1.5rem;
    padding: 1.5rem;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05);
}

.section-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1rem;
    padding-bottom: 0.75rem;
    border-bottom: 2px solid var(--border-color);
}

.section-title {
    font-weight: 600;
    font-size: 1.1rem;
    color: #212529;
    margin: 0;
}

.collapsible-section {
    cursor: pointer;
}

.collapsible-section:hover {
    color: var(--primary-color);
}

.form-label {
    font-weight: 500;
    color: #495057;
    margin-bottom: 0.5rem;
}

.form-control,
.form-select {
    border-radius: 6px;
    border: 1px solid #ced4da;
    padding: 0.5rem 0.75rem;
}

.form-control:focus,
.form-select:focus {
    border-color: var(--primary-color);
    box-shadow: 0 0 0 0.2rem rgba(13, 110, 253, 0.25);
}

.btn-toolbar {
    display: flex;
    gap: 0.5rem;
    margin-bottom: 1rem;
    padding: 0.5rem;
    background: #f8f9fa;
    border-radius: 6px;
}

.btn-format {
    border: 1px solid #dee2e6;
    background: white;
    padding: 0.375rem 0.75rem;
    border-radius: 4px;
    cursor: pointer;
}

.btn-format:hover {
    background: #e9ecef;
}

.btn-format.active {
    background: var(--primary-color);
    color: white;
    border-color: var(--primary-color);
}

.word-count {
    position: fixed;
    top: 60px;
    right: 340px;
    background: white;
    padding: 0.5rem 1rem;
    border-radius: 4px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
    font-size: 0.875rem;
    z-index: 100;
}

.nav-menu {
    list-style: none;
    padding: 0;
    margin: 0;
}

.nav-menu li {
    padding: 0.5rem 0;
    cursor: pointer;
}

.nav-menu li:hover {
    color: var(--primary-color);
}

.breadcrumb-nav {
    font-size: 0.75rem;
    color: #6c757d;
    margin-bottom: 1rem;
}

.author-item,
.keyword-item,
.affiliation-item,
.reference-item {
    background: #f8f9fa;
    padding: 0.75rem;
    border-radius: 6px;
    margin-bottom: 0.5rem;
    border: 1px solid #e9ecef;
}

.add-item-btn {
    margin-top: 0.5rem;
}

.section-content {
    margin-top: 1rem;
}

.section-content.collapsed {
    display: none;
}

.error-message {
    color: #dc3545;
    font-size: 0.875rem;
    margin-top: 0.25rem;
}

.success-message {
    color: #198754;
    font-size: 0.875rem;
    margin-top: 0.25rem;
}

.dropdown-menu {
    border-radius: 6px;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
}

.insert-dropdown {
    position: relative;
}

.section-indicator {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    color: #6c757d;
    font-size: 0.875rem;
}

.section-indicator i {
    cursor: pointer;
}

.export-btn {
    background: var(--primary-color);
    color: white;
    border: none;
    padding: 0.5rem 1.5rem;
    border-radius: 6px;
    font-weight: 500;
}

.export-btn:hover {
    background: #0b5ed7;
}

.preview-btn {
    background: #6c757d;
    color: white;
    border: none;
    padding: 0.5rem 1.5rem;
    border-radius: 6px;
    font-weight: 500;
}

.preview-btn:hover {
    background: #5c636a;
}

.textarea-auto-resize {
    resize: vertical;
    min-height: 100px;
}

.help-icon {
    color: var(--primary-color);
    cursor: help;
    margin-left: 0.25rem;
}

.checkbox-label {
    font-weight: normal;
    margin-left: 0.5rem;
}

.date-input-group {
    display: flex;
    gap: 0.5rem;
}

.date-input-group .form-control {
    flex: 1;
}

/* Body Section Enhancements */
.body-section-item {
    background: #f8f9fa;
    padding: 1rem;
    border-radius: 6px;
    margin-bottom: 1rem;
    border: 1px solid #e9ecef;
}

.body-section-item .section-header {
    border-bottom: 1px solid #dee2e6;
    padding-bottom: 0.5rem;
    margin-bottom: 0.75rem;
}

.body-section-item .section-title-input {
    font-weight: 600;
    font-size: 1rem;
    border: none;
    background: transparent;
    padding: 0.25rem 0;
    width: 100%;
}

.body-section-item .section-title-input:focus {
    outline: none;
    border-bottom: 2px solid var(--primary-color);
}

.body-section-item .section-content-input {
    width: 100%;
    border: 1px solid #ced4da;
    border-radius: 4px;
    padding: 0.5rem;
    min-height: 120px;
}

.body-section-item .section-actions {
    display: flex;
    gap: 0.5rem;
    margin-top: 0.5rem;
}

/* Back Section Enhancements */
.back-section-item {
    background: #f8f9fa;
    padding: 1rem;
    border-radius: 6px;
    margin-bottom: 1rem;
    border: 1px solid #e9ecef;
}

/* XML Preview Modal */
.xml-preview-modal .modal-dialog {
    max-width: 90%;
}

.xml-preview-modal .modal-body {
    max-height: 70vh;
    overflow-y: auto;
}

.xml-preview-modal pre {
    background: #f8f9fa;
    padding: 1rem;
    border-radius: 6px;
    font-family: 'Courier New', monospace;
    font-size: 0.875rem;
    line-height: 1.5;
    margin: 0;
    white-space: pre-wrap;
    word-wrap: break-word;
}

.xml-preview-modal .modal-header {
    border-bottom: 2px solid #dee2e6;
}

.xml-preview-modal .modal-footer {
    border-top: 2px solid #dee2e6;
}

/* Heading Level Selector */
.heading-level-selector {
    min-width: 150px;
}

/* Section Type Badge */
.section-type-badge {
    font-size: 0.75rem;
    padding: 0.25rem 0.5rem;
    border-radius: 4px;
    background: #e9ecef;
    color: #495057;
}

/* Content Type Indicators */
.content-type-indicator {
    display: inline-block;
    padding: 0.25rem 0.5rem;
    background: #e7f3ff;
    color: #0066cc;
    border-radius: 4px;
    font-size: 0.75rem;
    margin-right: 0.5rem;
}

/* Empty State */
.empty-state {
    text-align: center;
    padding: 2rem;
    color: #6c757d;
}

.empty-state i {
    font-size: 3rem;
    margin-bottom: 1rem;
    opacity: 0.5;
}

/* Quill Editor Styles */
.quill-editor-container {
    background: white;
    border: 1px solid #ced4da;
    border-radius: 6px;
}

.quill-editor-container .ql-container {
    font-family: inherit;
    font-size: 0.875rem;
}

.quill-editor-container .ql-editor {
    min-height: 120px;
}

.quill-editor-container .ql-editor.ql-blank::before {
    color: #6c757d;
    font-style: normal;
}

.quill-editor-container .ql-toolbar {
    border-top-left-radius: 6px;
    border-top-right-radius: 6px;
    border-bottom: 1px solid #ced4da;
}

.quill-editor-container .ql-container {
    border-bottom-left-radius: 6px;
    border-bottom-right-radius: 6px;
}

/* Remove default formatting toolbar since we're using Quill */
.btn-toolbar {
    display: none;
}