/**
 * Enhanced PDF Viewer Styles - Hason Tech Edition
 * Professional PDF viewing with full-page display
 */

.epv-container {
    border: 1px solid #0073aa;
    background: #f9f9f9;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
    position: relative;
    overflow: hidden;
    display: block;
    width: 100%;
    height: auto;
    min-height: auto;
    margin-bottom: 20px;
}

/* Toolbar Styles */
.epv-toolbar {
    background: #2f5fed;
    border-bottom: 1px solid #002d5f;
    padding: 10px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 16px;
    min-height: 60px;
    position: relative;
}

.epv-toolbar-left,
.epv-toolbar-center,
.epv-toolbar-right {
    display: flex;
    align-items: center;
    gap: 12px;
}

.epv-toolbar-center {
    flex: 1;
    justify-content: center;
    margin: 0 20px;
}

.epv-toolbar-left {
    min-width: 200px;
}

.epv-toolbar-right {
    min-width: 240px;
    justify-content: flex-end;
}

.epv-toolbar-center label {
    font-size: 14px;
    color: #ffffff;
    margin: 0 8px 0 0;
    font-weight: 600;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.2);
    letter-spacing: 0.3px;
}

/* Button Styles */
.epv-btn {
    background: linear-gradient(135deg, #ffffff 0%, #f8f9fa 100%);
    border: 1px solid rgba(255, 255, 255, 0.5);
    border-radius: 6px;
    padding: 2px;
    cursor: pointer;
    font-size: 12px;
    font-weight: 600;
    line-height: 1;
    min-width: 38px;
    height: 38px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    color: #0056b3;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1), 0 1px 2px rgba(0, 0, 0, 0.06);
    text-shadow: none;
    position: relative;
    overflow: hidden;
    margin-bottom: 0;
}

.epv-btn::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.3), transparent);
    transition: left 0.5s;
}

.epv-btn:hover {
    background: linear-gradient(135deg, #f0f8ff 0%, #e6f3ff 100%);
    border-color: #0084ff;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 115, 170, 0.3), 0 2px 4px rgba(0, 0, 0, 0.1);
    color: #003d82;
}

.epv-btn:hover::before {
    left: 100%;
}

.epv-btn:active {
    background: #e0e0e0;
}

.epv-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

/* Page Info */
.epv-page-info {
    font-size: 15px;
    color: #ffffff;
    display: flex;
    align-items: center;
    gap: 6px;
    font-weight: 600;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.3);
    padding: 6px 12px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 20px;
    border: 1px solid rgba(255, 255, 255, 0.2);
}

.epv-current-page {
    font-weight: 700;
    color: #00d4ff;
    background: rgba(0, 212, 255, 0.2);
    padding: 4px 8px;
    border-radius: 12px;
    border: 1px solid rgba(0, 212, 255, 0.3);
    min-width: 24px;
    text-align: center;
    font-size: 16px;
    text-shadow: 0 0 8px rgba(0, 212, 255, 0.5);
}

/* Page Input */
.epv-page-input {
    width: 70px !important;
    padding: 8px 12px !important;
    border: 2px solid rgba(255, 255, 255, 0.3) !important;
    border-radius: 6px !important;
    text-align: center !important;
    font-size: 14px !important;
    font-weight: 600 !important;
    height: 38px !important;
    background: rgba(255, 255, 255, 0.95) !important;
    color: #0056b3 !important;
    box-shadow: inset 0 1px 3px rgba(0, 0, 0, 0.1) !important;
    transition: all 0.3s ease !important;
    margin-bottom: 0;
}

.epv-page-input:focus {
    outline: none;
    border-color: #00d4ff;
    box-shadow: 0 0 0 3px rgba(0, 212, 255, 0.3), inset 0 1px 3px rgba(0, 0, 0, 0.1);
    background: #ffffff;
    transform: scale(1.05);
}

/* Zoom Level */
.epv-zoom-level {
    font-size: 14px;
    color: #ffffff;
    min-width: 50px;
    text-align: center;
    font-weight: 700;
    background: linear-gradient(135deg, rgba(0, 212, 255, 0.3) 0%, rgba(0, 132, 255, 0.3) 100%);
    padding: 6px 10px;
    border-radius: 15px;
    border: 1px solid rgba(0, 212, 255, 0.4);
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.3);
    letter-spacing: 0.5px;
    box-shadow: inset 0 1px 2px rgba(255, 255, 255, 0.1);
}

/* Viewer Wrapper */
.epv-viewer-wrapper {
    position: relative;
    display: block;
    padding: 0;
    /* Display full height without scrolling */
    min-height: 200px;
    height: auto;
    max-height: none;
    width: 100%;
    overflow: visible;
    /* Center content horizontally */
    text-align: center;
}

