/* ============================================================================
   PDF Viewer Styles - Phase A Implementation
   Live PDF preview with navigation and zoom controls
   ============================================================================ */

.pdf-viewer-wrapper {
    display: flex;
    flex-direction: column;
    height: 100%;
    min-height: 600px;
    background: #ffffff; /* light mode */
    border-radius: 12px;
    border: 2px solid rgba(0,0,0,.1);
    overflow: hidden;
    width: 100%;
}

[data-theme="dark"] .pdf-viewer-wrapper {
    background: linear-gradient(135deg, rgba(15,23,42,0.95), rgba(30,41,59,0.85));
    border: 2px solid rgba(148,163,184,.25);
}

/* Toolbar */
.pdf-viewer-toolbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 12px 20px;
    background: rgba(0,0,0,0.05); /* light mode */
    border-bottom: 1px solid rgba(0,0,0,.1);
    flex-shrink: 0;
}

[data-theme="dark"] .pdf-viewer-toolbar {
    background: rgba(0,0,0,0.3);
    border-bottom: 1px solid rgba(148,163,184,.2);
}

.pdf-viewer-toolbar-left,
.pdf-viewer-toolbar-center,
.pdf-viewer-toolbar-right {
    display: flex;
    align-items: center;
    gap: 12px;
}

/* Buttons */
.pdf-btn {
    padding: 8px 16px;
    background: rgba(14, 165, 233, 0.15);
    color: #0ea5e9;
    border: 2px solid rgba(14, 165, 233, 0.3);
    border-radius: 8px;
    cursor: pointer;
    font-weight: 600;
    font-size: 14px;
    transition: all 0.2s ease;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.pdf-btn:hover {
    background: rgba(14, 165, 233, 0.25);
    border-color: #0ea5e9;
    transform: translateY(-1px);
}

.pdf-btn:active {
    transform: translateY(0);
}

.pdf-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    transform: none;
}

.pdf-btn-icon {
    padding: 8px 12px;
    min-width: 40px;
}

.pdf-btn-primary {
    background: linear-gradient(135deg, #0ea5e9, #0284c7);
    color: white;
    border-color: #0ea5e9;
}

.pdf-btn-primary:hover {
    background: linear-gradient(135deg, #0284c7, #0369a1);
    border-color: #0284c7;
}

/* Page Info */
.pdf-page-info {
    display: inline-flex;
    align-items: center;
    color: #1a1a1a; /* light mode */
    font-weight: 600;
    font-size: 15px;
    padding: 0 8px;
    min-width: 80px;
    justify-content: center;
}

[data-theme="dark"] .pdf-page-info {
    color: rgba(229, 231, 235, 0.9);
}

.pdf-page-separator {
    margin: 0 6px;
    color: rgba(148, 163, 184, 0.6);
}

/* Zoom Select */
.pdf-zoom-select {
    padding: 6px 12px;
    background: #ffffff; /* light mode */
    color: #1a1a1a;
    border: 2px solid rgba(0,0,0,.2);
    border-radius: 6px;
    cursor: pointer;
    font-size: 14px;
    font-weight: 600;
    min-width: 120px;
    transition: all 0.2s ease;
}

[data-theme="dark"] .pdf-zoom-select {
    background: rgba(255, 255, 255, 0.1);
    color: rgba(229, 231, 235, 0.9);
    border: 2px solid rgba(148,163,184,.25);
}

.pdf-zoom-select:hover {
    background: rgba(255, 255, 255, 0.15);
    border-color: rgba(148,163,184,.4);
}

.pdf-zoom-select:focus {
    outline: none;
    border-color: #0ea5e9;
    box-shadow: 0 0 0 3px rgba(14, 165, 233, 0.2);
}

.pdf-zoom-select option {
    background: #ffffff; /* light mode */
    color: #1a1a1a;
}

[data-theme="dark"] .pdf-zoom-select option {
    background: #1e293b;
    color: white;
}

/* Canvas Container */
.pdf-canvas-container {
    flex: 1;
    overflow: auto;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
    position: relative;
    min-height: 500px;
    max-height: calc(100vh - 200px);
    width: 100%;
}

.pdf-canvas-container canvas {
    box-shadow: 0 8px 32px rgba(0,0,0,0.5);
    border-radius: 4px;
    background: white;
    max-width: 100%;
    max-height: 100%;
    height: auto;
    width: auto;
    display: block !important;
    visibility: visible !important;
    opacity: 1 !important;
}

/* Loading Overlay */
.pdf-loading-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(255,255,255,0.95); /* light mode */
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
}

[data-theme="dark"] .pdf-loading-overlay {
    background: rgba(15,23,42,0.95);
}

.pdf-loading-spinner {
    text-align: center;
    color: #1a1a1a; /* light mode */
}

[data-theme="dark"] .pdf-loading-spinner {
    color: rgba(229, 231, 235, 0.9);
}

.pdf-loading-spinner i {
    color: #0ea5e9;
    margin-bottom: 20px;
}

.pdf-loading-spinner p {
    font-size: 16px;
    margin: 0;
    font-weight: 500;
}

/* Error Overlay */
.pdf-error-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(255,255,255,0.95); /* light mode */
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
}

