/* Custom CSS for PDF Alchemist Pro */
@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700&display=swap');

* {
    font-family: 'Inter', sans-serif;
}

/* Custom scrollbar */
::-webkit-scrollbar {
    width: 8px;
    height: 8px;
}

::-webkit-scrollbar-track {
    background: transparent;
}

::-webkit-scrollbar-thumb {
    background: #cbd5e1;
    border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
    background: #94a3b8;
}

.dark ::-webkit-scrollbar-thumb {
    background: #475569;
}

.dark ::-webkit-scrollbar-thumb:hover {
    background: #64748b;
}

/* PDF Page Container */
.pdf-page {
    background: white;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
    margin: 1rem auto;
    position: relative;
    transform-origin: top center;
    transition: transform 0.2s ease;
}

.pdf-page:hover {
    box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
}

/* Text Layer */
.textLayer {
    position: absolute;
    left: 0;
    top: 0;
    right: 0;
    bottom: 0;
    overflow: hidden;
    opacity: 0.2;
    line-height: 1.0;
}

.textLayer > span {
    color: transparent;
    position: absolute;
    white-space: pre;
    cursor: text;
    transform-origin: 0% 0%;
}

.textLayer .highlight {
    margin: -1px;
    padding: 1px;
    background-color: rgba(180, 0, 170, 0.4);
    border-radius: 4px;
}

/* Canvas Layer */
.canvasWrapper {
    position: relative;
    overflow: hidden;
}

/* Annotation Layer */
.annotationLayer {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    pointer-events: none;
}

.annotationLayer > section {
    pointer-events: auto;
}

/* Selection */
::selection {
    background: rgba(99, 102, 241, 0.3);
}

/* Drag and Drop Active State */
.drag-active {
    background-color: rgba(99, 102, 241, 0.1) !important;
    border-color: #6366f1 !important;
}

/* Tool Button Active State */
.tool-active {
    background-color: rgba(99, 102, 241, 0.1);
    color: #4f46e5;
    border-color: #4f46e5;
}

.dark .tool-active {
    background-color: rgba(99, 102, 241, 0.2);
    color: #818cf8;
    border-color: #818cf8;
}

/* Page Thumbnail */
.thumbnail {
    transition: all 0.2s ease;
    cursor: pointer;
    border: 2px solid transparent;
}

.thumbnail:hover {
    border-color: #cbd5e1;
    transform: translateY(-2px);
}

.thumbnail.active {
    border-color: #4f46e5;
    background-color: rgba(99, 102, 241, 0.1);
}

.dark .thumbnail.active {
    border-color: #818cf8;
    background-color: rgba(99, 102, 241, 0.2);
}

/* Loading Spinner */
.spinner {
    border: 3px solid rgba(99, 102, 241, 0.3);
    border-radius: 50%;
    border-top: 3px solid #4f46e5;
    width: 40px;
    height: 40px;
    animation: spin 1s linear infinite;
}

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

/* Context Menu */
.context-menu {
    position: absolute;
    background: white;
    border: 1px solid #e2e8f0;
    border-radius: 0.5rem;
    box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.1);
    z-index: 1000;
    min-width: 160px;
    display: none;
}

.dark .context-menu {
    background: #1e293b;
    border-color: #334155;
}

.context-menu-item {
    padding: 0.5rem 1rem;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.875rem;
    color: #374151;
    transition: all 0.15s;
}

.dark .context-menu-item {
    color: #e2e8f0;
}

.context-menu-item:hover {
    background-color: #f3f4f6;
    color: #4f46e5;
}

.dark .context-menu-item:hover {
    background-color: #334155;
}

/* Responsive adjustments */
@media (max-width: 768px) {
    .pdf-page {
        margin: 0.5rem auto;
    }
}

/* Print styles */
@media print {
    .no-print {
        display: none !important;
    }
}