/* MINIMAL GOOGLE DOCS STYLE - NO IDE */

:root {
    --bg-primary: #1a1b26;
    --bg-secondary: #16161e;
    --bg-tertiary: #24283b;
    --bg-hover: #2d3149;
    --border-color: #292e42;
    --text-primary: #c0caf5;
    --text-secondary: #9aa5ce;
    --text-muted: #565f89;
    --accent-primary: #7aa2f7;
    --accent-secondary: #bb9af7;
    --paper-bg: #3d4363;
    --paper-text: #c0caf5;
    --paper-heading: #ffffff;
}

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

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
    background: var(--bg-primary);
    color: var(--text-primary);
    overflow-x: hidden;
}

/* Trial Text Inline (in nav) */
.trial-text-inline {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-left: 16px;
    font-size: 13px;
}

.trial-separator {
    color: var(--border-color);
    font-weight: 300;
    margin: 0 4px;
}

.trial-message {
    color: var(--text-muted);
    white-space: nowrap;
}

.trial-signup-link {
    color: var(--accent-primary);
    text-decoration: none;
    font-weight: 600;
    padding: 3px 8px;
    border-radius: 4px;
    background: rgba(122, 162, 247, 0.1);
    transition: all 0.2s;
    border: 1px solid transparent;
    white-space: nowrap;
}

.trial-signup-link:hover {
    background: rgba(122, 162, 247, 0.2);
    border-color: var(--accent-primary);
}

.trial-info {
    color: var(--text-muted);
    white-space: nowrap;
}

/* Top Navigation */
.top-nav {
    height: 48px;
    background: var(--bg-secondary);
    border-bottom: 1px solid var(--border-color);
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 16px;
    z-index: 100;
}

/* Toolbar */
.toolbar {
    height: 44px;
    background: var(--bg-secondary);
    border-bottom: 1px solid var(--border-color);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0 16px;
    gap: 4px;
    position: sticky;
    top: 0;
    z-index: 99;
}

.toolbar-btn {
    width: 32px;
    height: 32px;
    border: none;
    background: transparent;
    color: var(--text-secondary);
    cursor: pointer;
    border-radius: 4px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
}

.toolbar-btn:hover {
    background: var(--bg-hover);
    color: var(--text-primary);
}

.toolbar-btn.is-active {
    background: var(--bg-hover);
    color: var(--accent-primary);
}

.toolbar-divider {
    width: 1px;
    height: 24px;
    background: var(--border-color);
    margin: 0 8px;
}

.nav-left {
    display: flex;
    align-items: center;
    gap: 24px;
    flex: 1;
}

.logo-link {
    display: flex;
    align-items: center;
    gap: 8px;
    text-decoration: none;
    padding: 8px 12px;
    border-radius: 6px;
    transition: background 0.2s ease;
}

.logo-link:hover {
    background: var(--bg-hover);
}

.logo-icon {
    font-size: 20px;
    color: var(--accent-primary);
}

.logo-text {
    font-size: 14px;
    font-weight: 600;
    background: linear-gradient(135deg, var(--accent-primary), var(--accent-secondary));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.nav-right {
    display: flex;
    align-items: center;
    gap: 8px;
}

.btn-download,
.btn-close {
    background: transparent;
    border: none;
    color: var(--text-secondary);
    padding: 8px;
    border-radius: 6px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
}

.btn-download:hover,
.btn-close:hover {
    background: var(--bg-hover);
    color: var(--accent-primary);
}

/* Delete Button */
.btn-delete {
    background: transparent;
    border: none;
    color: var(--text-secondary);
    padding: 8px;
    border-radius: 6px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
}

.btn-delete:hover {
    background: rgba(255, 107, 107, 0.1);
    color: #ff6b6b;
}

/* Export Button */
.btn-export {
    display: flex;
    align-items: center;
    gap: 6px;
    background: var(--accent-primary);
    color: white;
    border: none;
    border-radius: 6px;
    padding: 8px 16px;
    cursor: pointer;
    font-size: 13px;
    font-weight: 600;
    transition: all 0.2s ease;
}

.btn-export:hover {
    background: var(--accent-secondary);
    transform: translateY(-1px);
}

/* Editor Wrapper */
.editor-wrapper {
    padding: 48px 0;
    min-height: calc(100vh - 92px);
    background: transparent;
    display: flex;
    justify-content: center;
}

.pages-container {
    display: flex;
    flex-direction: row;
    align-items: flex-start;
    justify-content: center;
    gap: 24px;
    width: 100%;
    max-width: none;
    background: transparent;
    transition: all 0.3s ease;
}

.pages-container.single-page {
    max-width: 816px;
}

.main-pages {
    width: 100%;
    max-width: 816px;
    position: relative;
}

#mainPages {
    width: 100%;
    background: var(--bg-primary);
    min-height: calc(100vh - 96px);
}

