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

:root {
    --brand-orange: #d2691e;
    --brand-brown: #8b4513;
    --bg-color: #ffffff;
    --border-color: #e0e0e0;
    --text-color: #333333;
    --text-light: #666666;
    --sidebar-bg: #fafafa;
    --editable-border: #4a90e2;
}

body.dark-mode {
    --bg-color: #1a1a1a;
    --border-color: #333333;
    --text-color: #e0e0e0;
    --text-light: #999999;
    --sidebar-bg: #222222;
    --editable-border: #4a90e2;
}

body.dark-mode .top-bar-icons svg {
    fill: #e0e0e0;
}

body.dark-mode .btn-primary {
    background-color: var(--brand-orange);
    color: white;
}

body.dark-mode .btn-secondary {
    background-color: var(--text-light);
    color: white;
}

body.dark-mode .journal-card {
    border-color: var(--border-color);
}

body.dark-mode .journal-card:hover {
    border-color: var(--brand-orange);
}

body.dark-mode .page-item:hover {
    background-color: rgba(255, 255, 255, 0.05);
}

body.dark-mode .page-item-active {
    background-color: rgba(210, 105, 30, 0.2);
}

body.dark-mode .search-input {
    background-color: rgba(255, 255, 255, 0.05);
    color: var(--text-color);
}

body.dark-mode .input-field {
    background-color: rgba(255, 255, 255, 0.05);
    color: var(--text-color);
    border-color: var(--border-color);
}

body.dark-mode .modal-content {
    background-color: var(--bg-color);
    color: var(--text-color);
}

body.dark-mode .emoji-picker {
    background-color: rgba(255, 255, 255, 0.05);
}

body.dark-mode .emoji-option {
    border-color: var(--border-color);
}

body.dark-mode .emoji-option:hover {
    border-color: var(--brand-orange);
}

body.dark-mode .emoji-option.selected {
    border-color: var(--brand-orange);
    background-color: rgba(210, 105, 30, 0.2);
}

body {
    font-family: Arial, sans-serif;
    background-color: var(--bg-color);
    color: var(--text-color);
    line-height: 1.5;
    margin: 0;
    padding: 0;
}

/* Top Bar */
.top-bar {
    position: fixed;
    top: 0;
    right: 0;
    padding: 1rem 2rem;
    z-index: 1000;
}

.top-bar-icons {
    display: flex;
    gap: 0.75rem;
    align-items: center;
}

.top-bar-icons svg {
    cursor: pointer;
    transition: opacity 0.2s;
}

.top-bar-icons svg:hover {
    opacity: 0.7;
}

/* App Container */
.app-container {
    width: 100%;
    min-height: 100vh;
    padding: 0;
    padding-top: 4rem;
}

.app-container.split-view {
    padding-top: 0;
}

/* Home Page Styles */
.home-header {
    text-align: center;
    margin-bottom: 3rem;
    position: relative;
}

.home-header-top {
    display: flex;
    justify-content: space-between;
    align-items: center;
    width: 100%;
    max-width: 1200px;
    margin: 0 auto 1rem auto;
    position: relative;
}

.home-header-spacer {
    flex: 1;
}

.home-header-top .brand-logo {
    margin-bottom: 0;
    position: absolute;
    left: 50%;
    transform: translateX(-50%);
}

.home-header-top .top-bar-icons {
    display: flex;
    gap: 0.75rem;
    align-items: center;
}

.brand-logo {
    max-width: 300px;
    height: auto;
    margin-bottom: 0.5rem;
}

.brand-logo-small {
    max-width: 150px;
    height: auto;
    margin-bottom: 1rem;
    display: block;
}

.tagline {
    color: var(--text-light);
    font-size: 1rem;
    margin-top: 2rem;
}

/* Journals Container */
.journals-container {
    display: flex;
    flex-wrap: wrap;
    gap: 1.5rem;
    justify-content: center;
    max-width: 1200px;
    margin: 0 auto;
}

.journal-card {
    width: 200px;
    height: 300px;
    border: 2px solid var(--border-color);
    border-radius: 12px;
    background-color: transparent;
    transition: all 0.2s;
    display: flex;
    flex-direction: column;
    padding: 1rem;
    position: relative;
}

.journal-card:hover {
    border-color: var(--brand-orange);
    transform: translateY(-2px);
}

.journal-content {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    cursor: pointer;
}

.journal-actions {
    display: flex;
    justify-content: center;
    gap: 0.5rem;
    margin-top: 0.5rem;
    padding-top: 0.5rem;
    border-top: 1px solid var(--border-color);
}

.journal-card-new {
    border: 2px dashed var(--border-color);
}

.journal-emoji {
    font-size: 3rem;
    margin-bottom: 0.75rem;
    text-align: center;
    display: block;
}

