#canvas {
    border: 1.5px solid #ccc;
    position: absolute;
    top: 44px;
    left: 0;
    right: 0;
    bottom: 0;
    width: 100vw;
    height: calc(100vh - 44px);
    z-index: 0;
}
.canvas-container {
    position: relative;
    height: calc(100vh - 44px);
    width: 100vw;
    padding: 0;
    margin: 0;
    overflow: hidden;
}
.nav-link {
    padding: 0.25rem 0.5rem;
}
.nav-link i {
    font-size: 1.05rem;
}
#setupModal .modal-dialog, #pagesModal .modal-dialog {
    max-width: 500px;
}
#setupModal .modal-content {
    min-height: 400px;
}
/* Sleek Pages Modal */
#pagesModal {
pointer-events: none; /* Allow clicks to pass through modal container */
}

#pagesModal .modal-dialog {
max-width: 250px;
pointer-events: auto; /* Restore interaction for modal content */
}

#pagesModal .modal-content {
border-radius: 10px;
box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2);
border: none;
}

#pagesModal .modal-header {
background-color: #f8f9fa;
border-bottom: 1px solid #e9ecef;
padding: 8px 12px;
}

#pagesModal .modal-body {
padding: 10px;
max-height: 400px;
overflow-y: auto;
background-color: #fff;
}

#pageThumbnails {
display: flex;
flex-direction: column;
gap: 10px;
max-height: 360px;
overflow-y: auto;
}

#pageThumbnails .thumbnail {
width: 100%;
text-align: center;
padding: 4px;
display: flex;
align-items: center;
justify-content: center;
overflow: hidden;
aspect-ratio: 3 / 4;
background-color: #fafafa;
border: 1px solid #ddd;
border-radius: 5px;
background-color: #fff;
transition: all 0.2s ease;
cursor: pointer;
}

#pageThumbnails .thumbnail img,
#pageThumbnails .thumbnail canvas {
  max-width: 100%;
  max-height: 100%;
  height: auto;
  width: auto;
  object-fit: contain;
  display: block;
}

#pageThumbnails .thumbnail * {
  margin-bottom: 4px;
}
#pageThumbnails .thumbnail *:last-child {
  margin-bottom: 0 !important;
}
#pageThumbnails .thumbnail .caption,
#pageThumbnails .thumbnail .page-label,
#pageThumbnails .thumbnail span,
#pageThumbnails .thumbnail small {
  display: block;
  font-size: 0.8rem;
  line-height: 1.1;
  margin-top: 4px;
  margin-bottom: 0; /* rely on the global last-child rule */
}
#pageThumbnails .thumbnail.active {
border-color: #007bff;
background-color: #e7f1ff;
box-shadow: 0 0 5px rgba(0, 123, 255, 0.5);
padding-bottom: 3px; /* slightly tighter when active */
}

#pagesModal .modal-footer {
display: flex;
justify-content: space-between;
align-items: center;
padding: 8px 12px;
background-color: #f8f9fa;
border-top: 1px solid #e9ecef;
}

#pagesModal .btn {
padding: 4px 8px;
font-size: 13px;
transition: all 0.2s ease;
}

#pagesModal .btn:hover {
transform: scale(1.05);
}

#pagesModal .nav-arrows {
display: flex;
gap: 5px;
}

/* Sleek Text Formatting Modal */
#textFormattingModal {
pointer-events: none;
}

#textFormattingModal .modal-dialog {
max-width: 350px;
pointer-events: auto;
}

#textFormattingModal .modal-content {
border-radius: 10px;
box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2);
border: none;
}

#textFormattingModal .modal-header {
background-color: #f8f9fa;
border-bottom: 1px solid #e9ecef;
padding: 8px 12px;
}

#textFormattingModal .modal-body {
padding: 10px;
max-height: 700px;
overflow-y: auto;
background-color: #fff;
}

#textFormattingModal .modal-footer {
padding: 8px 12px;
background-color: #f8f9fa;
border-top: 1px solid #e9ecef;
}

#textFormattingModal .btn {
padding: 4px 8px;
font-size: 13px;
transition: all 0.2s ease;
}

#textFormattingModal .btn:hover {
transform: scale(1.05);
}



#shapeSelectionModal {
pointer-events: none;
}
#shapeSelectionModal .modal-dialog {
max-width: 800px; /* Wider to accommodate multiple shapes */
pointer-events: auto;
}
#shapeSelectionModal .modal-content {
border-radius: 10px;
box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2);
border: none;
}
#shapeSelectionModal .modal-header {
background-color: #f8f9fa;
border-bottom: 1px solid #e9ecef;
padding: 10px 15px;
}
#shapeSelectionModal .modal-body {
padding: 15px;
background-color: #fff;
}
#shapeSelectionModal .shape-thumbnail {
width: 100px;
height: 100px;
cursor: pointer;
border: 1px solid #e9ecef;
border-radius: 5px;
padding: 5px;
transition: all 0.2s ease;
}
#shapeSelectionModal .shape-thumbnail:hover {
border-color: #007bff;
box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
}



.navbar {
padding: 0.25rem 0.75rem;
}

.navbar-nav {
flex-direction: row; /* Default horizontal layout */
}

.nav-item {
margin-right: 0.35rem; /* Space between buttons */
}

.nav-link.btn {
padding: 0.25rem 0.5rem; /* Smaller padding for mobile */
font-size: 1rem; /* Consistent icon size */
}

.nav-link.btn i {
font-size: 1.2rem; /* Slightly larger icons */
}

/* Horizontal scrolling on mobile */
@media (max-width: 991.98px) {
.navbar-nav {
flex-direction: row;
overflow-x: auto;
overflow-y: hidden;
max-height: 48px; /* Limit height to avoid vertical overflow */
padding-bottom: 0.5rem; /* Space for scrollbar */
}
.nav-item {
margin-right: 0.25rem; /* Tighter spacing on mobile */
}
.nav-link.btn {
padding: 0.15rem 0.35rem; /* Even smaller on mobile */
}
}

/* Ensure canvas stays below toolbar */
#canvas-container {
height: calc(100vh - 44px); /* Full height minus toolbar */
overflow: hidden;
}

#canvas {
width: 100%;
height: 100%;
}

/* Compact theme overrides */
:root { --pc-font-size: 0.9rem; }
body { font-size: var(--pc-font-size); }

.navbar-light.bg-light { background-color: #f2f2f2 !important; border-bottom: 1px solid #d9d9d9; }
.navbar .navbar-nav .nav-link { padding: 0.2rem 0.4rem; }

.btn { padding: 0.25rem 0.5rem; font-size: 0.875rem; }

.form-label { margin-bottom: 0.25rem; font-weight: 500; }
.form-control, .form-select { padding: 0.25rem 0.5rem; font-size: 0.875rem; }
.input-group-text { padding: 0.25rem 0.5rem; font-size: 0.875rem; }

/* Canvas workspace background */
#canvas-container { background: #2e2e2e; }