/* Clean continuous editor */
.editor {
    width: 100%;
    outline: none !important;
    border: none !important;
    background: transparent;
}

.editor .ProseMirror {
    outline: none !important;
    background: transparent;
    color: var(--paper-text);
    font-family: 'Crimson Pro', serif;
    font-size: 16px !important;
    line-height: 1.6;
    padding: 72px 96px;
    min-height: calc(100vh - 96px);
    tab-size: 4;
    -moz-tab-size: 4;
    white-space: pre-wrap;
    border-left: 1px solid var(--border-color);
    border-right: 1px solid var(--border-color);
    max-width: 816px;
    margin: 0 auto;
}

.editor .ProseMirror * {
    font-size: inherit;
}

.editor .ProseMirror p {
    margin: 0;
    color: var(--paper-text);
    line-height: 1.6;
    font-size: 16px;
}

.editor .ProseMirror-focused {
    caret-color: var(--accent-primary);
}

/* Placeholder styling */
.editor .ProseMirror p.is-editor-empty:first-child {
    position: relative;
}

.editor .ProseMirror p.is-editor-empty:first-child::before {
    content: attr(data-placeholder);
    color: #9aa5ce;
    pointer-events: none;
    position: absolute;
    white-space: pre-wrap;
    tab-size: 4;
    -moz-tab-size: 4;
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    font-size: 18px;
    line-height: 1.8;
    font-weight: 500;
    letter-spacing: 0.01em;
}

/* Typography */
.editor h1 {
    font-size: 32px;
    font-weight: 700;
    margin: 0;
    line-height: 1.3;
    color: var(--paper-heading);
}

.editor h2 {
    font-size: 24px;
    font-weight: 600;
    margin: 0;
    line-height: 1.3;
    color: var(--paper-heading);
}

.editor h3 {
    font-size: 20px;
    font-weight: 600;
    margin: 0;
    line-height: 1.3;
    color: var(--paper-heading);
}

.editor p {
    margin: 0;
    color: var(--paper-text);
    line-height: 1.6;
    font-size: 16px;
}

.editor ul,
.editor ol {
    padding-left: 24px;
    margin: 12px 0;
    color: var(--paper-text);
}

.editor li {
    margin: 4px 0;
    color: var(--paper-text);
}

.editor strong {
    font-weight: 700;
}

.editor em {
    font-style: italic;
}

.editor u {
    text-decoration: underline;
}

/* Line Break Dividers */
.line-break-divider {
    position: relative;
    margin: 32px 0;
    padding: 12px 0;
    border-top: 3px solid white;
    background: rgba(255, 255, 255, 0.03);
    display: flex;
    gap: 12px;
    justify-content: center;
}

.line-break-delete,
.line-break-export {
    padding: 6px 12px;
    border: none;
    border-radius: 6px;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
}

.line-break-delete {
    background: rgba(255, 107, 107, 0.9);
    color: white;
}

.line-break-delete:hover {
    background: #ff6b6b;
}

.line-break-export {
    background: rgba(122, 162, 247, 0.9);
    color: white;
}

.line-break-export:hover {
    background: var(--accent-primary);
}

/* Export Modal */
.export-modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.7);
    display: none;
    align-items: center;
    justify-content: center;
    z-index: 1000;
}

.export-modal-overlay.active {
    display: flex;
}

.export-modal {
    background: var(--bg-secondary);
    border-radius: 12px;
    width: 500px;
    max-width: 90%;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.5);
}

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

.export-modal-header h2 {
    font-size: 18px;
    font-weight: 600;
    color: var(--text-primary);
}

.export-modal-close {
    background: none;
    border: none;
    font-size: 24px;
    color: var(--text-secondary);
    cursor: pointer;
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 6px;
}

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

.export-modal-body {
    padding: 20px;
}

.export-option-buttons {
    display: flex;
    gap: 12px;
    margin-bottom: 20px;
}

