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

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
    background: linear-gradient(135deg, #2d5a3d 0%, #1e3a2a 100%);
    min-height: 100vh;
    overflow-x: hidden;
}

.header {
    background: linear-gradient(90deg, #2d5a3d 0%, #3d6b4d 100%);
    color: white;
    padding: 0.75rem 1rem;
    box-shadow: 0 4px 20px rgba(0,0,0,0.3);
    position: relative;
    z-index: 1000;
}

.header-content {
    max-width: 1400px;
    margin: 0 auto;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.logo-section {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.logo {
    font-size: 1.2rem;
    font-weight: bold;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.logo i {
    font-size: 1.5rem;
    color: #7dd87f;
}

.document-title {
    font-size: 1rem;
    color: #7dd87f;
    margin-left: 1rem;
    font-weight: normal;
}

.toolbar {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.toolbar-btn {
    background: rgba(255,255,255,0.1);
    border: none;
    color: white;
    padding: 0.5rem;
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.3s ease;
    font-size: 1rem;
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.toolbar-btn:hover {
    background: rgba(255,255,255,0.2);
    transform: translateY(-1px);
}

.toolbar-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.page-input-container {
    display: flex;
    align-items: center;
    background: rgba(255,255,255,0.15);
    border-radius: 8px;
    padding: 0.5rem;
    margin: 0 1rem;
}

.page-input {
    background: transparent;
    border: none;
    color: white;
    text-align: center;
    width: 80px;
    font-size: 0.9rem;
    outline: none;
}

.page-input::placeholder {
    color: rgba(255,255,255,0.7);
}

.search-container {
    position: relative;
}

.search-input {
    background: rgba(255,255,255,0.15);
    border: 1px solid rgba(255,255,255,0.3);
    color: white;
    padding: 0.5rem 2.5rem 0.5rem 1rem;
    border-radius: 25px;
    width: 250px;
    outline: none;
    transition: all 0.3s ease;
}

.search-input:focus {
    background: rgba(255,255,255,0.25);
    border-color: #7dd87f;
    box-shadow: 0 0 0 2px rgba(125, 216, 127, 0.3);
}

.search-input::placeholder {
    color: rgba(255,255,255,0.7);
}

.search-btn {
    position: absolute;
    right: 8px;
    top: 50%;
    transform: translateY(-50%);
    background: none;
    border: none;
    color: rgba(255,255,255,0.8);
    cursor: pointer;
    padding: 0.25rem;
}

.sidebar {
    position: fixed;
    left: -300px;
    top: 0;
    width: 300px;
    height: 100vh;
    background: rgba(45, 90, 61, 0.95);
    backdrop-filter: blur(10px);
    transition: left 0.3s ease;
    z-index: 2000;
    overflow-y: auto;
}

.sidebar.open {
    left: 0;
}

.sidebar-header {
    padding: 1rem;
    border-bottom: 1px solid rgba(255,255,255,0.2);
    color: white;
}

.sidebar-header h3 {
    margin-bottom: 0.5rem;
}

.close-sidebar {
    position: absolute;
    top: 1rem;
    right: 1rem;
    background: none;
    border: none;
    color: white;
    font-size: 1.5rem;
    cursor: pointer;
}

.document-list {
    padding: 1rem;
}

.document-item {
    background: rgba(255,255,255,0.1);
    border-radius: 8px;
    padding: 1rem;
    margin-bottom: 0.5rem;
    cursor: pointer;
    transition: all 0.3s ease;
    color: white;
}

.document-item:hover {
    background: rgba(255,255,255,0.2);
    transform: translateX(5px);
}

.document-item.active {
    background: rgba(125, 216, 127, 0.3);
    border-left: 4px solid #7dd87f;
}

.document-item h4 {
    margin-bottom: 0.5rem;
    font-size: 0.9rem;
}

.document-item p {
    font-size: 0.8rem;
    opacity: 0.8;
}

.main-container {
    position: relative;
    height: calc(100vh - 80px);
    display: flex;
    align-items: center;
    justify-content: center;
    transition: margin-left 0.3s ease;
}

.main-container.sidebar-open {
    margin-left: 300px;
}

.pdf-viewer-container {
    position: relative;
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
}

.nav-arrow {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    background: rgba(45, 90, 61, 0.9);
    border: none;
    color: white;
    font-size: 2rem;
    padding: 1rem 0.75rem;
    cursor: pointer;
    z-index: 100;
    transition: all 0.3s ease;
    border-radius: 8px;
    backdrop-filter: blur(10px);
    box-shadow: 0 4px 20px rgba(0,0,0,0.3);
}

.nav-arrow:hover {
    background: rgba(45, 90, 61, 1);
    transform: translateY(-50%) scale(1.1);
    box-shadow: 0 6px 25px rgba(0,0,0,0.4);
}

.nav-arrow:disabled {
    opacity: 0.3;
    cursor: not-allowed;
    transform: translateY(-50%);
}

.nav-arrow.left {
    left: 20px;
}

.nav-arrow.right {
    right: 20px;
}

.pdf-canvas-wrapper {
    background: white;
    border-radius: 12px;
    box-shadow: 0 10px 40px rgba(0,0,0,0.3);
    /*padding: 2rem;*/
    max-width: 90%;
    max-height: 90%;
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    overflow: hidden;
}

#pdf-canvas {
    max-width: 100%;
    max-height: 100%;
    border-radius: 8px;
    box-shadow: 0 4px 15px rgba(0,0,0,0.1);
}

.loading-container {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    height: 400px;
    color: white;
    text-align: center;
}

.loading-spinner {
    width: 50px;
    height: 50px;
    border: 4px solid rgba(255,255,255,0.3);
    border-top: 4px solid #7dd87f;
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin-bottom: 1rem;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

.welcome-screen {
    text-align: center;
    color: white;
    padding: 3rem;
}

.welcome-screen h2 {
    font-size: 2.5rem;
    margin-bottom: 1rem;
    color: #7dd87f;
}

.welcome-screen p {
    font-size: 1.2rem;
    margin-bottom: 2rem;
    opacity: 0.9;
}

.document-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 1.5rem;
    margin-top: 2rem;
    max-width: 800px;
}

.document-card {
    background: rgba(255,255,255,0.1);
    border-radius: 12px;
    padding: 1.5rem;
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255,255,255,0.2);
    transition: all 0.3s ease;
    cursor: pointer;
}

.document-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 30px rgba(0,0,0,0.3);
    background: rgba(255,255,255,0.15);
}

.document-card h3 {
    color: #7dd87f;
    margin-bottom: 0.5rem;
    font-size: 1.1rem;
}

.document-card p {
    opacity: 0.8;
    font-size: 0.9rem;
    margin-bottom: 1rem;
}

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

.card-link {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.5rem 1rem;
    background: rgba(125, 216, 127, 0.2);
    color: white;
    text-decoration: none;
    border-radius: 6px;
    font-size: 0.9rem;
    transition: all 0.3s ease;
    flex: 1;
    justify-content: center;
}

.card-link:hover {
    background: rgba(125, 216, 127, 0.3);
    transform: translateY(-1px);
}

.card-link.secondary {
    background: rgba(255,255,255,0.1);
}

.card-link.secondary:hover {
    background: rgba(255,255,255,0.2);
}

.error-message {
    background: rgba(231, 76, 60, 0.9);
    color: white;
    padding: 1rem;
    border-radius: 8px;
    margin: 1rem;
    text-align: center;
    backdrop-filter: blur(10px);
}

.zoom-indicator {
    position: absolute;
    bottom: 20px;
    right: 20px;
    background: rgba(45, 90, 61, 0.9);
    color: white;
    padding: 0.5rem 1rem;
    border-radius: 20px;
    font-size: 0.9rem;
    backdrop-filter: blur(10px);
    box-shadow: 0 4px 15px rgba(0,0,0,0.2);
}

.page-indicator {
    position: absolute;
    bottom: 20px;
    left: 50%;
    transform: translateX(-50%);
    background: rgba(45, 90, 61, 0.9);
    color: white;
    padding: 0.5rem 1.5rem;
    border-radius: 25px;
    font-weight: bold;
    backdrop-filter: blur(10px);
    box-shadow: 0 4px 15px rgba(0,0,0,0.2);
}

.menu-toggle {
    background: rgba(255,255,255,0.1);
    border: none;
    color: white;
    padding: 0.5rem;
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.3s ease;
    font-size: 1rem;
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-right: 1rem;
}

.menu-toggle:hover {
    background: rgba(255,255,255,0.2);
}

@media (max-width: 768px) {
    .header-content {
        flex-wrap: wrap;
        gap: 1rem;
    }

    .search-input {
        width: 200px;
    }

    .nav-arrow {
        font-size: 1.5rem;
        padding: 0.75rem 0.5rem;
    }

    .nav-arrow.left {
        left: 10px;
    }

    .nav-arrow.right {
        right: 10px;
    }

    .pdf-canvas-wrapper {
        padding: 1rem;
        max-width: 95%;
    }

    .sidebar {
        width: 280px;
        left: -280px;
    }

    .main-container.sidebar-open {
        margin-left: 0;
    }

    .document-grid {
        grid-template-columns: 1fr;
    }
}
