/* Advanced PDF Embedder Styles */

.ape-pdf-container {
    background-color: #525659;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
    display: flex;
    flex-direction: column;
}

.ape-pdf-toolbar {
    background-color: #323639;
    padding: 8px 12px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 1px solid #1a1a1a;
    flex-shrink: 0;
    z-index: 10;
}

.ape-toolbar-left,
.ape-toolbar-right {
    display: flex;
    align-items: center;
    gap: 8px;
}

.ape-btn {
    background-color: #404346;
    border: 1px solid #555;
    color: #f0f0f0;
    padding: 6px 12px;
    cursor: pointer;
    border-radius: 4px;
    font-size: 14px;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    min-width: 36px;
    height: 32px;
}

.ape-btn:hover:not(:disabled) {
    background-color: #4a4d50;
    border-color: #666;
}

.ape-btn:active:not(:disabled) {
    background-color: #363a3d;
    transform: scale(0.95);
}

.ape-btn:disabled {
    opacity: 0.4;
    cursor: not-allowed;
    background-color: #2a2a2a;
}

.ape-btn span.icon {
    font-size: 16px;
    line-height: 1;
}

.ape-btn span.label {
    font-size: 13px;
    font-weight: 500;
}

.ape-page-info {
    color: #f0f0f0;
    font-size: 14px;
    display: flex;
    align-items: center;
    gap: 5px;
    white-space: nowrap;
}

.ape-current-page {
    width: 50px;
    padding: 4px 8px;
    background-color: #404346;
    border: 1px solid #555;
    color: #f0f0f0;
    border-radius: 3px;
    text-align: center;
    font-size: 14px;
}

.ape-current-page:focus {
    outline: none;
    border-color: #0078d4;
}

/* Canvas wrapper - scrollable container */
.ape-canvas-wrapper {
    flex: 1;
    overflow: auto;
    display: flex;
    align-items: center;
    justify-content: center;
    background-color: #525659;
    position: relative;
    padding: 10px;
}

.ape-pdf-canvas {
    display: block;
    background-color: white;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.3);
    max-width: 100%;
    height: auto;
}

.ape-pdf-loading {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    text-align: center;
    color: #f0f0f0;
    z-index: 5;
}

.ape-spinner {
    border: 4px solid rgba(255, 255, 255, 0.3);
    border-top: 4px solid #fff;
    border-radius: 50%;
    width: 40px;
    height: 40px;
    animation: ape-spin 1s linear infinite;
    margin: 0 auto 10px;
}

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

.ape-pdf-error {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    text-align: center;
    color: #ff6b6b;
    background-color: rgba(0, 0, 0, 0.8);
    padding: 20px;
    border-radius: 8px;
    z-index: 5;
    max-width: 80%;
}

/* Fullscreen mode styles */
.ape-fullscreen-mode {
    position: fixed !important;
    top: 0 !important;
    left: 0 !important;
    width: 100vw !important;
    height: 100vh !important;
    z-index: 999999 !important;
    margin: 0 !important;
}

.ape-fullscreen-mode .ape-canvas-wrapper {
    max-height: calc(100vh - 50px);
}

.ape-fullscreen-mode .ape-pdf-canvas {
    max-width: none;
    max-height: calc(100vh - 70px);
}

/* Responsive styles */
@media (max-width: 768px) {
    .ape-pdf-toolbar {
        flex-wrap: wrap;
        gap: 8px;
    }
    
    .ape-toolbar-left,
    .ape-toolbar-right {
        flex: 1 1 auto;
    }
    
    .ape-btn {
        padding: 5px 10px;
        font-size: 12px;
        min-width: 32px;
        height: 28px;
    }
    
    .ape-btn span.label {
        display: none;
    }
    
    .ape-page-info {
        font-size: 12px;
    }
    
    .ape-current-page {
        width: 40px;
        font-size: 12px;
    }
}

@media (max-width: 480px) {
    .ape-pdf-toolbar {
        padding: 6px 8px;
    }
    
    .ape-toolbar-left,
    .ape-toolbar-right {
        gap: 4px;
    }
    
    .ape-btn {
        padding: 4px 8px;
        font-size: 11px;
        min-width: 28px;
        height: 26px;
    }
    
    .ape-canvas-wrapper {
        padding: 5px;
    }
}

/* Print styles */
@media print {
    .ape-pdf-toolbar {
        display: none !important;
    }
    
    .ape-canvas-wrapper {
        overflow: visible !important;
    }
}

/* Custom scrollbar for webkit browsers */
.ape-canvas-wrapper::-webkit-scrollbar {
    width: 12px;
    height: 12px;
}

.ape-canvas-wrapper::-webkit-scrollbar-track {
    background: #2a2a2a;
}

.ape-canvas-wrapper::-webkit-scrollbar-thumb {
    background: #555;
    border-radius: 6px;
}

.ape-canvas-wrapper::-webkit-scrollbar-thumb:hover {
    background: #666;
}

/* Loading animation refinement */
.ape-pdf-loading p {
    margin-top: 10px;
    font-size: 14px;
    color: #ccc;
}

/* Button hover effects */
.ape-btn.ape-download:hover:not(:disabled) {
    background-color: #2d7a3e;
}

.ape-btn.ape-print:hover:not(:disabled) {
    background-color: #2d5d7a;
}

.ape-btn.ape-fullscreen:hover:not(:disabled) {
    background-color: #7a5d2d;
}

/* Focus styles for accessibility */
.ape-btn:focus,
.ape-current-page:focus {
    outline: 2px solid #0078d4;
    outline-offset: 2px;
}
