.pdf-viewer-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    margin-top: 60px;
    background: linear-gradient(135deg, rgba(0, 0, 0, 0.8), rgba(0, 0, 0, 0.6));
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 1000;
    opacity: 0;
    font-family: Arial, Helvetica, sans-serif;
    visibility: hidden;
    transition: opacity 0.3s ease, visibility 0.3s ease;
}

.pdf-viewer-overlay[style*="display: flex"] {
    opacity: 1;
    visibility: visible;
}

.pdf-viewer-container {
    background: #ffffff;
    border-radius: 24px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3), 0 8px 20px rgba(0, 0, 0, 0.2);
    position: relative;
    width: 95%;
    max-width: 1200px;
    height: 750px;
    margin-bottom: 60px;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    transform: scale(0.9);
    transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    border: 3px solid white;
}

/* ANIMATION like the Calendar modal */
.pdf-viewer-overlay[style*="display: flex"] .pdf-viewer-container {
    animation: fadePop 0.25s ease forwards;
}

/***********************************/
/* 💀💀💀 Just work goddammit 💀💀💀 */
/***********************************/

/* PDF Viewer Header */
.pdf-viewer-header {
    background: #03508c;
    padding: 16px 24px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-radius: 24px 24px 0 0;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
}

.pdf-viewer-title {
    color: white;
    font-size: 18px;
    font-weight: 600;
    margin: 0;
    flex: 1;
    text-overflow: ellipsis;
    overflow: hidden;
    white-space: nowrap;
    margin-right: 20px;
}

.pdf-viewer-actions {
    display: flex;
    gap: 12px;
    align-items: center;
}

.pdf-download-btn {
    background: rgba(255, 255, 255, 0.2);
    color: white;
    border-radius: 12px;
    padding: 8px 16px;
    font-size: 18px;
    font-weight: 500;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 8px;
    transition: all 0.2s ease;
    text-decoration: none;
}

.pdf-download-btn:hover {
    background: rgba(255, 255, 255, 0.3);
    border-color: rgba(255, 255, 255, 0.5);
}

.pdf-download-btn:active {
    transform: translateY(0);
}

.pdf-viewer-close {
    background: rgba(255, 255, 255, 0.2);
    color: white;
    border-radius: 12px;
    width: 40px;
    height: 40px;
    font-size: 20px;
    line-height: 1;
    cursor: pointer;
    display: flex;
    justify-content: center;
    align-items: center;
    transition: all 0.2s ease;
}

.pdf-viewer-close:hover {
    background: rgba(255, 255, 255, 0.3);
    border-color: rgba(255, 255, 255, 0.5);
}

.pdf-viewer-close:active {
    transform: translateY(0);
}

/* PDF Content Area */
.pdf-content-area {
    flex: 1;
    position: relative;
    background: #f8f9fa;
    overflow: hidden;
}

.pdf-viewer-iframe {
    width: 100%;
    height: 100%;
    border: none;
    background: white;
}

/* Loading indicator styles */
.pdf-loading {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    text-align: center;
    z-index: 1002;
}

.loading-spinner {
    width: 60px;
    height: 60px;
    border: 4px solid #e3f2fd;
    border-top: 4px solid #2196f3;
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin: 0 auto 24px;
}

.pdf-loading p {
    font-size: 16px;
    color: #666;
    margin: 0;
    font-weight: 500;
}

/* Error message styles */
.pdf-error {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    text-align: center;
    z-index: 1002;
    background: white;
    padding: 40px;
    border-radius: 16px;
    box-shadow: 0 8px 30px rgba(0, 0, 0, 0.15);
    max-width: 400px;
    width: 90%;
    border: 1px solid #e0e0e0;
}

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

.pdf-error h3 {
    color: #333;
    margin: 0 0 12px 0;
    font-size: 20px;
    font-weight: 600;
}

.pdf-error p {
    font-size: 14px;
    color: #666;
    margin: 0 0 24px 0;
    line-height: 1.5;
}

.pdf-error-actions {
    display: flex;
    gap: 12px;
    justify-content: center;
    flex-wrap: wrap;
}

.retry-btn {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border: none;
    padding: 12px 24px;
    border-radius: 8px;
    cursor: pointer;
    font-size: 14px;
    font-weight: 500;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    gap: 8px;
}

.retry-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 15px rgba(102, 126, 234, 0.4);
}

.download-link {
    color: #667eea;
    text-decoration: none;
    font-size: 14px;
    font-weight: 500;
    padding: 12px 24px;
    border: 2px solid #667eea;
    border-radius: 8px;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    transition: all 0.2s ease;
}

.download-link:hover {
    background: #667eea;
    color: white;
    transform: translateY(-2px);
}

/* Download and close button icons */

.retry-btn::before {
    content: "↻";
    font-size: 16px;
}

.download-link::before {
    content: "📄";
    font-size: 16px;
}

/* Responsive adjustments */
@media (max-width: 768px) {
    .pdf-viewer-container {
        width: 98%;
        height: 600px;
        border-radius: 16px;
    }
    
    .pdf-viewer-header {
        padding: 12px 16px;
        border-radius: 16px 16px 0 0;
    }
    
    .pdf-viewer-title {
        font-size: 16px;
        margin-right: 12px;
    }
    
    .pdf-viewer-actions {
        gap: 8px;
    }
    
    .pdf-download-btn {
        padding: 6px 12px;
        font-size: 12px;
    }
    
    .pdf-viewer-close {
        width: 40px;
        height: 40px;
        font-size: 24px;
    }
    
    .pdf-loading p {
        font-size: 14px;
    }
    
    .pdf-error {
        padding: 24px;
        max-width: 320px;
    }
    
    .pdf-error-actions {
        flex-direction: column;
    }
    
    .retry-btn, .download-link {
        width: 100%;
        justify-content: center;
    }
}

@media (max-width: 480px) {
    .pdf-viewer-header {
        padding: 10px 12px;
    }
    
    .pdf-viewer-title {
        font-size: 14px;
    }
    
    .pdf-download-btn {
        padding: 4px 8px;
        font-size: 14px;
    }
    
    .pdf-viewer-close {
        width: 33px;
        height: 33px;
        font-size: 20px;
    }
}