/* Global Styles */
:root {
    --primary-color: #1473e6;
    --primary-dark: #0d66d0;
    --secondary-color: #505050;
    --background-color: #f5f5f5;
    --sidebar-bg: #ffffff;
    --text-color: #333333;
    --border-color: #e1e1e1;
    --success-color: #4caf50;
    --warning-color: #ff9800;
    --error-color: #f44336;
    --shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
    --transition: all 0.3s ease;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background-color: var(--background-color);
    color: var(--text-color);
    line-height: 1.6;
}

/* Layout */
.app-container {
    display: flex;
    flex-direction: column;
    min-height: 100vh;
}

/* Header Styles */
.app-header {
    background-color: #fff;
    padding: 1rem 2rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    box-shadow: var(--shadow);
    z-index: 100;
}

.logo h1 {
    color: var(--primary-color);
    font-size: 1.5rem;
    font-weight: 600;
}

.header-controls {
    display: flex;
    gap: 1rem;
}

/* Button Styles */
.btn {
    padding: 0.5rem 1rem;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-weight: 500;
    transition: var(--transition);
}

.primary-btn {
    background-color: var(--primary-color);
    color: white;
}

.primary-btn:hover {
    background-color: var(--primary-dark);
}

.icon-btn {
    background: none;
    border: none;
    color: var(--secondary-color);
    padding: 0.25rem;
    display: flex;
    align-items: center;
    justify-content: center;
}

.icon-btn:hover {
    color: var(--primary-color);
}

/* Main Content Area */
.main-content {
    display: flex;
    flex: 1;
    position: relative;
}

/* Sidebar Styles */
.sidebar {
    width: 300px;
    background-color: var(--sidebar-bg);
    border-right: 1px solid var(--border-color);
    transition: var(--transition);
    display: flex;
    flex-direction: column;
    height: calc(100vh - 120px); /* Adjust based on header and footer height */
}

.sidebar-header {
    padding: 1rem;
    border-bottom: 1px solid var(--border-color);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.sidebar-header h2 {
    font-size: 1.2rem;
    font-weight: 500;
}

/* Search Container Styles */
.search-container {
    padding: 1rem;
    border-bottom: 1px solid var(--border-color);
}

.search-input-wrapper {
    display: flex;
    align-items: center;
    background-color: #f5f5f5;
    border-radius: 4px;
    overflow: hidden;
}

#search-input {
    flex: 1;
    padding: 0.5rem;
    border: none;
    background-color: transparent;
    font-size: 0.9rem;
}

#search-input:focus {
    outline: none;
}

#search-btn {
    background-color: var(--primary-color);
    color: white;
    border: none;
    padding: 0.5rem;
    cursor: pointer;
}

/* Search Results Styles */
.search-results {
    margin-top: 1rem;
    border-top: 1px solid var(--border-color);
    padding-top: 1rem;
}

.search-results-header {
    font-weight: 500;
    margin-bottom: 0.5rem;
    color: var(--secondary-color);
    font-size: 0.9rem;
}

.search-result-item {
    padding: 0.5rem;
    border-radius: 4px;
    cursor: pointer;
    margin-bottom: 0.25rem;
    font-size: 0.9rem;
}

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

.search-result-item.active {
    background-color: #e6f2ff;
    color: var(--primary-color);
}

.search-nav-buttons {
    display: flex;
    justify-content: space-between;
    margin-top: 0.5rem;
}

.search-nav-btn {
    background-color: #f0f0f0;
    border: 1px solid var(--border-color);
    padding: 0.25rem 0.5rem;
    font-size: 0.8rem;
}

.search-nav-btn:hover {
    background-color: #e0e0e0;
}

.no-results {
    color: var(--secondary-color);
    font-style: italic;
    font-size: 0.9rem;
    text-align: center;
    padding: 0.5rem;
}

.sidebar-content {
    flex: 1;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
}

/* Sidebar Tabs */
.sidebar-tabs {
    display: flex;
    border-bottom: 1px solid var(--border-color);
}

.tab-btn {
    flex: 1;
    padding: 0.75rem 0;
    background: none;
    border: none;
    border-bottom: 2px solid transparent;
    cursor: pointer;
    font-weight: 500;
    color: var(--secondary-color);
    transition: var(--transition);
}

.tab-btn:hover {
    color: var(--primary-color);
}

.tab-btn.active {
    color: var(--primary-color);
    border-bottom-color: var(--primary-color);
}

.tab-content {
    display: none;
    padding: 1rem;
    flex: 1;
    overflow-y: auto;
}

.tab-content.active {
    display: block;
}

/* Bookmarks Styles */
.bookmarks-actions {
    margin-bottom: 1rem;
}

.bookmarks-container {
    margin-top: 1rem;
}