/* Canvas */
.epv-canvas {
    background: #fff;
    max-width: 100%;
    width: 100% !important;
    height: auto !important;
    cursor: grab;
    display: inline-block;
    margin: 0 auto;
    vertical-align: top;
    position: relative;
    z-index: 1;
}

.epv-canvas:active {
    cursor: grabbing;
}

/* Loading States */
.epv-loading {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 40px 20px;
    color: #666;
    /* Use relative positioning to maintain layout flow */
    position: relative;
    background: rgba(255, 255, 255, 0.95);
    border-radius: 8px;
    z-index: 10;
    min-height: 200px;
    text-align: center;
}

.epv-spinner {
    width: 32px;
    height: 32px;
    border: 3px solid #f0f0f0;
    border-top: 3px solid #0073aa;
    border-radius: 50%;
    animation: epv-spin 1s linear infinite;
    margin-bottom: 16px;
}

@keyframes epv-spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* Scroll Hint */
.epv-scroll-hint {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background: rgba(0, 0, 0, 0.8);
    color: white;
    padding: 12px 20px;
    border-radius: 6px;
    z-index: 100;
    pointer-events: none;
    font-size: 14px;
    white-space: nowrap;
}

.epv-scroll-hint p {
    margin: 0;
}

/* Responsive Design */
@media (max-width: 768px) {
    .epv-toolbar {
        flex-direction: column;
        gap: 8px;
        padding: 8px 12px;
    }
    
    .epv-toolbar-left,
    .epv-toolbar-center,
    .epv-toolbar-right {
        width: 100%;
        justify-content: center;
    }
    
    .epv-toolbar-center {
        order: -1;
    }
    
    .epv-viewer-wrapper {
        padding: 10px;
    }
    
    .epv-btn {
        padding: 8px 12px;
        font-size: 16px;
        min-width: 44px;
        height: 44px;
    }
    
    .epv-page-input {
        width: 80px;
        height: 36px;
        font-size: 16px;
    }
}

@media (max-width: 480px) {
    .epv-toolbar {
        padding: 8px;
    }
    
    .epv-btn {
        padding: 6px 8px;
        font-size: 14px;
        min-width: 36px;
        height: 36px;
    }
}

/* Branding Styles */
.epv-branding {
    background: linear-gradient(135deg, #f8f9fa 0%, #e9ecef 100%);
    border: 1px solid #dee2e6;
    border-left: 4px solid #0073aa;
    border-radius: 6px;
    padding: 15px;
    margin-top: 20px;
    box-shadow: 0 2px 4px rgba(0, 115, 170, 0.1);
}

.epv-branding a {
    color: #0073aa !important;
    text-decoration: none;
    font-weight: 600;
    transition: color 0.2s ease;
}

.epv-branding a:hover {
    color: #005a87 !important;
    text-decoration: underline;
}

/* Utility Classes */
.epv-clearfix::after {
    content: "";
    display: table;
    clear: both;
}

/* Ensure proper spacing between PDF viewer and following content */
.epv-container + * {
    margin-top: 20px !important;
}

/* Admin Page Styles */
.epv-features {
    background: #fff;
    border: 1px solid #ccd0d4;
    border-radius: 4px;
    padding: 20px;
    margin-top: 20px;
}

.epv-features h2 {
    margin-top: 0;
    color: #1d2327;
}

.epv-features ul {
    list-style: none;
    padding: 0;
}

.epv-features li {
    padding: 8px 0;
    border-bottom: 1px solid #f0f0f1;
    font-size: 14px;
}

.epv-features li:last-child {
    border-bottom: none;
}

/* Settings Form Styles */
.form-table th {
    width: 200px;
}

.form-table input[type="text"],
.form-table input[type="range"] {
    width: 300px;
}

.form-table output {
    margin-left: 10px;
    font-weight: 600;
    color: #0073aa;
}

/* Success/Error Messages */
.epv-message {
    padding: 12px 16px;
    margin: 16px 0;
    border-radius: 4px;
}

.epv-message.success {
    background: #d4edda;
    color: #155724;
    border: 1px solid #c3e6cb;
}

.epv-message.error {
    background: #f8d7da;
    color: #721c24;
    border: 1px solid #f5c6cb;
}

/* Accessibility */
.epv-btn:focus,
.epv-page-input:focus {
    outline: 2px solid #0073aa;
    outline-offset: 2px;
}

/* High contrast mode support */
@media (prefers-contrast: high) {
    .epv-container {
        border-width: 2px;
    }
    
    .epv-btn {
        border-width: 2px;
    }
}

/* Reduced motion support */
@media (prefers-reduced-motion: reduce) {
    .epv-spinner {
        animation: none;
        border: 3px solid #0073aa;
    }
    
    .epv-scroll-hint {
        transition: none;
    }
    
    .epv-btn {
        transition: none;
    }
}