body {
    margin: 0;
    padding: 0;
    font-family: Arial, sans-serif;
    background-color: #f0f0f0;
}

.container {
    display: flex;
    height: 100vh;
    margin: 0;
    position: relative;
}

.sidebar {
    width: 300px;
    min-width: 200px;
    max-width: 500px;
    background-color: #f8f9fa;
    border-right: 1px solid #e9ecef;
    padding: 20px 20px 0 20px;
    height: 100vh;
    overflow-y: auto;
    position: relative;
    box-shadow: 2px 0 5px rgba(0, 0, 0, 0.05);
    font-family: 'Roboto', sans-serif;
    resize: none;
    flex-shrink: 0;
    box-sizing: border-box;
    display: flex;
    flex-direction: column;
}

.resize-handle {
    width: 12px;
    background-color: #f1f3f5;
    cursor: col-resize;
    position: relative;
    z-index: 100;
    user-select: none;
    touch-action: none;
    border-left: 1px solid #dee2e6;
    border-right: 1px solid #dee2e6;
    transition: all 0.2s ease;
    flex-shrink: 0;
}

.resize-handle::before {
    content: '•\A•\A•';
    white-space: pre;
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    color: #adb5bd;
    font-size: 14px;
    line-height: 0.7;
    opacity: 0.8;
    transition: all 0.2s ease;
}

.resize-handle:hover {
    background-color: #e9ecef;
}

.resize-handle:hover::before {
    color: #495057;
    opacity: 1;
}

.resize-handle::after {
    content: '';
    position: absolute;
    top: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 2px;
    height: 100%;
    background-color: #dee2e6;
    opacity: 0;
    transition: opacity 0.2s ease;
}

.resize-handle:hover::after {
    opacity: 1;
}

/* Add styles for when resizing is active */
body.resizing {
    user-select: none;
    cursor: col-resize;
}

body.resizing .resize-handle {
    background-color: #e9ecef;
}

body.resizing .resize-handle::before {
    color: #495057;
    opacity: 1;
}

body.resizing .resize-handle::after {
    opacity: 1;
}

.main-content {
    flex: 1;
    height: 100vh;
    overflow: hidden;
    position: relative;
}

#viewerContainer {
    position: absolute;
    top: 0;
    right: 0;
    bottom: 0;
    left: 0;
    overflow-y: auto;
    overflow-x: hidden;
    width: 100%;
    padding: 20px;
    box-sizing: border-box;
    background-color: #525659;
}

#viewer {
    margin: 0 auto;
    max-width: 100%;
    position: relative;
    background-color: #525659;
    width: max-content;
    min-width: 100%;
    min-height: 100%;
    height: auto;
    box-sizing: border-box;
}

#bookmarkList {
    flex: 1;
    overflow-y: auto;
    font-size: 14px;
}

.bookmark-item {
    margin: 0;
    transition: all 0.2s ease;
}

.bookmark-item > .bookmark-container:hover {
    background-color: #f8f9fa;
    border-color: #adb5bd;
}

.bookmark-item:hover > .bookmark-container {
    background-color: #f8f9fa;
    border-color: #adb5bd;
}

.bookmark-container {
    display: flex;
    align-items: stretch;
    padding: 0;
    cursor: pointer;
    border-radius: 6px;
    transition: background-color 0.2s ease;
    background-color: #fff;
    margin: 4px 0;
    min-height: 40px;
    border: 1px solid #dee2e6;
}

.bookmark-container:hover {
    background-color: #f8f9fa;
    border-color: #adb5bd;
}

.bookmark-container.active {
    background-color: #f8f9fa;
    border-color: #adb5bd;
}

.bookmark-container.active .bookmark-title {
    color: #1a73e8;
    font-weight: 500;
    background-color: #e9ecef;
}

.bookmark-title {
    flex: 1;
    font-size: 0.75rem;
    color: #2d3748;
    padding: 8px 12px;
    transition: all 0.2s ease;
    font-weight: 500;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: space-between;
    font-family: 'Roboto', sans-serif;
}

