/**
 * AMICO PDF Viewer Overlay Styles - Themed to match website
 */

/* Import Gotham font if not already loaded */
@import url('https://fonts.googleapis.com/css2?family=Gotham:wght@300;400;500;600;700&display=swap');

.amico-pdf-overlay,
.amico-pdf-overlay * {
    font-family: 'Gotham', 'Helvetica Neue', Arial, sans-serif !important;
}

.amico-pdf-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.85);
    z-index: 999999;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.4s cubic-bezier(0.4, 0, 0.2, 1), visibility 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    backdrop-filter: blur(8px);
}

.amico-pdf-overlay.active {
    opacity: 1;
    visibility: visible;
}

.pdf-viewer-container {
    width: 92%;
    height: 92%;
    max-width: 1400px;
    background: #ffffff;
    border-radius: 16px;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    box-shadow: 0 25px 80px rgba(0, 0, 0, 0.3), 0 0 0 1px rgba(255, 255, 255, 0.1);
}

.pdf-viewer-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 20px 32px;
    background: linear-gradient(135deg, #2E8B92 0%, #1e6b73 100%);
    color: white;
    border-bottom: none;
    box-shadow: 0 2px 20px rgba(46, 139, 146, 0.2);
}

.pdf-viewer-controls {
    display: flex;
    align-items: center;
    gap: 16px;
}

.pdf-control-btn {
    background: rgba(255, 255, 255, 0.15);
    border: 1px solid rgba(255, 255, 255, 0.25);
    color: white;
    padding: 12px;
    border-radius: 8px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    min-width: 48px;
    height: 48px;
    font-weight: 500;
}