.export-option-btn {
    flex: 1;
    padding: 12px;
    background: var(--bg-tertiary);
    border: 2px solid transparent;
    border-radius: 8px;
    color: var(--text-secondary);
    cursor: pointer;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 6px;
    transition: all 0.2s;
}

.export-option-btn:hover {
    background: var(--bg-hover);
}

.export-option-btn.active {
    border-color: var(--accent-primary);
    background: rgba(122, 162, 247, 0.1);
    color: var(--accent-primary);
}

.export-panel {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.export-panel.hidden {
    display: none;
}

.export-panel label {
    font-size: 13px;
    font-weight: 600;
    color: var(--text-secondary);
}

.export-input,
.export-textarea,
.path-input {
    width: 100%;
    padding: 10px 12px;
    background: var(--bg-tertiary);
    border: 1px solid var(--border-color);
    border-radius: 6px;
    color: var(--text-primary);
    font-size: 14px;
}

.export-input:focus,
.export-textarea:focus,
.path-input:focus {
    outline: none;
    border-color: var(--accent-primary);
}

.export-input:disabled,
.export-textarea:disabled,
.path-input:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    background: var(--bg-secondary);
}

.export-textarea {
    resize: vertical;
    font-family: inherit;
}

.path-input-container {
    position: relative;
}

.path-input {
    width: 100%;
    background: var(--bg-tertiary);
    border: 1px solid var(--border-color);
    border-radius: 6px;
    padding: 10px 12px;
    font-size: 14px;
    color: var(--text-primary);
    outline: none;
    transition: all 0.2s ease;
    font-family: 'JetBrains Mono', monospace;
}

.path-input:focus {
    border-color: var(--accent-primary);
    box-shadow: 0 0 0 3px rgba(122, 162, 247, 0.1);
}

.path-input::placeholder {
    color: var(--text-muted);
    font-style: italic;
}

.path-suggestions {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: var(--bg-tertiary);
    border: 1px solid var(--border-color);
    border-top: none;
    border-radius: 0 0 6px 6px;
    max-height: 200px;
    overflow-y: auto;
    display: none;
    z-index: 10;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
}

.path-suggestions.active {
    display: block;
}

.path-suggestion-item {
    padding: 10px 12px;
    display: flex;
    align-items: center;
    gap: 8px;
    cursor: pointer;
    color: var(--text-secondary);
    transition: all 0.15s ease;
}

.path-suggestion-item:hover {
    background: var(--bg-hover);
    color: var(--text-primary);
}

.path-suggestion-item svg {
    flex-shrink: 0;
    opacity: 0.7;
    color: var(--accent-primary);
}

.path-suggestion-item:hover svg {
    opacity: 1;
}

.export-hint {
    font-size: 12px;
    color: var(--text-muted);
    margin: 8px 0 0 0;
    display: flex;
    align-items: center;
    gap: 6px;
}

.export-hint svg {
    flex-shrink: 0;
    opacity: 0.7;
}

.export-modal-footer {
    padding: 20px;
    border-top: 1px solid var(--border-color);
    display: flex;
    justify-content: flex-end;
    gap: 12px;
}

.export-btn-cancel,
.export-btn-confirm {
    padding: 10px 20px;
    border-radius: 6px;
    border: none;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
}

.export-btn-cancel {
    background: var(--bg-tertiary);
    color: var(--text-secondary);
}

.export-btn-cancel:hover {
    background: var(--bg-hover);
}

.export-btn-confirm {
    background: var(--accent-primary);
    color: white;
}

.export-btn-confirm:hover {
    background: var(--accent-secondary);
}

.export-btn-confirm:disabled {
    background: var(--bg-tertiary);
    color: var(--text-muted);
    cursor: not-allowed;
    opacity: 0.6;
}

/* Delete Modal */
.delete-modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.7);
    display: none;
    align-items: center;
    justify-content: center;
    z-index: 1000;
}

.delete-modal-overlay.active {
    display: flex;
}

.delete-modal {
    background: var(--bg-secondary);
    border-radius: 12px;
    width: 400px;
    max-width: 90%;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.5);
}

.delete-modal-header {
    padding: 20px;
    border-bottom: 1px solid var(--border-color);
}

.delete-modal-header h2 {
    font-size: 18px;
    font-weight: 600;
    color: #ff6b6b;
}

/* Merge modal gets blue color instead of red */
#mergeModalOverlay .delete-modal-header h2 {
    color: var(--accent-primary);
}

