:root {
    --primary-color: #4361ee;
    --secondary-color: #3f37c9;
    --dark-color: #212529;
    --light-color: #f8f9fa;
}

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

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background-color: #e9ecef;
    height: 100vh;
    display: flex;
}

#pdf-container {
    display: flex;
    flex-direction: column;
    width: 100%;
    height: 100vh;
    background-color: #525659;
    position: relative;
}

/* Toolbar Styles */
#toolbar {
    background-color: var(--dark-color);
    color: white;
    padding: 8px 15px;
    display: flex;
    align-items: center;
    gap: 15px;
    z-index: 100;
    box-shadow: 0 2px 5px rgba(0,0,0,0.2);
}

.toolbar-button {
    width: 32px;
    height: 32px;
    background-color: var(--primary-color);
    color: white;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s;
}

.toolbar-button:hover {
    background-color: var(--secondary-color);
    transform: scale(1.05);
}

.toolbar-button:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    background-color: #6c757d;
}

.toolbar-button:disabled:hover {
    transform: none;
    background-color: #6c757d;
}

.toolbar-group {
    display: flex;
    align-items: center;
    gap: 5px;
    margin-left: auto;
}

#page-info {
    display: flex;
    align-items: center;
    gap: 5px;
    font-size: 14px;
}

#page-jump {
    width: 50px;
    padding: 5px;
    border: 1px solid #ddd;
    border-radius: 4px;
    text-align: center;
}

#page-jump:focus {
    outline: 2px solid var(--primary-color);
    border-color: var(--primary-color);
}

#zoom-level {
    min-width: 40px;
    text-align: center;
    font-size: 14px;
}

/* PDF Viewer Area */
#pdf-viewer {
    flex-grow: 1;
    overflow: auto;
    position: relative;
    display: flex;
    justify-content: center;
    align-items: center;
}

#pdf-render {
    max-width: 100%;
    max-height: 100%;
    box-shadow: 0 0 10px rgba(0,0,0,0.5);
    margin: 20px;
}

/* Page Controls */
.page-control {
    position: absolute;
    top: 0;
    bottom: 0;
    width: 40%;
    cursor: pointer;
    opacity: 0;
    transition: opacity 0.3s;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 10;
}

.page-control:hover {
    opacity: 0.5;
    background-color: rgba(0,0,0,0.1);
}

.page-control.left {
    left: 0;
}

.page-control.right {
    right: 0;
}

.page-control::after {
    content: '';
    width: 50px;
    height: 50px;
    background-color: rgba(0,0,0,0.5);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 24px;
}

.page-control.left::after {
    content: '◄';
}

.page-control.right::after {
    content: '►';
}

/* Loading Indicator */
#loading {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: rgba(0,0,0,0.7);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    color: white;
    z-index: 1000;
}

.spinner {
    width: 50px;
    height: 50px;
    border: 5px solid rgba(255,255,255,0.3);
    border-radius: 50%;
    border-top-color: white;
    animation: spin 1s ease-in-out infinite;
    margin-bottom: 15px;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

/* Fullscreen Styles */
body.fullscreen #toolbar {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
}

body.fullscreen #pdf-viewer {
    height: calc(100vh - 48px);
    margin-top: 48px;
}

.error-box {
    background: #ffebee;
    border: 2px solid #f44336;
    border-radius: 8px;
    padding: 20px;
    max-width: 600px;
    margin: 20px;
    color: #b71c1c;
}

.error-box h3 {
    margin-bottom: 15px;
    color: #d32f2f;
}

.error-box ul {
    margin-top: 10px;
    padding-left: 20px;
}