/* PDF Viewer Module CSS - Vue.js + PDFObject */

/* PDF Viewer Container */
#regulatory-module {
    display: flex;
    height: 100%;
    width: 100%;
    background-color: var(--background-color);
}

#vue-pdf-app {
    display: flex;
    width: 100%;
    height: 100%;
}

/* PDF Viewer Layout */
.pdf-viewer-container {
    display: flex;
    height: 100%;
    width: 100%;
}

/* File List Sidebar */
.pdf-sidebar {
    width: 350px;
    min-width: 300px;
    max-width: 450px;
    background-color: var(--surface-color);
    border-right: 1px solid var(--border-color);
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

/* Sidebar Header */
.pdf-sidebar-header {
    padding: 20px;
    background-color: var(--surface-color);
    border-bottom: 1px solid var(--border-color);
}

.pdf-sidebar-header h2 {
    margin: 0 0 16px 0;
    font-size: 20px;
    font-weight: 600;
    color: var(--text-primary);
}

.pdf-search-container {
    position: relative;
    margin-bottom: 16px;
}

.pdf-search-input {
    width: 100%;
    padding: 10px 12px 10px 36px;
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    background-color: var(--surface-color);
    color: var(--text-primary);
    font-size: 14px;
    transition: var(--transition);
}

.pdf-search-input:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.1);
}

.pdf-search-icon {
    position: absolute;
    left: 12px;
    top: 50%;
    transform: translateY(-50%);
    color: var(--text-secondary);
    font-size: 14px;
    pointer-events: none;
}

/* Category Filter */
.pdf-category-filter {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    margin-bottom: 8px;
}

.category-chip {
    padding: 4px 10px;
    border: 1px solid var(--border-color);
    background-color: var(--surface-color);
    color: var(--text-secondary);
    border-radius: 16px;
    font-size: 12px;
    font-weight: 500;
    cursor: pointer;
    transition: var(--transition);
    white-space: nowrap;
}

.category-chip:hover {
    background-color: var(--hover-color);
    border-color: var(--primary-color);
}

.category-chip.active {
    background-color: var(--primary-color);
    color: white;
    border-color: var(--primary-color);
}

/* File Count */
.pdf-file-count {
    font-size: 12px;
    color: var(--text-secondary);
    text-align: center;
    margin-top: 8px;
}

/* File List */
.pdf-file-list {
    flex: 1;
    overflow-y: auto;
    padding: 0 20px 20px 20px;
}

/* File Item */
.pdf-file-item {
    padding: 16px;
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    background-color: var(--surface-color);
    margin-bottom: 12px;
    cursor: pointer;
    transition: var(--transition);
    position: relative;
}

.pdf-file-item:hover {
    background-color: var(--hover-color);
    border-color: var(--primary-color);
    transform: translateY(-1px);
    box-shadow: var(--shadow-medium);
}

.pdf-file-item.active {
    background-color: var(--primary-color);
    color: white;
    border-color: var(--primary-color);
}

.pdf-file-item.active * {
    color: white !important;
}

.pdf-file-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 8px;
}

.pdf-file-title {
    font-size: 14px;
    font-weight: 600;
    color: var(--text-primary);
    line-height: 1.3;
    margin: 0;
    flex: 1;
    margin-right: 8px;
}

.pdf-file-category {
    background-color: var(--primary-color);
    color: white;
    padding: 2px 8px;
    border-radius: 10px;
    font-size: 10px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    white-space: nowrap;
}

.pdf-file-item.active .pdf-file-category {
    background-color: rgba(255, 255, 255, 0.2);
}

.pdf-file-meta {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 8px;
    font-size: 11px;
    color: var(--text-secondary);
}

.pdf-file-meta-item {
    display: flex;
    align-items: center;
    gap: 4px;
}

.pdf-file-meta-icon {
    font-size: 10px;
    opacity: 0.7;
}

/* Main PDF Viewer */
.pdf-main-viewer {
    flex: 1;
    display: flex;
    flex-direction: column;
    background-color: var(--background-color);
    position: relative;
}