.bookmark-title:hover {
    color: #1a73e8;
    background-color: #e9ecef;
}

.bookmark-title:active {
    background-color: #dee2e6;
}

.page-range {
    color: #6c757d;
    font-weight: normal;
    margin-left: auto;
    padding-left: 8px;
}

.toggle-button {
    background: #f1f3f5;
    border: none;
    color: #2d3748;
    font-size: 1.5rem;
    padding: 0;
    cursor: pointer;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    min-height: 40px;
    border-radius: 6px 0 0 6px;
    margin: 0;
    box-shadow: none;
    border-right: 1px solid #dee2e6;
    font-family: 'Roboto', sans-serif;
}

.toggle-button::before {
    content: '›';
    display: block;
    transform: rotate(0deg);
    transition: transform 0.3s ease;
    transform-origin: center center;
    width: 20px;
    height: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
}

.toggle-button:hover {
    background-color: #e9ecef;
    color: #1a73e8;
    box-shadow: none;
}

.toggle-button:active {
    background-color: #dee2e6;
    box-shadow: none;
}

.toggle-button.expanded::before {
    transform: rotate(90deg);
}

.nested-bookmarks {
    margin-left: 16px;
    display: none;
    border-left: 2px solid #adb5bd;
    padding-left: 20px
}

.nested-bookmarks.expanded {
    display: block;
}

/* PDF.js viewer customization */
.pdfViewer {
    margin: 0;
    padding: 0;
    background-color: #525659;
    min-height: 100%;
    min-width: 100%;
    width: max-content;
}

.pdfViewer .page {
    margin: 10px auto;
    border: 1px solid #000;
    box-shadow: 0 0 10px rgba(0, 0, 0, 0.3);
}

.pdfViewer .page:first-child {
    margin-top: 0;
}

.pdfViewer .page:last-child {
    margin-bottom: 0;
}

.pdfViewer .page canvas {
    margin: 0 auto;
    display: block;
}

/* Sidebar styles */
#sidebar {
    width: 300px;
    background-color: #f8f9fa;
    border-right: 1px solid #e9ecef;
    padding: 20px;
    height: 100vh;
    overflow-y: auto;
    position: fixed;
    left: 0;
    top: 0;
    box-shadow: 2px 0 5px rgba(0, 0, 0, 0.05);
    font-family: 'Roboto', sans-serif;
}

.container .sidebar h2 {
    margin: 0 0 16px 0;
    padding: 0;
    color: #495057;
    font-size: 0.95rem;
    font-weight: 500;
    font-family: 'Roboto', sans-serif;
}

/* Main content styles */
#main-content {
    margin-left: 300px;
    padding: 20px;
    height: 100vh;
    overflow-y: auto;
}

/* Responsive design */
@media (max-width: 768px) {
    .sidebar {
        width: 100%;
        min-width: 100%;
        max-width: 100%;
        height: auto;
        position: relative;
        border-right: none;
        border-bottom: 1px solid #e9ecef;
    }
    
    .resize-handle {
        display: none;
    }
    
    .main-content {
        margin-left: 0;
    }
}

.pdf-info {
    padding-top: 20px;
    border-top: 2px solid #e9ecef;
}

.pdf-info h3 {
    font-size: 0.9rem;
    color: #1a202c;
    font-weight: 500;
    margin: 0 0 12px 0;
    font-family: 'Roboto', sans-serif;
}

.info-item {
    display: flex;
    flex-direction: column;
    margin-bottom: 8px;
    font-size: 0.9rem;
    color: #1a202c;
}

.info-label {
    color: #6c757d;
    font-weight: normal;
    margin-bottom: 2px;
}

.info-value {
    color: #1a202c;
    font-weight: 500;
    word-break: break-word;
}

.scale-select-container {
    padding: 20px 0;
    border-top: 2px solid #e9ecef;
    margin-top: auto;
    position: relative;
    width: 100%;
    background: none;
    box-shadow: none;
}

.scale-label {
    color: #6c757d;
    font-size: 0.9rem;
    margin-bottom: 8px;
    font-weight: normal;
}