[data-theme="dark"] .pdf-error-overlay {
    background: rgba(15,23,42,0.95);
}

.pdf-error-content {
    text-align: center;
    max-width: 500px;
    padding: 40px;
}

.pdf-error-content i {
    color: #dc3545;
    margin-bottom: 20px;
}

.pdf-error-content h3 {
    color: #1a1a1a; /* light mode */
    font-size: 24px;
    font-weight: 700;
    margin-bottom: 12px;
}

[data-theme="dark"] .pdf-error-content h3 {
    color: white;
}

.pdf-error-content p {
    color: #6c757d; /* light mode */
    font-size: 15px;
    margin-bottom: 24px;
    line-height: 1.6;
}

[data-theme="dark"] .pdf-error-content p {
    color: rgba(229, 231, 235, 0.8);
}

/* Scrollbar Styling */
.pdf-canvas-container::-webkit-scrollbar {
    width: 12px;
    height: 12px;
}

.pdf-canvas-container::-webkit-scrollbar-track {
    background: rgba(0,0,0,0.2);
    border-radius: 6px;
}

.pdf-canvas-container::-webkit-scrollbar-thumb {
    background: rgba(14, 165, 233, 0.4);
    border-radius: 6px;
}

.pdf-canvas-container::-webkit-scrollbar-thumb:hover {
    background: rgba(14, 165, 233, 0.6);
}

/* Responsive Design */
@media (max-width: 768px) {
    .pdf-viewer-wrapper {
        min-height: 400px;
    }
    
    .pdf-viewer-toolbar {
        flex-wrap: wrap;
        padding: 10px 12px;
        gap: 8px;
    }
    
    .pdf-viewer-toolbar-left,
    .pdf-viewer-toolbar-center,
    .pdf-viewer-toolbar-right {
        gap: 6px;
    }
    
    .pdf-viewer-toolbar-right {
        width: 100%;
        justify-content: center;
        margin-top: 8px;
    }
    
    .pdf-btn {
        font-size: 13px;
        padding: 6px 12px;
    }
    
    .pdf-btn-icon {
        padding: 6px 10px;
        min-width: 36px;
    }
    
    .pdf-zoom-select {
        font-size: 13px;
        min-width: 100px;
    }
    
    .pdf-page-info {
        font-size: 14px;
        min-width: 70px;
    }
    
    .pdf-canvas-container {
        padding: 10px;
    }
}

@media (max-width: 480px) {
    .pdf-viewer-toolbar {
        padding: 8px;
    }
    
    .pdf-btn {
        font-size: 12px;
        padding: 5px 10px;
    }
    
    .pdf-zoom-select {
        font-size: 12px;
        min-width: 90px;
    }
    
    .pdf-error-content {
        padding: 20px;
    }
    
    .pdf-error-content h3 {
        font-size: 20px;
    }
    
    .pdf-error-content p {
        font-size: 14px;
    }
}

/* Animation */
@keyframes fadeIn {
    from {
        opacity: 0;
    }
    to {
        opacity: 1;
    }
}

.pdf-viewer-wrapper {
    animation: fadeIn 0.3s ease-out;
}

/* Print Styles */
@media print {
    .pdf-viewer-toolbar {
        display: none;
    }
    
    .pdf-viewer-wrapper {
        border: none;
        background: white;
    }
    
    .pdf-canvas-container {
        overflow: visible;
        padding: 0;
    }
}

/* Accessibility */
.pdf-btn:focus,
.pdf-zoom-select:focus {
    outline: 3px solid #0ea5e9;
    outline-offset: 2px;
}

/* Dark Mode Support - Now handled by data-theme attribute */

