:root {
    --primary-color: rgb(157, 157, 189);
    --text-color: #1b1f23;
    --background-color: #ffffff;
    --secondary-bg: #f6f8fa;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
    margin: 0;
    padding: 0;
    color: var(--text-color);
    line-height: 1.5;
    height: 100vh;
}

.top-nav {
    background: var(--background-color);
    border-bottom: 1px solid #e1e4e8;
    padding: 1rem 2rem;
}

.nav-content {
    max-width: 1200px;
    margin: 0 auto;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.nav-right {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.nav-right a {
    color: var(--text-color);
    text-decoration: none;
    font-size: 0.9rem;
}

.nav-right a i {
    margin-right: 0.5rem;
}

.hero-section {
    padding: 4rem 2rem;
    background: var(--background-color);
    text-align: center;
    display: flex;
    align-items: center;
}

.hero-content {
    max-width: 1200px;
    margin: 0 auto;
}

h1 {
    font-size: 2.5rem;
    margin-bottom: 2rem;
    line-height: 1.2;
}

h1 i {
    color: var(--primary-color);
    margin-right: 0.5rem;
}

.auth-buttons {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 1rem;
    max-width: 300px;
    margin: 0 auto;
}

.btn-google {
    width: 100%;
    padding: 0.8rem;
    border: 1px solid #e1e4e8;
    border-radius: 6px;
    background: white;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    cursor: pointer;
    transition: background-color 0.3s ease, transform 0.2s ease;
    font-size: 1rem;
    outline: none;
}

.btn-google i {
    color: rgb(157, 157, 189);
    font-size: 1.2rem;
}

.btn-google:hover {
    background-color: #f6f8fa;
    transform: translateY(-1px);
}

.member-note {
    font-size: 0.8rem;
    margin-top: 1rem;
}

.member-note i {
    color: var(--primary-color);
    margin-right: 0.3rem;
}

.member-note a {
    color: rgb(111, 111, 111);
    text-decoration: none;
}

.member-note a:hover {
    color: #09dac2;
    text-decoration: underline;
}

.loading {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    text-align: center;
}

.editor-details {
    margin-top: 3rem;
    text-align: left;
    background-color: var(--card-background, #ffffff);
    padding: 0.5rem 2rem;
    border-radius: 8px;
    box-shadow: 0 0 8px rgba(0, 0, 0, 0.1);
    max-width: 1200px;
    margin-left: auto;
    margin-right: auto;
}

.editor-details h2,
.editor-details h3 {
    color: var(--primary-color);
    margin-bottom: 1rem;
}

.editor-details p {
    font-size: 1rem;
    margin-bottom: 1.5rem;
    line-height: 1.6;
    color: var(--text-color, #333);
}

.editor-details ul,
.editor-details ol {
    padding-left: 1.5rem;
    margin-bottom: 1.5rem;
    list-style-position: inside;
}

.editor-details ul li {
    margin-bottom: 0.75rem;
    font-size: 1rem;
    color: var(--text-color, #444);
    line-height: 1.6;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.editor-details ol li {
    margin-bottom: 0.75rem;
    font-size: 1rem;
    color: var(--text-color, #444);
    line-height: 1.6;
}

.editor-details ul li i {
    color: var(--primary-color);
    margin-right: 0.5rem;
}

.note {
    background-color: #f0f9f8;
    padding: 1rem;
    border-left: 4px solid var(--primary-color);
    font-style: italic;
    color: #225f5b;
    border-radius: 4px;
}

.logo {
    color: var(--text-color);
    text-decoration: none;
    font-weight: 600;
    font-size: 1.2rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    user-select: none;
}

.logo i {
    color: var(--primary-color);
    font-size: 1.4rem;
}

.divider {
    width: 100%;
    text-align: center;
    position: relative;
    margin: 1rem 0;
}

.divider::before,
.divider::after {
    content: '';
    position: absolute;
    top: 50%;
    width: 45%;
    height: 1px;
    background: #e1e4e8;
}

.divider::before { left: 0; }
.divider::after { right: 0; }

.divider span {
    background: white;
    padding: 0 1rem;
    color: #586069;
    font-size: 0.9rem;
}

.btn-logout {
    background-color: #f6f8fa;
    border: 1px solid #e1e4e8;
    color: var(--text-color);
    cursor: pointer;
    font-size: 0.9rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.5rem 1rem;
    border-radius: 6px;
    transition: all 0.2s ease;
    font-weight: 500;
    outline: none;
}

.btn-logout:hover {
    background-color: #e1e4e8;
    transform: translateY(-1px);
    box-shadow: 0 2px 4px rgba(0,0,0,0.05);
}

.btn-logout i {
    font-size: 1rem;
    color: #586069;
}

.btn-logout:hover i {
    color: var(--text-color);
}


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

.user-avatar {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    overflow: hidden;
}

.user-avatar img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.user-name {
    font-size: 1rem;
    font-weight: 500;
    color: var(--text-color);
}

#projects-container {
    max-width: 1200px;
    margin: 2rem auto;
    padding: 0 2rem;
    height: 100vh;
    overflow-y: auto;
}

.projects-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 2rem;
}

.projects-header h2 {
    font-size: 1.5rem;
    color: var(--text-color);
    margin: 0;
}

.projects-grid {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    width: 100%;
    max-width: 1200px;
    margin: 0 auto;
    padding: 1rem;
    box-sizing: border-box;
}

.project-card {
    background: white;
    border: 1px solid #e1e4e8;
    border-radius: 8px;
    padding: 0.75rem 1rem;
    transition: box-shadow 0.2s ease, transform 0.2s ease;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    position: relative;
    cursor: pointer;
}

.project-card:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    color: rgba(157, 157, 189, 1);
}

.project-card:hover .project-title {
    color: rgba(157, 157, 189, 1);
}

.project-title {
    font-size: 1rem;
    font-weight: 600;
    margin: 0;
    flex: 1;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.project-meta {
    font-size: 0.85rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    flex-wrap: wrap;
}

.project-meta i {
    color: var(--primary-color, #0969da);
}

.role-badge {
    padding: 0.2rem 0.5rem;
    border-radius: 12px;
    font-size: 0.75rem;
    font-weight: 500;
    text-transform: uppercase;
}

.role-badge.owner {
    background-color: #2da44e22;
    color: #2da44e;
}

.role-badge.editor {
    background-color: #0969da22;
    color: #0969da;
}

.role-badge.viewer {
    background-color: #6e768166;
    color: #6e7681;
}

.project-delete {
    color: #ff4d4f;
    padding: 0.25rem 0.5rem;
    border-radius: 5px;
    background-color: transparent;
    cursor: pointer;
    z-index: 100;
    transition: background-color 0.2s ease, color 0.2s ease;
}

.project-delete:hover {
    background-color: #ff4d50b6;
    color: #ffffff;
}

.btn-primary {
    background-color: var(--primary-color, #2da44e);
    color: white;
    border: none;
    padding: 0.5rem 1rem;
    border-radius: 6px;
    cursor: pointer;
    font-size: 0.9rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    transition: all 0.2s ease;
}

.btn-primary:hover {
    background-color: #2c974b;
    transform: translateY(-1px);
}

.no-projects {
    text-align: center;
    padding: 3rem;
    background: #f8f9fa;
    border-radius: 6px;
    border: 1px dashed #e1e4e8;
}

.no-projects i {
    font-size: 2.5rem;
    color: #586069;
    margin-bottom: 1rem;
}

.no-projects p {
    margin: 0;
    color: #24292e;
    font-size: 1.1rem;
}

.no-projects .sub-text {
    color: #586069;
    font-size: 0.9rem;
    margin-top: 0.5rem;
}

.editor-header {
    display: flex;
    align-items: center;
    padding: 0.45rem 1rem;
    border-bottom: 1px solid #d0d7de;
    background: white;
    gap: 0.5rem;
}

.btn-back {
    background: none;
    border: none;
    width: 32px;
    height: 32px;
    border-radius: 6px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    color: #57606a;
    transition: all 0.2s ease;
    outline: none;
}

.btn-back:hover {
    background: #e1e4e7;
    color: #24292f;
}

.title-container {
    flex: 1;
    min-width: 0;
}

.title-input {
    font-size: 1.1rem;
    font-weight: 500;
    border: 1px solid transparent;
    padding: 0.25rem 0.5rem;
    border-radius: 4px;
    background: transparent;
    color: #24292f;
    width: -webkit-fill-available;
    min-width: 200px;
    max-width: 700px;
}

.title-input:hover {
    border-color: #d0d7de;
}

.title-input:focus {
    border-color: #0969da;
    outline: none;
    background: white;
}

.features {
    padding: 4rem 2rem;
    background: var(--secondary-bg);
}

.feature-grid {
    max-width: 1200px;
    margin: 0 auto;
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 2rem;
    padding: 2rem 0;
}

.feature-card {
    background: white;
    padding: 2rem;
    border-radius: 8px;
    box-shadow: 0 1px 3px rgba(0,0,0,0.1);
}

#editor-container {
    height: 100vh;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    background-color: #24292e;
}

.editor-pane {
    position: relative;
    border-right: 1px solid #e1e4e8;
    height: calc(100% - 50px);
    overflow: hidden;
}

.editor-pane.file-tab-on {
    margin-left: 200px;
}

.btn-menu {
    background: none;
    border: none;
    cursor: pointer;
    color: #57606a;
    padding: 0.5rem;
    border-radius: 4px;
    font-size: 1rem;
    transition: all 0.2s ease;
    outline: none;
}

.btn-menu:hover {
    background: #e1e4e7;
    color: #24292f;
}

.editor-container {
    position: relative;
    height: 100%;
    overflow: hidden;
}

.line-numbers {
    position: absolute;
    top: 0;
    left: 0;
    padding: 1rem 0.5rem;
    background-color: #24292e;
    border-right: 1px solid #e1e4e8;
    border-left: 1px solid #e1e4e8;
    color: #8a8a8a;
    font-family: 'Monaco', 'Menlo', 'Ubuntu Mono', monospace;
    font-size: 14px;
    line-height: 1.5;
    text-align: right;
    user-select: none;
    min-width: 30px;
    white-space: pre;
    min-height: 100%;
    z-index: 1;
    pointer-events: none;
}

.latex-editor {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    padding: 1rem 1rem 1rem 65px;
    border: none;
    font-family: 'Monaco', 'Menlo', 'Ubuntu Mono', monospace;
    font-size: 14px;
    line-height: 1.5;
    resize: none;
    outline: none;
    tab-size: 4;
    background-color: #24292e;
    color: #ececec;
    white-space: pre;
    overflow: auto;
    width: 100%;
    box-sizing: border-box;
}

.editor-wrapper {
    display: grid;
    grid-template-columns: 1fr auto;
    flex-grow: 1;
    overflow: hidden;
    height: 100%;
}

.editor-container::-webkit-scrollbar {
    width: 8px;
}

.editor-container::-webkit-scrollbar-track {
    background: #f1f3f5;
}

.editor-container::-webkit-scrollbar-thumb {
    background: #d1d5da;
    border-radius: 4px;
}

.editor-container::-webkit-scrollbar-thumb:hover {
    background: #a5aaaf;
}

.pdf-container::-webkit-scrollbar {
    width: 8px;
    height: 8px;
}

.pdf-container::-webkit-scrollbar-track {
    background: #f1f3f5;
}

.pdf-container::-webkit-scrollbar-thumb {
    background: #d1d5da;
    border-radius: 4px;
}

.pdf-container::-webkit-scrollbar-thumb:hover {
    background: #a5aaaf;
}

.title-save-indicator {
    font-size: 0.8rem;
    color: #57606a;
    opacity: 0;
    transition: opacity 0.2s ease;
}

.title-save-indicator.show {
    opacity: 1;
}

.save-indicator {
    color: #57606a;
    font-size: 0.9rem;
    min-width: 100px;
    text-align: right;
}

/* Preview styling */
.preview {
    height: calc(100% - 50px);
    overflow-y: auto;
    background-color: #24292e;
    position: relative;
    flex: 1 1 auto;
}

.preview iframe {
    border: none;
    width: 100%;
    height: 100%;
}

/* Preview header */
.preview-header {
    display: flex;
    justify-content: flex-end;
    padding: 0.5rem;
    position: absolute;
    bottom: 10px;
    right: 10px;
    z-index: 100000;
}

.btn-pdf {
    background: #24292e;
    border: 1px solid #d8d8d8;
    color: #d8d8d8;
    cursor: pointer;
    padding: 0.5rem;
    border-radius: 4px;
    box-shadow: 0 0 5px rgba(255, 255, 255, 0.5);
    transition: all 0.2s ease;
}

.btn-pdf:hover {
    background-color: #585d69;
}

.btn-fullscreen {
    background: #24292e;
    border: 1px solid #d8d8d8;
    color: #d8d8d8;
    cursor: pointer;
    padding: 0.5rem;
    border-radius: 4px;
    margin-right: 0.5rem;
    box-shadow: 0 0 5px rgba(255, 255, 255, 0.5);
    transition: all 0.2s ease;
}

.btn-fullscreen:hover {
    background-color: #585d69;
}

/* Full screen preview styles */
.preview.fullscreen {
    position: fixed;
    top: 0;
    left: 0;
    width: 100% !important;
    height: 100%;
    z-index: 1000;
    background-color: #24292e;
}

.preview.fullscreen .btn-fullscreen i {
    transform: rotate(180deg);
}

/* Adjust preview content for fullscreen */
.preview.fullscreen .compile-status,
.preview.fullscreen .compile-error,
.preview.fullscreen iframe {
    height: calc(100% - 48px); /* Account for header */
}

/* MathJax styling */
.preview .MathJax {
    font-size: 115% !important;
}

/* LaTeX document styling */
.preview .theorem,
.preview .definition,
.preview .lemma {
    margin: 1rem 0;
    padding: 0.5rem 1rem;
    border-left: 3px solid #0366d6;
    background: #f6f8fa;
}

.preview .proof {
    margin: 1rem 0;
    padding: 0.5rem 1rem;
}

.btn-secondary {
    padding: 0.5rem 1rem;
    border: 1px solid #e1e4e8;
    border-radius: 6px;
    background: white;
    color: #24292e;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.9rem;
    transition: all 0.2s ease;
}

.btn-secondary:hover {
    background: #f6f8fa;
    border-color: #d1d5da;
}

.preview-error {
    color: #cb2431;
    padding: 1rem;
    background: #ffeef0;
    border-radius: 6px;
    margin-bottom: 1rem;
}

.compile-status {
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 10rem 1rem;
    color: #d8d8d8;
    height: 100%;
    background-color: #24292e;
}

.compile-status i {
    font-size: 2rem;
    margin-bottom: 1rem;
    color: #acc2da;
}

.compile-status p {
    margin: 0;
    font-size: 0.9rem;
}

.compile-error {
    padding: 1rem;
    background-color: #24292e;
    border: 1px solid #ff0000;
    border-radius: 4px;
    margin: 1rem 1rem 0 1rem;
    overflow: auto;
    max-height: calc(100vh - 160px);
    font-family: 'Monaco', 'Menlo', 'Ubuntu Mono', 'Consolas', monospace;
    font-size: 14px;
    line-height: 1.5;
}

.compile-error p {
    color: #e8e8e8;
}

.compile-error h3 {
    color: #ff0000;
    margin-top: 0;
    font-size: 1.2em;
    border-bottom: 1px solid #eee;
    padding-bottom: 0.5rem;
}

.error-details {
    font-size: 14px;
}

.error-section {
    margin: 1rem 0;
    padding: 1rem;
    background-color: #3a4045;
    border-radius: 4px;
    color: #c0c0c0;
}

.error-section ul {
    color: #ff4848;
}

.error-section h4 {
    margin: 0 0 0.5rem 0;
    color: #e8e8e8;
}

.error-section pre {
    margin: 0;
    white-space: pre-wrap;
    word-wrap: break-word;
    max-width: 100%;
    overflow-x: auto;
    padding: 0.5rem;
    background-color: #24292e;
    color: #bfbfbf;
    border: 1px solid #a4a4a4;
    border-radius: 3px;
    margin-bottom: 1rem;
}

.error-section code {
    background-color: #24292e;
    padding: 0.2em 0.4em;
    border-radius: 3px;
    font-size: 0.9em;
}

/* Style for JSON content */
.error-section pre.json {
    color: #333;
}

.error-section pre.json .key {
    color: #0366d6;
}

.error-section pre.json .string {
    color: #22863a;
}

.error-section pre.json .number {
    color: #005cc5;
}

.error-section pre.json .boolean {
    color: #d73a49;
}

/* Add horizontal scrolling for very long lines */
.compile-error pre {
    overflow-x: auto;
    max-width: 100%;
    padding-bottom: 0.5rem; /* Space for potential scrollbar */
}

/* Make sure error messages don't cause horizontal scrolling of the page */
.compile-error * {
    max-width: 100%;
    box-sizing: border-box;
}

.btn-compile {
    padding: 0.5rem 1rem;
    background-color: #2ea44f;
    color: white;
    border: none;
    border-radius: 6px;
    font-size: 0.9rem;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    transition: background-color 0.2s;
}

.btn-compile:hover {
    background: #2c974b;
}

.btn-compile:disabled {
    background: #94d3a2;
    cursor: not-allowed;
}

.btn-compile i {
    font-size: 0.8rem;
}

.collaboration-indicator {
    position: absolute;
    top: 1rem;
    right: 1rem;
    background: #0969da;
    color: white;
    padding: 0.5rem 1rem;
    border-radius: 1rem;
    font-size: 0.8rem;
    opacity: 0;
    transition: opacity 0.3s ease;
    z-index: 10;
}

.collaboration-indicator.show {
    opacity: 1;
}

.save-indicator {
    color: #57606a;
    font-size: 0.8rem;
    margin-left: 1rem;
}

.title-save-indicator {
    color: #57606a;
    font-size: 0.8rem;
    margin-left: 0.5rem;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.title-save-indicator.show {
    opacity: 1;
}

/* Collaborators Button */
.btn-collaborators {
    padding: 0.5rem 1rem;
    color: black;
    border: 1px solid #c1c1c1;
    border-radius: 6px;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin-left: auto;
    font-size: 0.9rem;
}

.btn-collaborators:hover {
    box-shadow: 0 0 10px rgba(0, 0, 0, 0.1);
}

/* Collaborator Modal Styles */
.modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    z-index: 1000;
}

.modal.show {
    display: flex;
    align-items: center;
    justify-content: center;
}

.modal-content {
    background: white;
    border-radius: 8px;
    width: 90%;
    max-width: 500px;
    max-height: 80vh;
    overflow: hidden;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

.modal-header {
    padding: 1rem;
    border-bottom: 1px solid #e1e4e8;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.modal-header h2 {
    margin: 0;
    font-size: 1.25rem;
    color: #24292e;
    font-weight: 500;
}

.modal-close {
    background: none;
    border: none;
    font-size: 1.25rem;
    cursor: pointer;
    color: #57606a;
    padding: 0.25rem;
    border-radius: 4px;
}

.modal-close:hover {
    background: #f6f8fa;
    color: #24292f;
}

.modal-body {
    padding: 1rem;
    max-height: 60vh;
    overflow-y: auto;
}

/* Collaborator Input Section */
.collaborator-input {
    display: flex;
    gap: 0.75rem;
    margin-bottom: 1.5rem;
    padding-bottom: 1rem;
    border-bottom: 1px solid #e1e4e8;
}

.select-wrapper {
    position: relative;
    flex: 2;
}

.role-select-wrapper {
    flex: 1;
}

.user-select,
.role-select {
    width: 100%;
    padding: 0.5rem;
    border: 1px solid #d0d7de;
    border-radius: 6px;
    font-size: 0.9rem;
    color: #24292f;
    background: white;
}

.user-select:focus,
.role-select:focus {
    outline: none;
    box-shadow: 0 0 0 3px rgba(9, 105, 218, 0.1);
}

/* Collaborators List */
.collaborators-list {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.collaborator-item {
    display: flex;
    align-items: center;
    padding: 0.75rem;
    border: 1px solid #d0d7de;
    border-radius: 6px;
    background: white;
}

.collaborator-info {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    flex: 1;
    min-width: 0;
}

.collaborator-avatar {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    object-fit: cover;
}

.collaborator-name {
    font-weight: 500;
    color: #24292f;
    flex: 1;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.role-badge {
    font-size: 0.75rem;
    padding: 0.1rem 0.5rem;
    border-radius: 1rem;
    font-weight: 500;
}

.role-badge.owner {
    background-color: #2da44e22;
    color: #2da44e;
    border: 1px solid #2da44e44;
}

.role-badge.editor {
    background-color: #0969da22;
    color: #0969da;
    border: 1px solid #0969da44;
}

.role-badge.viewer {
    background-color: #6e768122;
    color: #57606a;
    border: 1px solid #6e768144;
}

.authors-count {
    margin-left: 0.5rem;
}

.collaborator-actions {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin-left: auto;
}

.remove-collaborator {
    padding: 0.25rem 0.5rem;
    border: none;
    background: none;
    color: #cf222e;
    cursor: pointer;
    border-radius: 4px;
}

.remove-collaborator:hover {
    background: #ffebe9;
}

/* Error Message */
.error-message {
    margin: 1rem 0;
    padding: 0.75rem 1rem;
    border-radius: 6px;
    background: #ffebe9;
    color: #cf222e;
    font-size: 0.9rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

/* Add Collaborator Button */
#add-collaborator {
    padding: 0.5rem 1rem;
    background: #2ea44f;
    color: white;
    border: none;
    border-radius: 6px;
    font-size: 0.9rem;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

#add-collaborator:hover {
    background: #2c974b;
}

#add-collaborator:disabled {
    background: #94d3a2;
    cursor: not-allowed;
}

#lock-message {
    position: fixed;
    top: 60px;
    left: 50%;
    transform: translateX(-50%);
    background-color: #f6f8fa;
    border: 1px solid #d0d7de;
    border-radius: 6px;
    padding: 8px 16px;
    display: none;
    z-index: 1000;
    font-size: 14px;
    color: #57606a;
    box-shadow: 0 1px 3px rgba(27,31,36,0.1);
}

#lock-message i {
    margin-right: 6px;
    color: #0969da;
}

#latex-input[readonly] {
    cursor: not-allowed;
}

#toggle-edit {
    padding: 0.5rem 1rem;
    border: 1px solid #d0d7de;
    border-radius: 6px;
    background: white;
    color: #24292f;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    transition: all 0.2s ease;
    white-space: nowrap;
    flex-shrink: 0;
}

#toggle-edit:hover {
    background: #f6f8fa;
    border-color: #bdc4cc;
}

#toggle-edit:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

#toggle-edit i {
    font-size: 0.9rem;
}

.editor-avatar {
    width: 30px;
    height: 30px;
    border-radius: 50%;
    object-fit: cover;
    transition: all 0.2s ease;
}

.active-editor:hover {
    cursor: pointer;
    box-shadow: 0 0 10px rgba(0, 0, 0, 0.5);
    transform: translateY(-1px);
}

.editor-status {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin-left: auto;
}

.editor-actions {
    display: flex;
    flex-direction: row-reverse;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    z-index: 6000;
}

.active-editor {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
    border-radius: 50%;
}

.active-editor.active{
    border: none;
    position: relative;
}

.active-editor.active::before {
    content: '';
    position: absolute;
    top: -2px; left: -2px; right: -2px; bottom: -2px;
    border-top: 3px solid #ff0000;
    border-radius: 50%;
    box-sizing: border-box;
    animation: rotate-border 2s linear infinite;
    pointer-events: none;
    z-index: 1;
}

@keyframes rotate-border {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

.active-editor:hover .active-user-info {
    display: block;
    transition: all 0.2s ease;
    z-index: 6000;
}

.active-editor .active-user-info {
    display: none;
    position: absolute;
    top: 35px;
    background-color: rgb(234, 232, 232);
    border-radius: 6px;
    border: 1px solid #e1e2e3;
    padding: 0.2rem 0.5rem;
    font-size: 0.8rem;
    white-space: nowrap;
    width: max-content;
    max-width: 300px;
    overflow: hidden;
    text-overflow: ellipsis;
    box-shadow: 0 0 10px rgba(0, 0, 0, 0.5);
    transition: all 0.2s ease;
}

#active-editor-avatar-div {
    width: 30px;
    height: 30px;
    border-radius: 50%;
    overflow: hidden;
    background: #e1e4e8;
    display: flex;
    align-items: center;
    justify-content: center;
}

#active-editor-avatar-div img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

#active-editor-avatar-div i {
    color: #57606a;
    font-size: 14px;
}

#active-editor-name {
    font-size: 0.9rem;
    color: #57606a;
    white-space: nowrap;
    line-height: 32px;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* Make sure buttons don't shrink */
.btn-back,
.btn-secondary,
.btn-collaborators,
.btn-compile {
    flex-shrink: 0;
}

/* Title container should grow to fill space */
.title-container {
    flex: 1;
    min-width: 0; /* Allows proper text truncation */
}

/* Editor actions should maintain size */
.editor-actions {
    flex-shrink: 0;
    margin: 0 auto 0 0; /* Push to left after title */
}

/* Ensure consistent button sizes */
.btn-secondary,
.btn-collaborators,
.btn-compile {
    height: 32px;
    padding: 0 12px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    font-size: 0.9rem;
}

/* Add these styles */
.file-tabs {
    position: absolute;
    display: flex;
    flex-direction: column;
    width: 180px;
    min-height: 50vh;
    max-height: calc(100vh - 60px);
    height: 100%;
    gap: 0.5rem;
    padding: 0.3rem;
    overflow-x: auto;
    scrollbar-width: 1px; /* For Firefox */
    scrollbar-color: #d1d5da #f6f8fa; /* For Firefox */
}

/* Webkit scrollbar styling */
.file-tabs::-webkit-scrollbar {
    height: 1px; /* Horizontal scrollbar height */
}

.file-tabs::-webkit-scrollbar-track {
    background: #f6f8fa;
    border-radius: 1px;
}

.file-tabs::-webkit-scrollbar-thumb {
    background: #d1d5da;
    border-radius: 1px;
}

.file-tabs::-webkit-scrollbar-thumb:hover {
    background: #a5aaaf;
}

.file-tab {
    padding: 0.2rem 0.5rem;
    cursor: pointer;
    font-size: 1rem;
    border-radius: 4px;
    color: white;
}

.file-tab .file-name {
    font-size: 0.9rem;
}

.file-tab.active {
    background-color: rgba(255, 255, 255, 0.2);
}
.file-tab.active:hover {
    background-color: rgba(255, 255, 255, 0.3);
}

.file-tab:hover:not(.active) {
    background-color: rgba(255, 255, 255, 0.1);
    transform: translateY(-1px);
}

.file-tab-header {
    color: white;
    padding: 10px 5px;
    border-bottom: 1px solid #b6b8ba;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.file-tab-header i {
    font-size: 1.2rem;
    cursor: pointer;
}

.file-tab-header i:hover {
    color: rgb(187, 186, 186);
    transform: translateY(-1px);
    transition: all 0.2s ease;
}

.upload-content {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 4px;
    color: white;
    padding: 0.2rem 0.5rem;
}

.upload-content .upload-button {
    cursor: pointer;
}

.upload-content .upload-button:hover {
    color: rgb(187, 186, 186);
    transform: translateY(-1px);
    transition: all 0.2s ease;
}

.upload-help {
    font-size: 0.75rem;
    color: #57606a;
}

.upload-tab:hover {
    background: #f0f6ff;
}

.figure-tab {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 1rem;
    position: relative;
}

.figure-tab .file-name {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.no-figures {
    padding: 0.2rem 0.5rem;
    font-size: 0.8rem;
    color: white;
}

.delete-figure {
    position: absolute;
    right: 5px;
    background: none;
    border: none;
    padding: 2px 6px;
    border-radius: 4px;
    color: #ff0011;
    background-color: rgb(222, 212, 212);
    cursor: pointer;
    opacity: 0;
    transition: opacity 0.2s ease;
}

.figure-tab:hover .delete-figure {
    opacity: 1;
}

.delete-figure:hover {
    background: #b6b6b6;
    transform: translateY(-1px);
}

.suggestion-box {
    position: fixed;
    background: white;
    border: 1px solid #ddd;
    border-radius: 4px;
    box-shadow: 0 2px 6px rgba(0,0,0,0.1);
    max-height: 200px;
    overflow-y: auto;
    z-index: 1000;
    font-family: monospace;
    animation: fadeIn 0.1s ease-out;
}

.suggestion-box.show-above {
    animation: slideUpFade 0.1s ease-out;
}

.suggestion-box.show-below {
    animation: slideDownFade 0.1s ease-out;
}

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

@keyframes slideDownFade {
    from {
        opacity: 0;
        transform: translateY(-10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.suggestion-item {
    padding: 4px 8px;
    cursor: pointer;
    white-space: nowrap;
}

.suggestion-item:hover {
    background-color: #f0f0f0;
}

.suggestion-item.selected {
    background-color: #e3f2fd;
}

.editor-container {
    position: relative;
}

/* Editor Resizer for drag-to-resize */
.editor-resizer {
    width: 8px;
    min-width: 8px;
    background: linear-gradient(90deg, #e1e4e8 60%, #bdbde0 100%);
    cursor: ew-resize;
    position: relative;
    z-index: 10;
    transition: background 0.2s, box-shadow 0.2s;
    box-shadow: 0 0 8px rgba(157,157,189,0.08);
    border: none;
    outline: none;
}
.editor-resizer:hover {
    background: linear-gradient(90deg, #bfc2d6 60%, #a3a3b9 100%);
    box-shadow: 0 0 16px rgba(157,157,189,0.18);
}

@media (max-width: 900px) {
    .editor-resizer {
        width: 100%;
        height: 8px;
        min-width: 0;
        min-height: 8px;
        cursor: ns-resize;
        background: linear-gradient(180deg, #e1e4e8 60%, #bdbde0 100%);
        box-shadow: 0 0 8px rgba(157,157,189,0.08);
    }
}