/* resume-viewer.css - the full-screen PDF preview (assets/js/resume-viewer.js loads it when a preview opens) */

.rv {
    --rv-accent: #ff6a00;
    --rv-bar: rgba(22, 22, 24, 0.92);
    --rv-text: #f2f2f2;
    --rv-muted: rgba(255, 255, 255, 0.6);
    position: fixed;
    inset: 0;
    z-index: 100000;
    display: flex;
    flex-direction: column;
    background: rgba(10, 10, 12, 0.82);
    -webkit-backdrop-filter: blur(10px);
    backdrop-filter: blur(10px);
    color: var(--rv-text);
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
    font-size: 14px;
    line-height: 1.3;
    opacity: 0;
    transition: opacity 0.2s ease;
}

.rv.rv-in {
    opacity: 1;
}

html.rv-open,
html.rv-open body {
    overflow: hidden;
}

/* ---- toolbar ---- */
.rv-bar {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 16px;
    background: var(--rv-bar);
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
    box-shadow: 0 6px 24px rgba(0, 0, 0, 0.35);
    transform: translateY(-8px);
    transition: transform 0.25s ease;
}

.rv.rv-in .rv-bar {
    transform: none;
}

.rv-heading {
    flex: 1 1 auto;
    min-width: 0;
}

.rv-title {
    font-weight: 600;
    font-size: 15px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.rv-status {
    color: var(--rv-muted);
    font-size: 12px;
    margin-top: 2px;
    font-variant-numeric: tabular-nums;
}

.rv-tools,
.rv-actions {
    display: flex;
    align-items: center;
    gap: 6px;
    flex: 0 0 auto;
}

.rv-tools {
    padding: 3px;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.06);
}

.rv-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    height: 34px;
    min-width: 34px;
    padding: 0 12px;
    border: 0;
    border-radius: 999px;
    background: transparent;
    color: var(--rv-text);
    font: inherit;
    font-weight: 600;
    font-size: 13px;
    text-decoration: none;
    cursor: pointer;
    transition: background 0.15s ease, color 0.15s ease, opacity 0.15s ease;
}

.rv-btn:hover,
.rv-btn:focus-visible {
    background: rgba(255, 255, 255, 0.12);
    color: #fff;
    text-decoration: none;
}

.rv-btn:focus-visible {
    outline: 2px solid var(--rv-accent);
    outline-offset: 2px;
}

.rv-btn:disabled {
    opacity: 0.35;
    cursor: default;
    background: transparent;
}

.rv-btn svg {
    width: 18px;
    height: 18px;
    fill: none;
    stroke: currentColor;
    stroke-width: 2;
    stroke-linecap: round;
    stroke-linejoin: round;
}

.rv-icon {
    padding: 0;
}

.rv-zoom-label {
    min-width: 58px;
    padding: 0 8px;
    font-variant-numeric: tabular-nums;
}

.rv-zoom-label.rv-fit {
    color: var(--rv-accent);
}

.rv-download {
    border: 1px solid rgba(255, 255, 255, 0.22);
}

.rv-download.rv-primary {
    background: var(--rv-accent);
    border-color: var(--rv-accent);
    color: #fff;
}

.rv-download.rv-primary:hover,
.rv-download.rv-primary:focus-visible {
    background: #ff8126;
    color: #fff;
}

.rv-close {
    margin-left: 4px;
}

/* ---- pages ---- */
.rv-scroller {
    flex: 1 1 auto;
    overflow: auto;
    -webkit-overflow-scrolling: touch;
    overscroll-behavior: contain;
}

.rv-sheet {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 24px;
    min-width: min-content;
    padding: 32px 32px 48px;
}

.rv-page {
    position: relative;
    flex: 0 0 auto;
    background: #fff;
    border-radius: 3px;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.3), 0 18px 50px rgba(0, 0, 0, 0.45);
    overflow: hidden;
    transform: translateY(14px) scale(0.985);
    opacity: 0;
    transition: transform 0.35s cubic-bezier(0.2, 0.7, 0.2, 1), opacity 0.35s ease;
}

.rv.rv-in .rv-page {
    transform: none;
    opacity: 1;
}

.rv-page:not(.rv-drawn)::before {
    /* a soft shimmer while the page is drawn */
    content: "";
    position: absolute;
    inset: 0;
    background: linear-gradient(100deg, #f4f4f4 30%, #fbfbfb 50%, #f4f4f4 70%);
    background-size: 300% 100%;
    animation: rv-shimmer 1.3s linear infinite;
}

.rv-page canvas {
    display: block;
}

.rv-placeholder {
    width: min(612px, calc(100vw - 32px));
    aspect-ratio: 8.5 / 11;
    display: flex;
    align-items: center;
    justify-content: center;
}

.rv-spinner {
    position: relative;
    z-index: 1;
    width: 38px;
    height: 38px;
    border: 3px solid rgba(0, 0, 0, 0.1);
    border-top-color: var(--rv-accent);
    border-radius: 50%;
    animation: rv-spin 0.8s linear infinite;
}

/* The selectable text over each page (PDF.js text layer) */
.rv-text {
    position: absolute;
    inset: 0;
    overflow: hidden;
    line-height: 1;
    -webkit-text-size-adjust: none;
    text-size-adjust: none;
    forced-color-adjust: none;
    transform-origin: 0 0;
    z-index: 1;
}

.rv-text span,
.rv-text br {
    position: absolute;
    color: transparent;
    white-space: pre;
    cursor: text;
    transform-origin: 0% 0%;
}

.rv-text ::selection {
    background: rgba(255, 106, 0, 0.3);
}

.rv-text .endOfContent {
    display: block;
    position: absolute;
    inset: 100% 0 0;
    z-index: -1;
    cursor: default;
    user-select: none;
}

/* The PDF's own links, clickable over the text */
.rv-links {
    position: absolute;
    inset: 0;
    z-index: 2;
    pointer-events: none;
}

.rv-links a {
    position: absolute;
    pointer-events: auto;
    border-radius: 2px;
}

.rv-links a:hover,
.rv-links a:focus-visible {
    background: rgba(255, 106, 0, 0.14);
    box-shadow: 0 0 0 1px rgba(255, 106, 0, 0.5);
    outline: none;
}

/* When the preview can't be shown */
.rv-error {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 14px;
    margin-top: 12vh;
    padding: 28px 32px;
    max-width: 380px;
    border-radius: 12px;
    background: rgba(255, 255, 255, 0.06);
    text-align: center;
}

.rv-error > svg {
    width: 34px;
    height: 34px;
    fill: none;
    stroke: var(--rv-accent);
    stroke-width: 2;
    stroke-linecap: round;
}

.rv-error p {
    margin: 0;
    color: var(--rv-text);
}

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

@keyframes rv-shimmer {
    to { background-position: -300% 0; }
}

/* ---- phones ---- */
@media (max-width: 640px) {
    .rv-bar {
        flex-wrap: wrap;
        gap: 8px;
        padding: 8px 10px;
    }

    .rv-heading {
        order: 1;
        flex: 1 1 0;
    }

    .rv-actions {
        order: 2;
    }

    .rv-tools {
        order: 3;
        flex: 1 1 100%;
        justify-content: center;
        background: transparent;
    }

    .rv-download {
        padding: 0 10px;
    }

    .rv-sheet {
        padding: 12px 8px 32px;
        gap: 12px;
    }
}

@media (prefers-reduced-motion: reduce) {
    .rv,
    .rv-bar,
    .rv-page {
        transition: none;
    }

    .rv-page:not(.rv-drawn)::before,
    .rv-spinner {
        animation: none;
    }
}