/* PDF Viewer Header */
.pdf-viewer-header {
    padding: 20px 24px;
    background-color: var(--surface-color);
    border-bottom: 1px solid var(--border-color);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.pdf-viewer-title {
    margin: 0;
    font-size: 18px;
    font-weight: 600;
    color: var(--text-primary);
    flex: 1;
    margin-right: 16px;
}

.pdf-viewer-actions {
    display: flex;
    gap: 8px;
}

.pdf-action-btn {
    padding: 8px 16px;
    border: 1px solid var(--border-color);
    background-color: var(--surface-color);
    color: var(--text-primary);
    border-radius: var(--radius-md);
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: var(--transition);
    text-decoration: none;
    display: flex;
    align-items: center;
    gap: 6px;
}

.pdf-action-btn:hover {
    background-color: var(--hover-color);
    border-color: var(--primary-color);
    color: var(--primary-color);
}

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

.pdf-action-btn.primary:hover {
    background-color: var(--accent-color);
}

/* PDF Content Area */
.pdf-content-area {
    flex: 1;
    padding: 24px;
    overflow: auto;
    position: relative;
}

/* PDF Embed Container */
.pdf-embed-container {
    width: 100%;
    height: 100%;
    min-height: 600px;
    background-color: var(--surface-color);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    overflow: hidden;
    position: relative;
}

.pdf-embed-container object,
.pdf-embed-container embed,
.pdf-embed-container iframe {
    width: 100%;
    height: 100%;
    border: none;
    border-radius: var(--radius-md);
}

/* PDF Loading State */
.pdf-loading {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    height: 100%;
    min-height: 400px;
    color: var(--text-secondary);
    background-color: var(--surface-color);
}

.pdf-loading-icon {
    font-size: 48px;
    margin-bottom: 16px;
    opacity: 0.6;
}

.pdf-loading h3 {
    font-size: 18px;
    font-weight: 600;
    color: var(--text-primary);
    margin: 0 0 8px 0;
}

.pdf-loading p {
    font-size: 14px;
    margin: 0;
    text-align: center;
    max-width: 300px;
    line-height: 1.5;
}

/* PDF Error State */
.pdf-error {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    height: 100%;
    min-height: 400px;
    text-align: center;
    padding: 40px;
    background-color: var(--surface-color);
    border: 1px solid #dc2626;
    border-radius: var(--radius-md);
}

.pdf-error-icon {
    font-size: 48px;
    margin-bottom: 16px;
    color: #dc2626;
}

.pdf-error h3 {
    font-size: 18px;
    font-weight: 600;
    color: #dc2626;
    margin: 0 0 8px 0;
}

.pdf-error p {
    font-size: 14px;
    color: var(--text-secondary);
    margin: 0 0 16px 0;
    max-width: 400px;
    line-height: 1.5;
}

/* Empty State */
.pdf-empty-state {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    height: 100%;
    min-height: 400px;
    text-align: center;
    color: var(--text-secondary);
    padding: 40px;
}

.pdf-empty-icon {
    font-size: 64px;
    margin-bottom: 24px;
    opacity: 0.5;
}

.pdf-empty-state h3 {
    font-size: 20px;
    font-weight: 600;
    color: var(--text-primary);
    margin: 0 0 12px 0;
}

.pdf-empty-state p {
    font-size: 16px;
    margin: 0;
    max-width: 400px;
    line-height: 1.5;
}

/* Responsive Design */
@media (max-width: 1024px) {
    .pdf-sidebar {
        width: 320px;
        min-width: 280px;
    }
    
    .pdf-viewer-header {
        padding: 16px 20px;
    }
    
    .pdf-content-area {
        padding: 20px;
    }
}

@media (max-width: 768px) {
    .pdf-viewer-container {
        flex-direction: column;
    }
    
    .pdf-sidebar {
        width: 100%;
        max-height: 40vh;
        border-right: none;
        border-bottom: 1px solid var(--border-color);
    }
    
    .pdf-sidebar-header {
        padding: 16px;
    }
    
    .pdf-file-list {
        padding: 0 16px 16px 16px;
    }
    
    .pdf-viewer-header {
        padding: 12px 16px;
    }
    
    .pdf-viewer-title {
        font-size: 16px;
    }
    
    .pdf-action-btn {
        padding: 6px 12px;
        font-size: 13px;
    }
    
    .pdf-content-area {
        padding: 16px;
    }
    
    .category-chip {
        font-size: 11px;
        padding: 3px 8px;
    }
    
    .pdf-file-title {
        font-size: 13px;
    }
    
    .pdf-file-meta {
        font-size: 10px;
    }
}

/* Scrollbar Styling */
.pdf-file-list::-webkit-scrollbar {
    width: 6px;
}

.pdf-file-list::-webkit-scrollbar-track {
    background: var(--background-color);
}

.pdf-file-list::-webkit-scrollbar-thumb {
    background: var(--border-color);
    border-radius: 3px;
}

.pdf-file-list::-webkit-scrollbar-thumb:hover {
    background: var(--text-secondary);
}

/* Firefox scrollbar */
.pdf-file-list {
    scrollbar-width: thin;
    scrollbar-color: var(--border-color) var(--background-color);
}

/* Dark Mode Adjustments */
[data-theme="dark"] .pdf-embed-container {
    background-color: #2d3748;
}

[data-theme="dark"] .pdf-loading {
    background-color: var(--surface-color);
}

/* Focus States */
.pdf-search-input:focus,
.pdf-file-item:focus {
    outline: 2px solid var(--primary-color);
    outline-offset: 2px;
}

.category-chip:focus {
    outline: 2px solid var(--primary-color);
    outline-offset: 1px;
}

/* Animation */
.pdf-file-item {
    animation: slideInUp 0.3s ease;
}

@keyframes slideInUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Loading spinner for PDF */
.pdf-spinner {
    width: 40px;
    height: 40px;
    border: 4px solid var(--border-color);
    border-top: 4px solid var(--primary-color);
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin-bottom: 16px;
}

/* High contrast mode support */
@media (prefers-contrast: high) {
    .pdf-file-item {
        border-width: 2px;
    }
    
    .pdf-file-item:hover {
        border-width: 3px;
    }
    
    .pdf-embed-container {
        border-width: 2px;
    }
}

/* Reduced motion support */
@media (prefers-reduced-motion: reduce) {
    .pdf-file-item {
        animation: none;
        transition: none;
    }
    
    .pdf-file-item:hover {
        transform: none;
    }
    
    .pdf-spinner {
        animation: none;
    }
}

