/* assets/file-preview.css */
.fp-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background: rgba(15, 23, 42, 0.85);
    /* dark slate */
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    z-index: 999999999;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s cubic-bezier(0.4, 0, 0.2, 1), visibility 0.3s;
    font-family: system-ui, -apple-system, sans-serif;
    box-sizing: border-box;
    font-size: 1.6rem;
}

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

.fp-modal {
    width: 90vw;
    height: 90vh;
    max-width: 1400px;
    background: #ffffff;
    border-radius: 12px;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.5);
    transform: scale(0.95) translateY(10px);
    transition: transform 0.4s cubic-bezier(0.16, 1, 0.3, 1);
}

.fp-overlay.fp-active .fp-modal {
    transform: scale(1) translateY(0);
}

.fp-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 16px 24px;
    background: #f8fafc;
    border-bottom: 1px solid #e2e8f0;
    flex-shrink: 0;
}

.fp-title {
    font-size: 1.125em;
    font-weight: 600;
    color: #0f172a;
    margin: 0;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 60vw;
}

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

.fp-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 8px 16px;
    border-radius: 8px;
    font-size: 0.875em;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s;
    text-decoration: none;
    border: none;
    font-family: inherit;
    box-sizing: border-box;
}

.fp-btn-download {
    background: #3b82f6;
    color: #ffffff;
    gap: 8px;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.1);
}

.fp-btn-download:hover {
    background: #2563eb;
    color: #fff;
    transform: translateY(-1px);
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
}

.fp-btn-close {
    background: #e2e8f0;
    color: #475569;
    width: 36px;
    height: 36px;
    padding: 0;
}

.fp-btn-close:hover {
    background: #cbd5e1;
    color: #0f172a;
}

.fp-body {
    flex: 1;
    position: relative;
    background: #f1f5f9;
    overflow: hidden;
    display: flex;
    flex-direction: column;
}

.fp-content {
    flex: 1;
    width: 100%;
    overflow: auto;
    position: relative;
}

/* Specific content styles */
.fp-pdf-container {
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 24px;
    padding-bottom: 100px;
    /* space for controls */
    min-height: 100%;
}

.fp-pdf-controls {
    position: absolute;
    bottom: 24px;
    left: 50%;
    transform: translateX(-50%);
    background: rgba(15, 23, 42, 0.85);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    padding: 8px 16px;
    border-radius: 9999px;
    display: flex;
    gap: 16px;
    align-items: center;
    color: white;
    box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.2);
    z-index: 10;
    transition: opacity 0.3s;
}

.fp-pdf-controls button {
    background: transparent;
    border: none;
    color: white;
    font-size: 1.1em;
    cursor: pointer;
    padding: 6px;
    border-radius: 6px;
    transition: background 0.2s;
    display: flex;
    align-items: center;
    justify-content: center;
}

.fp-pdf-controls button:hover {
    background: rgba(255, 255, 255, 0.2);
}

.fp-pdf-page-info {
    font-size: 0.875em;
    font-variant-numeric: tabular-nums;
    font-weight: 500;
    min-width: 60px;
    text-align: center;
}

.fp-table {
    width: 100%;
    border-collapse: collapse;
    background: white;
}

.fp-table th,
.fp-table td {
    border: 1px solid #e2e8f0;
    padding: 10px 14px;
    text-align: left;
    font-size: 0.875em;
}

.fp-table th {
    background: #f8fafc;
    font-weight: 600;
    color: #334155;
    position: sticky;
    top: 0;
    box-shadow: 0 1px 0 #e2e8f0;
    z-index: 2;
}

.fp-tree {
    list-style: none;
    padding: 24px;
    margin: 0;
    background: white;
    min-height: 100%;
}

.fp-tree li {
    margin: 4px 0;
    font-size: 0.95em;
    color: #334155;
}

.fp-tree-folder {
    cursor: pointer;
    font-weight: 500;
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 4px;
    border-radius: 4px;
    transition: background 0.2s;
}

.fp-tree-folder:hover {
    background: #f8fafc;
    color: #0f172a;
}

.fp-tree-file {
    display: flex;
    align-items: center;
    gap: 8px;
    color: #475569;
    padding: 4px;
}

.fp-tree-children {
    margin-left: 12px;
    border-left: 1px solid #e2e8f0;
    padding-left: 12px;
    overflow: hidden;
}

.fp-text-preview {
    padding: 24px;
    margin: 0;
    background: white;
    min-height: 100%;
    white-space: pre-wrap;
    font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
    font-size: 0.875em;
    line-height: 1.6;
    color: #334155;
    overflow-x: auto;
}

.fp-media-preview {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 100%;
    padding: 24px;
    background: #0f172a;
}

.fp-media-preview img,
.fp-media-preview video {
    max-width: 100%;
    max-height: 100%;
    border-radius: 8px;
    box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.4);
    object-fit: contain;
}

.fp-skeleton {
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, #f1f5f9 25%, #e2e8f0 50%, #f1f5f9 75%);
    background-size: 400% 100%;
    animation: fp-shimmer 1.5s infinite;
}

@keyframes fp-shimmer {
    0% {
        background-position: 200% 0;
    }

    100% {
        background-position: -200% 0;
    }
}

.fp-loader {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    height: 100%;
    min-height: 200px;
    color: #64748b;
    font-weight: 500;
    gap: 16px;
}

.fp-spinner {
    width: 40px;
    height: 40px;
    border: 4px solid #e2e8f0;
    border-top-color: #3b82f6;
    border-radius: 50%;
    animation: fp-spin 1s linear infinite;
}

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

.fp-pdf-canvas-wrapper {
    margin-bottom: 24px;
    background: white;
    box-shadow: 0 10px 25px -5px rgba(0, 0, 0, 0.1), 0 8px 10px -6px rgba(0, 0, 0, 0.1);
    border-radius: 4px;
    overflow: hidden;
}

.fp-message {
    padding: 40px;
    text-align: center;
    color: #64748b;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    height: 100%;
}

.fp-message h3 {
    margin-top: 0;
    color: #0f172a;
}

.fp-message.fp-error h3 {
    color: #ef4444;
}

.fp-nav-btn {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    background: rgba(15, 23, 42, 0.4);
    color: white;
    border: none;
    width: 48px;
    height: 48px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.2s;
    z-index: 50;
    backdrop-filter: blur(4px);
    -webkit-backdrop-filter: blur(4px);
}

.fp-nav-btn:hover {
    background: rgba(15, 23, 42, 0.8);
    transform: translateY(-50%) scale(1.1);
}

.fp-nav-prev {
    left: 16px;
}

.fp-nav-next {
    right: 16px;
}