/* Page Navigation Sidebar Styles */

.page-sidebar {
    position: fixed;
    top: 0; /* Start from very top */
    left: -255px; /* Start off-screen (15% less than 300px) */
    width: 255px; /* 15% less than 300px */
    height: 100vh; /* Full height */
    background-color: #ffffff;
    border-right: 1px solid #e0e0e0;
    box-shadow: 2px 0 10px rgba(0, 0, 0, 0.1);
    z-index: 800; /* Below title (z-index: 888) but above page content */
    transition: left 0.6s ease-in-out;
    overflow-y: auto;
}

.page-sidebar.show {
    left: 0;
}

.sidebar-content {
    height: 100%;
    display: flex;
    flex-direction: column;
}

/* Removed sidebar header styles */



.sidebar-body {
    flex: 1;
    padding: 20px 0 0 0;
    color: #495057;
    overflow-y: auto;
}

/* File Explorer Tree Styles */
.page-tree {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    font-size: 15px;
    line-height: 1.4;
}

.page-tree-item {
    display: flex;
    align-items: center;
    padding: 4px 16px;
    cursor: pointer;
    user-select: none;
    transition: background-color 0.1s ease;
}

.page-tree-item:hover {
    background-color: #f5f5f5;
}

.page-tree-item.active {
    background-color: #007acc;
    color: white;
}

.page-tree-item.active:hover {
    background-color: #005a9e;
}

.page-tree-toggle {
    width: 16px;
    height: 16px;
    margin-right: 6px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: transform 0.2s ease;
    color: #999999;
    font-size: 10px;
    font-weight: bold;
    user-select: none;
    -webkit-user-select: none;
    -moz-user-select: none;
    -ms-user-select: none;
}

.page-tree-toggle.expanded {
    transform: rotate(90deg);
}

.page-tree-toggle.collapsed {
    transform: rotate(0deg);
}

/* Ensure toggle buttons are clickable */
.page-tree-toggle[data-toggle="true"] {
    pointer-events: auto;
    z-index: 1;
    position: relative;
}

/* Ensure collapsed children are hidden */
.page-tree-children.collapsed {
    display: none;
}

.page-tree-icon {
    width: 16px;
    height: 16px;
    margin-right: 6px;
    display: flex;
    align-items: center;
    justify-content: center;
    object-fit: contain;
}

.page-tree-title {
    flex: 1;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.page-tree-children {
    margin-left: 16px;
    border-left: 1px solid #e0e0e0;
}

.page-tree-children.collapsed {
    display: none;
}

/* Folder and file icons */
.page-tree-icon.folder {
    color: #ffd43b;
}

.page-tree-icon.file {
    color: #6c757d;
}

.page-tree-icon.home {
    color: #007acc;
}

/* Additional Cursor-like styling */
.page-tree-item {
    border-radius: 3px;
    margin: 1px 4px;
}

.page-tree-item.active {
    background-color: transparent;
    color: #1e3a8a;
    font-weight: 700;
}

.page-tree-item.active:hover {
    background-color: #f5f5f5;
}

.page-tree-item.active .page-tree-icon {
    transform: none;
}

.page-tree-item.in-path {
    color: #3b82f6;
    font-weight: 600;
}

.page-tree-item.in-path .page-tree-icon {
    /* Icon color handled by image */
}

.page-tree-item.active .page-tree-toggle {
    color: white;
}

/* Smooth transitions */
.page-tree-children {
    transition: all 0.2s ease;
}

.page-tree-toggle {
    transition: transform 0.2s ease;
}

.page-tree-icon {
    transition: transform 0.2s ease;
}

/* Current page animation */
.page-tree-item.active .page-tree-icon {
    animation: pulse 2s infinite;
}

@keyframes pulse {
    0% { transform: scale(1.1); }
    50% { transform: scale(1.2); }
    100% { transform: scale(1.1); }
}

/* Hover trigger area on the left edge */
.sidebar-trigger {
    position: fixed;
    top: 0;
    left: 0;
    width: 10px;
    height: 100vh;
    z-index: 999;
}

/* Ensure sidebar appears above other content */
.page-sidebar {
    z-index: 1001;
}

/* Page title tooltip */
#page-title-tooltip {
	position: fixed;
	z-index: 9999999;
	background-color: #ffffff;
	border: 1px solid #e0e0e0;
	border-radius: 6px;
	padding: 8px 12px;
	font-size: 14px;
	color: #333333;
	box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
	white-space: nowrap;
	display: none;
	pointer-events: none;
}