#scaleSelect {
    width: 100%;
    padding: 8px;
    font-size: 0.9rem;
    border: 1px solid #dee2e6;
    border-radius: 4px;
    background-color: white;
    color: #1a202c;
    cursor: pointer;
    font-family: 'Roboto', sans-serif;
}

#scaleSelect:hover {
    border-color: #adb5bd;
}

#scaleSelect:focus {
    outline: none;
    border-color: #1a73e8;
    box-shadow: 0 0 0 2px rgba(26, 115, 232, 0.2);
}

.page-nav-container {
    padding: 20px 0;
    border-top: 2px solid #e9ecef;
    margin-top: auto;
    display: flex;
    gap: 8px;
}

.page-nav-button {
    flex: 1;
    padding: 8px;
    font-size: 0.9rem;
    border: 1px solid #dee2e6;
    border-radius: 4px;
    background-color: white;
    color: #1a202c;
    cursor: pointer;
    font-family: 'Roboto', sans-serif;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
}

.page-nav-button:hover:not(:disabled) {
    border-color: #adb5bd;
    background-color: #f8f9fa;
    color: #1a73e8;
}

.page-nav-button:focus {
    outline: none;
    border-color: #1a73e8;
    box-shadow: 0 0 0 2px rgba(26, 115, 232, 0.2);
}

.page-nav-button:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    background-color: #f1f3f5;
}

.sidebar-controls {
    border-top: 2px solid #e9ecef;
    margin-top: auto;
    margin-left: -20px;
    margin-right: -20px;
}

.sidebar-controls.collapsed {
    margin-top: 0;
}

.collapse-toggle {
    width: 100%;
    padding: 8px 20px;
    font-size: 0.9rem;
    border: none;
    border-bottom: 2px solid #e9ecef;
    background-color: #f8f9fa;
    color: #2d3748;
    cursor: pointer;
    font-family: 'Roboto', sans-serif;
    display: flex;
    align-items: center;
    justify-content: space-between;
    transition: all 0.2s ease;
}

.collapse-toggle:hover {
    background-color: #e9ecef;
    color: #1a73e8;
}

.collapse-toggle::after {
    content: '›';
    display: inline-block;
    transform: rotate(90deg);
    transition: transform 0.3s ease;
    transform-origin: center center;
    font-size: 1.5rem;
    line-height: 1;
    margin-left: 8px;
    width: 20px;
    height: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.collapse-toggle.collapsed::after {
    transform: rotate(-90deg);
}

.sidebar-controls-content {
    overflow: hidden;
    transition: max-height 0.3s ease;
    max-height: 500px; /* Adjust based on your content */
    padding: 0 20px; /* Add padding to match the collapse button */
}

.sidebar-controls-content.collapsed {
    max-height: 0;
}

/* Update existing styles */
.scale-select-container,
.page-nav-container,
.pdf-info {
    border-top: none;
    margin-top: 0;
    padding: 12px 0;
}

.scale-select-container:not(:first-child),
.page-nav-container:not(:first-child),
.pdf-info:not(:first-child) {
    border-top: 1px solid #e9ecef;
}

.page-indicator {
    position: absolute;
    bottom: 20px;
    left: 20px;
    background-color: rgba(26, 115, 232, 0.9);
    color: white;
    padding: 8px 12px;
    border-radius: 4px;
    font-size: 0.9rem;
    font-family: 'Roboto', sans-serif;
    z-index: 1000;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
    transition: opacity 0.2s ease;
}

.page-indicator.fade {
    opacity: 0.7;
}

.page-indicator:hover {
    opacity: 1;
}

.logo-section {
    margin: 0 -20px 20px -20px;
    padding: 0 20px 16px 20px;
    border-bottom: 2px solid #e9ecef;
}

.app-name {
    color: #1a73e8;
    font-size: 1.2rem;
    font-weight: 500;
    margin: 0 0 4px 0;
    font-family: 'Roboto', sans-serif;
}

.app-author {
    color: #6c757d;
    font-size: 0.9rem;
    font-weight: normal;
    margin: 0;
    font-family: 'Roboto', sans-serif;
} 