.pdf-control-btn:hover {
    background: rgba(255, 255, 255, 0.25);
    border-color: rgba(255, 255, 255, 0.4);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

.pdf-control-btn:disabled {
    opacity: 0.4;
    cursor: not-allowed;
    transform: none;
}

.pdf-control-btn:disabled:hover {
    background: rgba(255, 255, 255, 0.15);
    border-color: rgba(255, 255, 255, 0.25);
    transform: none;
    box-shadow: none;
}

.pdf-page-info {
    font-size: 15px;
    font-weight: 600;
    min-width: 70px;
    text-align: center;
    background: rgba(255, 255, 255, 0.1);
    padding: 8px 16px;
    border-radius: 20px;
    backdrop-filter: blur(10px);
}

.pdf-zoom-controls {
    display: flex;
    align-items: center;
    gap: 12px;
}

.pdf-zoom-level {
    font-size: 15px;
    font-weight: 600;
    min-width: 55px;
    text-align: center;
    background: rgba(255, 255, 255, 0.1);
    padding: 8px 12px;
    border-radius: 20px;
    backdrop-filter: blur(10px);
}

.pdf-close-btn {
    background: rgba(239, 83, 80, 0.9);
    border: 1px solid rgba(239, 83, 80, 1);
    color: white;
    padding: 12px;
    border-radius: 8px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    width: 48px;
    height: 48px;
}

.pdf-close-btn:hover {
    background: rgba(239, 83, 80, 1);
    border-color: rgba(239, 83, 80, 1);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(239, 83, 80, 0.3);
    outline: none;
}

.pdf-close-btn:focus {
    outline: none;
    box-shadow: 0 0 0 3px rgba(239, 83, 80, 0.3);
}

.pdf-viewer-content {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 24px;
    background: linear-gradient(145deg, #f8fbfc 0%, #ecf4f5 100%);
    overflow: auto;
    position: relative;
}

.pdf-loading {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    color: #2E8B92;
}

.pdf-loading p {
    margin: 20px 0 0 0;
    font-size: 18px;
    font-weight: 600;
    color: #2E8B92;
}

.pdf-spinner {
    width: 56px;
    height: 56px;
    border: 4px solid rgba(46, 139, 146, 0.2);
    border-left-color: #2E8B92;
    border-radius: 50%;
    animation: pdf-spin 1s linear infinite;
}

@keyframes pdf-spin {
    to {
        transform: rotate(360deg);
    }
}

.pdf-canvas {
    max-width: 100%;
    max-height: 100%;
    display: block;
    margin: 0 auto;
    box-shadow: 0 8px 32px rgba(46, 139, 146, 0.15), 0 0 0 1px rgba(46, 139, 146, 0.1);
    border-radius: 12px;
}

/* Prevent body scroll when PDF viewer is open */
body.pdf-viewer-open {
    overflow: hidden;
}

/* Mobile Responsive */
@media (max-width: 768px) {
    .pdf-viewer-container {
        width: 96%;
        height: 96%;
        border-radius: 12px;
    }
    
    .pdf-viewer-header {
        padding: 16px 20px;
        flex-wrap: wrap;
        gap: 16px;
    }
    
    .pdf-viewer-controls {
        gap: 12px;
    }
    
    .pdf-control-btn {
        padding: 10px;
        min-width: 44px;
        height: 44px;
    }
    
    .pdf-close-btn {
        width: 44px;
        height: 44px;
        padding: 10px;
    }
    
    .pdf-zoom-controls {
        gap: 10px;
    }
    
    .pdf-page-info,
    .pdf-zoom-level {
        font-size: 14px;
        min-width: 55px;
        padding: 6px 12px;
    }
    
    .pdf-viewer-content {
        padding: 16px;
    }
}

@media (max-width: 480px) {
    .pdf-viewer-container {
        width: 98%;
        height: 98%;
        border-radius: 4px;
    }
    
    .pdf-viewer-header {
        padding: 8px 12px;
    }
    
    .pdf-viewer-controls {
        gap: 8px;
        flex-wrap: wrap;
    }
    
    .pdf-zoom-controls {
        order: 2;
        flex-basis: 100%;
        justify-content: center;
        margin-top: 8px;
    }
    
    .pdf-control-btn {
        padding: 4px;
        min-width: 32px;
        height: 32px;
    }
    
    .pdf-viewer-content {
        padding: 8px;
    }
}

/* High DPI Display Support */
@media (-webkit-min-device-pixel-ratio: 2), (min-resolution: 192dpi) {
    .pdf-canvas {
        image-rendering: -webkit-optimize-contrast;
        image-rendering: crisp-edges;
    }
}

/* Dark Mode Support */
@media (prefers-color-scheme: dark) {
    .pdf-viewer-container {
        background: #2c3e50;
        color: #ecf0f1;
    }
    
    .pdf-viewer-header {
        background: #1a252f;
        border-bottom-color: #34495e;
    }
    
    .pdf-viewer-content {
        background: #34495e;
    }
}

/* Focus Styles for Accessibility */
.pdf-control-btn:focus {
    outline: none;
    box-shadow: 0 0 0 3px rgba(46, 139, 146, 0.3);
}

.pdf-close-btn:focus {
    outline: none;
    box-shadow: 0 0 0 3px rgba(239, 83, 80, 0.3);
}

/* Remove any default browser button styling */
.pdf-control-btn,
.pdf-close-btn {
    -webkit-appearance: none;
    -moz-appearance: none;
    appearance: none;
    border-style: solid;
}

.pdf-control-btn:hover,
.pdf-control-btn:active {
    outline: none;
    border-color: rgba(255, 255, 255, 0.4);
}

.pdf-close-btn:hover,
.pdf-close-btn:active {
    outline: none;
    border-color: rgba(239, 83, 80, 1);
}

/* Animation for smooth opening */
@keyframes fadeInScale {
    from {
        opacity: 0;
        transform: scale(0.9);
    }
    to {
        opacity: 1;
        transform: scale(1);
    }
}

.amico-pdf-overlay.active .pdf-viewer-container {
    animation: fadeInScale 0.3s ease-out;
}