.delete-modal-body {
    padding: 20px;
}

.delete-warning {
    font-size: 14px;
    color: var(--text-primary);
    margin-bottom: 12px;
}

.delete-details {
    font-size: 13px;
    color: var(--text-secondary);
}

.delete-modal-footer {
    padding: 20px;
    border-top: 1px solid var(--border-color);
    display: flex;
    justify-content: flex-end;
    gap: 12px;
}

.delete-btn-cancel,
.delete-btn-confirm {
    padding: 10px 20px;
    border-radius: 6px;
    border: none;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
}

.delete-btn-cancel {
    background: var(--bg-tertiary);
    color: var(--text-secondary);
}

.delete-btn-cancel:hover {
    background: var(--bg-hover);
}

.delete-btn-confirm {
    background: #ff6b6b;
    color: white;
}

.delete-btn-confirm:hover {
    background: #ff4444;
}

/* Scrollbar */
::-webkit-scrollbar {
    width: 10px;
}

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

::-webkit-scrollbar-thumb {
    background: var(--bg-tertiary);
    border-radius: 5px;
}

::-webkit-scrollbar-thumb:hover {
    background: var(--bg-hover);
}

/* Floating Action Button */
.floating-action-btn {
    position: sticky;
    right: -30px;
    top: 100px;
    min-width: 100px;
    height: 44px;
    padding: 0 8px;
    background: var(--accent-primary);
    border: none;
    border-radius: 10px;
    color: white;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 4px 12px rgba(122, 162, 247, 0.3);
    transition: all 0.3s ease;
    z-index: 50;
    font-size: 13px;
    font-weight: 600;
    font-family: 'Inter', sans-serif;
    float: right;
    margin-right: -30px;
}

.floating-action-btn:hover {
    background: var(--accent-secondary);
    transform: translateY(-2px) scale(1.05);
    box-shadow: 0 6px 20px rgba(122, 162, 247, 0.5);
}

.floating-action-btn:active {
    transform: translateY(0) scale(0.95);
}

/* Close Button - Top */
.close-btn {
    position: sticky !important;
    top: 100px !important;
    right: -30px !important;
    background: var(--text-muted);
    float: right !important;
    margin-right: -30px !important;
    display: flex !important;
}

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

/* Merge Button - Middle (default position is 100px, this one goes below close) */
#floatingBtn2 {
    top: 156px !important;
    margin-top: 10px !important;
    clear: right !important;
}

/* Delete Copy Button - Bottom */
.delete-copy-btn {
    position: sticky !important;
    top: 212px !important;
    right: -30px !important;
    background: #ff6b6b;
    float: right !important;
    margin-right: -30px !important;
    margin-top: 10px !important;
    display: flex !important;
    clear: right !important;
}

.delete-copy-btn:hover {
    background: #ff4444;
}

/* Animations */
@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

@keyframes slideUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* ============================================ */
/* RESPONSIVE STYLES - MAC VS PC */
/* ============================================ */

/* Mac Display Optimization (typical MacBook/smaller displays) */
@media screen and (max-width: 1728px) {
    /* Narrower pages for Mac */
    .pages-container.single-page {
        max-width: 616px;
    }

    .main-pages {
        max-width: 616px;
    }

    .editor .ProseMirror {
        max-width: 616px;
        padding: 72px 60px; /* Less padding for narrower page */
    }

    /* Move buttons further to the right (negative = outside the page) */
    .floating-action-btn {
        right: -50px !important;
        margin-right: -50px !important;
    }

    .close-btn {
        right: -50px !important;
        margin-right: -50px !important;
    }

    .delete-copy-btn {
        right: -50px !important;
        margin-right: -50px !important;
    }
}

/* PC Display Optimization (larger displays/external monitors) */
@media screen and (min-width: 1729px) {
    /* Keep wider pages for PC */
    .pages-container.single-page {
        max-width: 716px;
    }

    .main-pages {
        max-width: 716px;
    }

    .editor .ProseMirror {
        max-width: 716px;
        padding: 72px 96px;
    }

    /* Keep current button positions on PC */
    .floating-action-btn {
        right: -76px !important;
        margin-right: -36px !important;
    }

    .close-btn {
        right: -76px !important;
        margin-right: -36px !important;
    }

    .delete-copy-btn {
        right: -76px !important;
        margin-right: -36px !important;
    }
}