.bookmarks-header {
    font-size: 1.1rem;
    margin-bottom: 1rem;
    color: var(--secondary-color);
}

.bookmarks-empty {
    color: var(--secondary-color);
    font-style: italic;
    text-align: center;
    padding: 1rem;
}

.bookmarks-list {
    list-style: none;
    padding: 0;
    margin: 0;
}

.bookmark-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.75rem;
    border-bottom: 1px solid var(--border-color);
    transition: var(--transition);
}

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

.bookmark-content {
    flex: 1;
}

.bookmark-title {
    font-weight: 500;
    margin-bottom: 0.25rem;
}

.bookmark-page {
    font-size: 0.8rem;
    color: var(--secondary-color);
}

.bookmark-note {
    font-size: 0.85rem;
    margin-top: 0.5rem;
    color: var(--secondary-color);
    font-style: italic;
}

.bookmark-actions {
    display: flex;
    gap: 0.5rem;
}

.bookmark-btn {
    background: none;
    border: none;
    color: var(--secondary-color);
    cursor: pointer;
    padding: 0.25rem;
    font-size: 0.9rem;
}

.bookmark-btn:hover {
    color: var(--primary-color);
}

.delete-btn:hover {
    color: var(--error-color);
}

/* Modal Styles */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: rgba(0, 0, 0, 0.5);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
}

.modal {
    background-color: white;
    border-radius: 4px;
    width: 90%;
    max-width: 500px;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.2);
}

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

.modal-header h3 {
    margin: 0;
    font-size: 1.2rem;
}

.modal-close {
    background: none;
    border: none;
    font-size: 1.5rem;
    cursor: pointer;
    color: var(--secondary-color);
}

.modal-body {
    padding: 1rem;
}

.form-group {
    margin-bottom: 1rem;
}

.form-group label {
    display: block;
    margin-bottom: 0.5rem;
    font-weight: 500;
}

.form-control {
    width: 100%;
    padding: 0.5rem;
    border: 1px solid var(--border-color);
    border-radius: 4px;
    font-size: 1rem;
}

.page-info {
    margin-bottom: 1rem;
    color: var(--secondary-color);
    font-size: 0.9rem;
}

.outline-container {
    font-size: 0.9rem;
}

.outline-placeholder {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    height: 100%;
    color: var(--secondary-color);
    text-align: center;
    padding: 2rem;
}

/* PDF Viewer Styles */
.viewer-container {
    flex: 1;
    position: relative;
    height: calc(100vh - 120px); /* Adjust based on header and footer height */
    display: flex;
    flex-direction: column;
}

/* Breadcrumb Styles */
.breadcrumb-container {
    background-color: #f8f9fa;
    padding: 0.5rem 1rem;
    border-bottom: 1px solid var(--border-color);
    z-index: 5;
}

.breadcrumb {
    display: flex;
    flex-wrap: wrap;
    padding: 0;
    margin: 0;
    list-style: none;
    font-size: 0.9rem;
}

.breadcrumb-item {
    display: inline-flex;
    align-items: center;
}

.breadcrumb-item:not(:last-child)::after {
    content: "/";
    margin: 0 0.5rem;
    color: var(--secondary-color);
}

.breadcrumb-item a {
    color: var(--primary-color);
    text-decoration: none;
}

.breadcrumb-item a:hover {
    text-decoration: underline;
}

.breadcrumb-item.active {
    color: var(--secondary-color);
}

#adobe-dc-view {
    width: 100%;
    flex: 1;
}

.pdf-placeholder {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    background-color: #f9f9f9;
    z-index: 1;
}

.placeholder-content {
    text-align: center;
    color: var(--secondary-color);
}

.placeholder-content i {
    margin-bottom: 1rem;
    color: var(--primary-color);
}

/* Footer Styles */
.app-footer {
    background-color: #fff;
    padding: 1rem 2rem;
    text-align: center;
    border-top: 1px solid var(--border-color);
    font-size: 0.9rem;
    color: var(--secondary-color);
}

/* Document Outline Styles */
.outline-item {
    margin-bottom: 0.5rem;
    cursor: pointer;
}

.outline-item:hover {
    color: var(--primary-color);
}

.outline-item.active {
    color: var(--primary-color);
    font-weight: 500;
}

.outline-level-h1 {
    font-weight: 600;
    font-size: 1.1rem;
}

.outline-level-h2 {
    padding-left: 1rem;
    font-size: 1rem;
}

.outline-level-h3 {
    padding-left: 2rem;
    font-size: 0.9rem;
}

/* Responsive Styles */
@media (max-width: 768px) {
    .sidebar {
        position: absolute;
        left: -300px;
        z-index: 10;
        height: calc(100vh - 120px);
    }

    .sidebar.open {
        left: 0;
    }

    .viewer-container {
        width: 100%;
    }
}