.btn-icon {
    background: none;
    border: none;
    cursor: pointer;
    padding: 0.25rem 0.5rem;
    border-radius: 4px;
    transition: background-color 0.2s;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--text-color);
}

.btn-icon svg {
    width: 20px;
    height: 20px;
}

.btn-icon:hover {
    background-color: rgba(0, 0, 0, 0.05);
}

body.dark-mode .btn-icon:hover {
    background-color: rgba(255, 255, 255, 0.05);
}

.journal-name {
    font-size: 1.2rem;
    font-weight: normal;
    color: var(--text-color);
    font-family: Arial, sans-serif;
}

.plus-sign {
    font-size: 3rem;
    color: var(--text-light);
    margin-bottom: 0.5rem;
}

/* Journal Top Header */
.journal-top-header {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1rem 2rem;
    z-index: 1000;
    background-color: var(--bg-color);
    border-bottom: 1px solid var(--border-color);
}

.journal-top-header .brand-logo-small {
    margin-bottom: 0;
}

/* Split View Layout */
.split-view {
    display: flex;
    height: calc(100vh - 5rem);
    gap: 0;
    margin-top: 5rem;
}

.sidebar {
    width: 300px;
    background-color: transparent;
    border-right: none;
    padding: 1rem 2rem 2rem 2rem;
    padding-top: 1rem;
    display: flex;
    flex-direction: column;
    overflow-y: auto;
}

.sidebar-header {
    margin-bottom: 2rem;
    margin-top: 0;
    padding-top: 1rem;
}

.exit-link {
    color: var(--text-color);
    text-decoration: none;
    font-size: 0.9rem;
    display: block;
    margin-top: 0.5rem;
}

.exit-link:hover {
    text-decoration: underline;
}

.search-box {
    margin-bottom: 2rem;
}

.search-input {
    width: 100%;
    padding: 0.75rem;
    border: none;
    border-radius: 6px;
    font-family: Arial, sans-serif;
    font-size: 0.9rem;
    background-color: transparent;
}

.search-input:focus {
    outline: none;
}

