.mpv-pdf-wrapper {
    max-width: 100%;
    margin: 0 auto;
    background: white; 
    border-radius: 8px; 
    overflow: hidden;
    position: relative;
    line-height: 0;
}

.mpv-viewer {
    position: relative;
    width: 100%;
    min-height: 200px; 
    background-color: #f0f0f0; 
    display: flex;
    justify-content: center;
    align-items: flex-start; 
    padding: 0;
}

.mpv-canvas {
    display: block;
    width: 100% !important;
    height: auto !important;
    object-fit: contain;
}

/* Link is Z-Index 10 */
.mpv-overlay-link {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 10;
    cursor: pointer;
    background: transparent;
}

/* Layer to hold videos - Z-Index 15 */
.mpv-overlay-layer {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none; /* Let clicks pass through empty areas */
    z-index: 15;
}

/* Video Boxes - Pointer events must be auto to click play */
.mpv-video-container {
    pointer-events: auto;
    background: #000;
    box-shadow: 0 4px 10px rgba(0,0,0,0.3);
}

.mpv-controls {
    line-height: normal; 
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 15px 20px; 
    background-color: #f8f9fa; 
    border-top: 1px solid #e0e0e0;
    flex-wrap: wrap;
    gap: 10px;
}

.mpv-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    background: transparent;
    border: none;
    padding: 8px 12px;
    border-radius: 6px;
    cursor: pointer;
    font-size: 14px; 
    font-weight: 500; 
    color: #333;
    transition: all 0.2s ease;
}

.mpv-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.mpv-btn svg {
    width: 1.2em; 
    height: 1.2em;
    fill: currentColor;
}

.mpv-tts-btn {
    margin-left: 10px;
    background-color: #eef2f7;
    color: #2c3e50;
}

.mpv-tts-btn:hover {
    background-color: #dbe4ef;
}

@keyframes mpv-spin {
    from { transform: rotate(0deg); }
    to { transform: rotate(360deg); }
}

.mpv-icon-loading {
    animation: mpv-spin 1s linear infinite;
}

.mpv-page-indicator {
    font-size: 14px;
    color: #666;
    font-weight: 500;
    padding: 0 10px; 
    white-space: nowrap;
}

.mpv-pipe {
    width: 1px;
    height: 16px;
    background-color: #ddd;
    margin: 0 5px;
}

.mpv-loading {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    color: #666;
    font-weight: bold;
    font-size: 16px;
    width: 100%;
    text-align: center;
    padding: 20px;
    z-index: 5;
    line-height: normal;
}

.mpv-file-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr); 
    gap: 20px;
}

.mpv-file-card {
    display: flex;
    justify-content: space-between;
    align-items: center;
    background-color: #ffffff;
    border: 1px solid #e0e0e0;
    border-radius: 8px;
    padding: 15px 20px;
    text-decoration: none !important;
    transition: all 0.3s ease;
    cursor: pointer;
    box-shadow: 0 2px 4px rgba(0,0,0,0.02);
}

.mpv-file-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(0,0,0,0.08);
    border-color: #d0d0d0;
}

.mpv-file-info {
    flex: 1;
    padding-right: 15px;
}

.mpv-file-title {
    font-size: 16px;
    font-weight: 600;
    color: #333;
    margin-bottom: 5px;
    line-height: 1.4;
    text-overflow: ellipsis;
    overflow: hidden;
}

.mpv-file-meta {
    font-size: 13px;
    color: #888;
    font-weight: 400;
}

.mpv-download-icon {
    display: flex;
    justify-content: center;
    align-items: center;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background-color: #f0f4f8; 
    color: #0073e6; 
    flex-shrink: 0;
    transition: all 0.3s ease;
}

.mpv-download-icon svg {
    width: 20px;
    height: 20px;
    fill: currentColor;
}


.mpv-file-card:hover .mpv-download-icon {
    background-color: #003355; 
    color: #ffffff;
}