body {
    font-family: Arial, sans-serif;
    background-color: #f5f5f5;
    height: 100vh;  
    margin: 0;
    padding: 20px 0;
}

body, div, h2, h3, p, button {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

/* Homepage */

h1 {
    font-size: 2em;
    margin-bottom: 20px;  /* Increase the space after the heading */
    text-align: center;
}

header {
    position: fixed;
    top: 10px;
    right: 10px;
    z-index: 10;
}

.main-container {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    height: 100%;
    padding: 20px;
    box-sizing: border-box;
    overflow-y: auto; /* allows scrolling within the main container if content overflows */
}

button {
    padding: 10px 15px;
    background-color: #007BFF;   /* Primary blue color */
    border: none;
    border-radius: 5px;  /* Rounded corners */
    color: white;
    cursor: pointer;
    transition: background-color 0.2s;
}

button:hover {
    background-color: #0056b3;  /* Darker shade of blue for hover */
}

.content-container {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    height: 100vh;
}

input[type="text"] {
    padding: 10px;
    border: 1px solid #ccc;
    border-radius: 5px;  /* Rounded corners */
    width: 70%;  /* Increase width of input */
    margin-right: 10px; /* Space between input and button */
    box-sizing: border-box; /* To include padding and border in total width */
}

label {
    display: block;  /* Make label block to push the input to next line */
    margin: 20px 0 10px 0;  /* Space around the label */
}


/* Editor */

#container {
    display: flex;
    flex-direction: column;
    align-items: center;
    width: 100%;
    padding-bottom: 20px;   /* Added some padding at the bottom for better spacing */
}

#editor {
    min-height: 297mm;    /* Using min-height instead of height */
    width: 210mm;
    background-color: #ffffff;
    padding: 20mm;
    border: 1px solid #ccc;
    box-shadow: 0 0 10px rgba(0, 0, 0, 0.1);
    max-width: 100%;
    margin: 20px auto;
}

.remote-cursor {
    position: absolute;
    pointer-events: none;
    z-index: 2;
    width: 2px;
    background-color: blue; /* You can change this color */
    height: 20px; /* Adjust as per your editor's line height */
}

.cursor-name {
    position: absolute;
    top: -20px;
    background-color: #000;
    color: #fff;
    padding: 0 5px;
    border-radius: 3px;
}

.options-menu {
    position: relative;
}

.options-dropdown {
    display: none;
    position: absolute;
    top: 100%;
    left: 0;
    background-color: white;
    border: 1px solid #ccc;
    width: 100%;
    z-index: 100;
}

.options-dropdown button {
    display: block;
    width: 100%;
    text-align: left;
    border: none;
    background-color: inherit;
    margin: 0;
    padding: 10px;
    top: 10px;
}

.options-dropdown button:hover {
    background-color: #f0f0f0;
}

#document {
    width: 210mm;
    min-height: 297mm;
    background-color: #ffffff;
    padding: 20mm;
    border: 1px solid #ccc;
    box-shadow: 0 0 10px rgba(0, 0, 0, 0.1);
    margin-top: 10px;
    overflow-y: auto;
    max-height: calc(100vh - 80px);
}

.sticky-header {
    position: sticky;
    top: 0;
    z-index: 1000;
    background-color: #f0f0f0; /* Assuming you want the same background color as the toolbar. */
}

.toolbar {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 5px 0;
    width: 100%;
    background-color: #f0f0f0;
    border-bottom: 1px solid #ccc;
    box-shadow: 0px 2px 5px rgba(0, 0, 0, 0.1);
    position: sticky;
    top: 0;  /* This ensures the toolbar sticks to the top */
    z-index: 1000; /* Ensures the toolbar stays above other elements */
    min-height: calc(1em + 24px + 30px);
}

.toolbar button {
    padding: 5px 10px;
    cursor: pointer;
    border: 1px solid #ccc;
    background-color: #ffffff;
    transition: background-color 0.3s, box-shadow 0.3s;
}

#docName {
    flex-grow: 1;
    text-align: center;
    font-size: 24px;
    padding: 5px 0;
    position: absolute;
    left: 50%;
    top: 50%;
    transform: translate(-50%, -50%);
}

#docIdContainer {
    position: absolute;
    right: 10px;
    top: 50%;
    transform: translateY(-50%);
}

button[onclick="goBack()"] {
    margin-right: 10px;  /* Add a little space to the right */
    margin-left: 10px;
}

/* Remove the absolute positioning and related styles for the delete button and just let it be in the flow. */
button[onclick="deleteCurrentDocument()"] button[onclick=""] {
    background-color: red;
}

/* Remove the absolute positioning and related styles for the delete button and just let it be in the flow. */
button[onclick="deleteCurrentDocument()"]:hover {
    background-color: darkred;
}

.toolbar button:hover {
    background-color: darkred;
}

.toolbar button.active {
    background-color: #d0d0d0;
    box-shadow: 0px 2px 5px rgba(0, 0, 0, 0.2);
}

/* Context Menu styles */
.context-menu {
    display: none;
    position: absolute;
    z-index: 1000;
    background-color: #f0f0f0;
    border: 1px solid #ccc;
    box-shadow: 0px 2px 5px rgba(0, 0, 0, 0.2);
}

.context-menu-item {
    padding: 5px 15px;
    cursor: pointer;
}

.context-menu-item:hover {
    background-color: #e5e5e5;
}

.context-menu-item.active {
    background-color: #eee; /* Lighter shade for active state */
}

/* Authentication Pages */

.auth-container {
    max-width: 400px;
    margin: 0 auto;  /* Make sure there's no vertical margin pushing it down */
    padding: 40px;
    box-shadow: 0 0 10px rgba(0,0,0,0.2);
    border-radius: 5px;
    text-align: center;
}

.auth-container h2 {
    margin-bottom: 20px;
}

.input-container {
    margin-bottom: 15px;
}

.auth-container input {
    width: 100%;
    padding: 10px;
    box-sizing: border-box;
    border: 1px solid #ccc;
    border-radius: 5px;
}

.auth-container button {
    width: 100%;
    padding: 10px;
    border: none;
    background-color: #2d87f0;
    color: #fff;
    border-radius: 5px;
    cursor: pointer;
    transition: background-color 0.3s ease;
}

.auth-container button:hover {
    background-color: #1f63d0;
}

body.fade-out {
    opacity: 0;
    transition: opacity 0.5s;
}

body.fade-in {
    opacity: 0;
    animation: fadeIn 0.5s forwards;
}

@keyframes fadeIn {
    to {
        opacity: 1;
    }
}

/* Quill Stuff */

.ql-editor {
    overflow-y: hidden !important;
}

.ql-snow .ql-formats {
    padding: 0 !important;     /* Reset padding */
    margin: 0 !important;      /* Reset margin */
    width: auto !important;    /* Ensure width isn't unnecessarily increased */
}

.ql-snow .ql-toolbar {
    position: static;
    top: 50px; /* Height of the .toolbar */
    z-index: 998; /* A value just below .toolbar's z-index to ensure it stays below the toolbar */
    background-color: #f0f0f0; /* This ensures the background of the toolbar is solid */
    margin-bottom: 20px !important; /* You had this already, just keeping it */
}

.ql-snow .ql-picker-label,
.ql-snow .ql-picker-options {
    padding-right: 0; 
    margin-right: 0 !important; 
}

.ql-snow .ql-toolbar button {
    padding-left: 10px;
    padding-right: 10px;
}