.pages-list {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.page-item {
    padding: 0.75rem;
    cursor: pointer;
    border-radius: 4px;
    transition: background-color 0.2s;
}

.page-item:hover {
    background-color: rgba(0, 0, 0, 0.05);
}

.page-item-active {
    background-color: rgba(210, 105, 30, 0.1);
    font-weight: bold;
}

.page-name {
    font-family: Arial, sans-serif;
    font-size: 0.95rem;
    color: var(--text-color);
}

.page-item-new .page-name {
    color: var(--text-light);
    font-style: italic;
}

.main-content-panel {
    flex: 1;
    padding: 0;
    overflow-y: auto;
    background-color: transparent;
}

.main-content-panel.editor-panel {
    padding: 0;
}

.content-placeholder {
    display: flex;
    align-items: center;
    justify-content: center;
    height: 100%;
    color: var(--text-light);
}

/* Page Header */
.page-header {
    margin-bottom: 2rem;
    padding: 2rem 2rem 0 2rem;
}

.page-title {
    font-size: 2rem;
    font-weight: normal;
    color: var(--text-color);
    margin-bottom: 0.5rem;
}

/* Page Content */
.page-content {
    margin-bottom: 2rem;
}

.markdown-body {
    line-height: 1.8;
}

.markdown-body h1,
.markdown-body h2,
.markdown-body h3 {
    margin-top: 1.5rem;
    margin-bottom: 1rem;
    color: var(--text-color);
    font-weight: normal;
}

.markdown-body h1 {
    font-size: 2rem;
}

.markdown-body h2 {
    font-size: 1.5rem;
}

.markdown-body h3 {
    font-size: 1.25rem;
}

.markdown-body p {
    margin-bottom: 1rem;
}

.markdown-body code {
    background-color: #f5f5f5;
    padding: 0.2rem 0.4rem;
    border-radius: 3px;
    font-family: 'Courier New', monospace;
    font-size: 0.9em;
}

.markdown-body pre {
    background-color: #f5f5f5;
    padding: 1rem;
    border-radius: 6px;
    overflow-x: auto;
    margin-bottom: 1rem;
}

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

.markdown-body ul,
.markdown-body ol {
    margin-left: 2rem;
    margin-bottom: 1rem;
}

.markdown-body li {
    margin-bottom: 0.5rem;
}

.markdown-body blockquote {
    border-left: 4px solid var(--brand-orange);
    padding-left: 1rem;
    margin-left: 0;
    color: var(--text-light);
    font-style: italic;
}

.markdown-body table {
    width: 100%;
    border-collapse: collapse;
    margin-bottom: 1rem;
}

.markdown-body table th,
.markdown-body table td {
    border: 1px solid var(--border-color);
    padding: 0.5rem;
    text-align: left;
}

.markdown-body table th {
    background-color: var(--sidebar-bg);
    font-weight: bold;
}

/* Editor - blank.page style */
.editor-panel {
    display: flex;
    flex-direction: column;
    height: 100%;
}

.editor-header {
    padding: 2rem 2rem 1rem 2rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 1rem;
}

.page-title-input {
    width: 100%;
    border: none;
    background: transparent;
    font-size: 2.5rem;
    font-weight: normal;
    color: var(--text-color);
    font-family: Arial, sans-serif;
    padding: 0.5rem 0;
    outline: none;
}

.page-title-input:focus {
    outline: none;
}

.page-title-input::placeholder {
    color: var(--text-light);
    opacity: 0.5;
}

.editor-container {
    flex: 1;
    position: relative;
    display: flex;
    align-items: flex-start;
}

.markdown-editor {
    width: 100%;
    height: 100%;
    min-height: calc(100vh - 10rem);
    padding: 0 2rem 2rem 2rem;
    border: none;
    border-radius: 0;
    font-family: Arial, sans-serif;
    font-size: 1.125rem;
    line-height: 1.8;
    resize: none;
    background-color: transparent;
    color: var(--text-color);
    outline: none;
    box-shadow: none;
}

.markdown-editor:focus {
    outline: none;
    border: none;
}

.markdown-editor::placeholder {
    color: var(--text-light);
    opacity: 0.5;
}

.editor-actions {
    position: fixed;
    bottom: 2rem;
    right: 2rem;
    opacity: 1;
    z-index: 100;
}

.editor-help {
    margin-top: 0.5rem;
    color: var(--text-light);
    font-size: 0.85rem;
}

.editor-help code {
    background-color: #f5f5f5;
    padding: 0.2rem 0.4rem;
    border-radius: 3px;
    font-size: 0.85rem;
}

/* Buttons */
.btn {
    padding: 0.5rem 1.5rem;
    border: none;
    border-radius: 6px;
    font-size: 0.9rem;
    cursor: pointer;
    transition: all 0.2s;
    text-decoration: none;
    display: inline-block;
    font-family: Arial, sans-serif;
    font-weight: normal;
}

.btn-primary {
    background-color: var(--brand-orange);
    color: white;
}

.btn-primary:hover {
    background-color: var(--brand-brown);
}

.btn-secondary {
    background-color: var(--text-light);
    color: white;
}

.btn-secondary:hover {
    background-color: var(--text-color);
}

.btn-danger {
    background-color: #dc3545;
    color: white;
}

.btn-danger:hover {
    background-color: #c82333;
}

.btn-success {
    background-color: #28a745;
    color: white;
}

.page-actions {
    margin-top: 1rem;
}

/* Modal */
.modal {
    display: none;
    position: fixed;
    z-index: 10000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0,0,0,0.5);
    pointer-events: auto;
}

body.dark-mode .modal {
    background-color: rgba(0, 0, 0, 0.8);
}

.modal-content {
    background-color: var(--bg-color);
    margin: 15% auto;
    padding: 0;
    border-radius: 8px;
    width: 90%;
    max-width: 500px;
    box-shadow: 0 4px 6px rgba(0,0,0,0.1);
    position: relative;
    z-index: 10001;
    pointer-events: auto;
}

body.dark-mode .modal-content {
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.5);
}

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

.modal-header h2 {
    margin: 0;
    font-weight: normal;
    font-size: 1.5rem;
}

.close {
    color: var(--text-light);
    font-size: 2rem;
    font-weight: bold;
    cursor: pointer;
    line-height: 1;
}

.close:hover {
    color: var(--text-color);
}

.modal-body {
    padding: 1.5rem;
}

.input-field {
    width: 100%;
    padding: 0.75rem;
    border: 1px solid var(--border-color);
    border-radius: 6px;
    font-size: 1rem;
    margin-bottom: 1rem;
    font-family: Arial, sans-serif;
}

.input-field:focus {
    outline: none;
    border-color: var(--brand-orange);
}

/* Emoji Picker */
.emoji-picker {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    margin-bottom: 1rem;
    padding: 0.5rem;
    background-color: var(--sidebar-bg);
    border-radius: 6px;
}

.emoji-option {
    background: none;
    border: 2px solid var(--border-color);
    border-radius: 6px;
    font-size: 1.5rem;
    width: 50px;
    height: 50px;
    cursor: pointer;
    transition: all 0.2s;
    padding: 0;
    display: flex;
    align-items: center;
    justify-content: center;
}

.emoji-option:hover {
    border-color: var(--brand-orange);
    transform: scale(1.1);
}

.emoji-option.selected {
    border-color: var(--brand-orange);
    background-color: rgba(210, 105, 30, 0.1);
}

.selected-emoji-display {
    margin-bottom: 1rem;
    padding: 0.5rem;
    background-color: var(--sidebar-bg);
    border-radius: 4px;
    font-size: 0.9rem;
    color: var(--text-light);
}

.selected-emoji-display span {
    font-size: 1.2rem;
    margin-left: 0.5rem;
}

.modal-body label {
    display: block;
    margin-bottom: 0.5rem;
    font-weight: normal;
    color: var(--text-color);
}

.modal-actions {
    display: flex;
    justify-content: flex-end;
    gap: 0.5rem;
}

/* Login Page Styles */
.login-container {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 100vh;
    padding: 2rem;
}

.login-box {
    background-color: var(--bg-color);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    padding: 3rem;
    text-align: center;
    max-width: 400px;
    width: 100%;
}

.login-box .brand-logo {
    max-width: 250px;
    margin-bottom: 1.5rem;
}

.login-box h2 {
    font-size: 1.8rem;
    font-weight: normal;
    color: var(--text-color);
    margin-bottom: 0.5rem;
}

.login-subtitle {
    color: var(--text-light);
    margin-bottom: 2rem;
    font-size: 0.95rem;
}

.btn-github {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0.75rem 1.5rem;
    background-color: #24292e;
    color: white;
    border-radius: 6px;
    text-decoration: none;
    font-size: 1rem;
    transition: background-color 0.2s;
    border: none;
    cursor: pointer;
}

.btn-github:hover {
    background-color: #1a1e22;
}

/* Home Header Auth Buttons */
.home-header-top {
    display: flex;
    justify-content: space-between;
    align-items: center;
    width: 100%;
    max-width: 1200px;
    margin: 0 auto;
}

.auth-buttons {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.user-info {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.user-avatar {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    border: 2px solid var(--border-color);
}

.user-avatar-small {
    width: 24px;
    height: 24px;
    border-radius: 50%;
    border: 1px solid var(--border-color);
}

.username {
    color: var(--text-color);
    font-size: 0.9rem;
}

.username-small {
    color: var(--text-color);
    font-size: 0.85rem;
    margin-right: 0.5rem;
}

.user-info-small {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin-right: 0.5rem;
}

.btn-small {
    padding: 0.4rem 1rem;
    font-size: 0.85rem;
}

.logout-link {
    display: inline-flex;
    align-items: center;
    color: var(--text-color);
    text-decoration: none;
    transition: opacity 0.2s;
}

.logout-link:hover {
    opacity: 0.7;
}

/* Account Modal */
.account-modal-content {
    max-width: 400px;
    text-align: center;
    padding: 0;
    position: relative;
    z-index: 10001;
    pointer-events: auto;
}

body.dark-mode .account-modal-content {
    background-color: var(--bg-color);
    color: var(--text-color);
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.5);
}

.account-modal-header {
    padding: 2rem 2rem 1rem 2rem;
    border-bottom: 1px solid var(--border-color);
    display: flex;
    justify-content: center;
    align-items: center;
}

.account-modal-logo {
    max-width: 200px;
    height: auto;
    margin: 0;
}

.account-modal-body {
    padding: 2rem;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 1rem;
}

.account-avatar-container {
    margin-bottom: 0.5rem;
}

.account-avatar {
    width: 120px;
    height: 120px;
    border-radius: 50%;
    border: 3px solid var(--border-color);
    object-fit: cover;
}

.account-avatar-placeholder {
    width: 120px;
    height: 120px;
    border-radius: 50%;
    border: 3px solid var(--border-color);
    background-color: var(--sidebar-bg);
    margin: 0 auto;
}

.account-name {
    font-size: 1.5rem;
    font-weight: normal;
    color: var(--text-color);
    font-family: Arial, sans-serif;
    margin: 0.5rem 0;
}

.account-sync-status {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.25rem;
    color: var(--text-light);
    font-size: 0.9rem;
    margin: 0.5rem 0;
}

.account-sync-status svg {
    fill: var(--brand-orange);
}

.account-modal-actions {
    margin-top: 1.5rem;
    width: 100%;
}

.account-logout-btn {
    width: 100%;
    padding: 0.75rem 2rem;
    font-size: 1rem;
}

/* Responsive */
@media (max-width: 768px) {
    .split-view {
        flex-direction: column;
        height: auto;
    }
    
    .sidebar {
        width: 100%;
        border-right: none;
        border-bottom: 1px solid var(--border-color);
    }
    
    .app-container {
        padding: 1rem;
    }
    
    .journals-container {
        flex-direction: column;
        align-items: center;
    }
    
    .journal-card {
        width: 100%;
        max-width: 300px;
    }
}
