/* PDF Card */
.pdf-card {
    display: flex;
    align-items: flex-start;
    gap: 1rem;
    padding: 1rem 1.25rem;
    border: 1px solid var(--color-border, #e0e0e0);
    border-radius: 8px;
    background: var(--color-surface, #fff);
    margin: 1rem 0;
    transition: box-shadow 0.15s;
}

.pdf-card:hover {
    box-shadow: 0 2px 8px rgba(0,0,0,0.08);
}

.pdf-card__icon {
    flex-shrink: 0;
    color: #e74c3c;
    padding-top: 2px;
}

.pdf-card__info {
    flex: 1;
    min-width: 0;
}

.pdf-card__label {
    font-family: var(--font-body, sans-serif);
    font-weight: 600;
    font-size: 0.9375rem;
    color: var(--color-text, #333);
    margin-bottom: 2px;
}

.pdf-card__name {
    font-family: var(--font-body, sans-serif);
    font-size: 0.8125rem;
    color: var(--color-text-muted, #777);
    word-break: break-all;
}

.pdf-card__size {
    font-size: 0.75rem;
    color: var(--color-text-muted, #999);
}

.pdf-card__actions {
    display: flex;
    gap: 0.75rem;
    margin-top: 0.625rem;
}

.pdf-card__btn {
    display: inline-flex;
    align-items: center;
    gap: 0.375rem;
    font-family: var(--font-body, sans-serif);
    font-size: 0.8125rem;
    font-weight: 500;
    padding: 0.375rem 0.75rem;
    border-radius: 5px;
    cursor: pointer;
    transition: background 0.15s, color 0.15s;
    text-decoration: none;
    border: 1px solid transparent;
}

.pdf-card__btn svg { flex-shrink: 0; }

.pdf-card__btn--view {
    background: var(--color-heading-blue, #5396FB);
    color: #fff;
    border-color: var(--color-heading-blue, #5396FB);
}

.pdf-card__btn--view:hover {
    background: #3a7bd5;
    border-color: #3a7bd5;
}

.pdf-card__btn--download {
    background: transparent;
    color: var(--color-heading-blue, #5396FB);
    border-color: var(--color-border, #d0d0d0);
}

.pdf-card__btn--download:hover {
    background: rgba(83,150,251,0.06);
    border-color: var(--color-heading-blue, #5396FB);
}

/* ---- Lightbox ---- */
.pdf-lightbox {
    position: fixed;
    inset: 0;
    z-index: 100000;
}

.pdf-lightbox__backdrop {
    position: absolute;
    inset: 0;
    background: rgba(0,0,0,0.6);
}

.pdf-lightbox__container {
    position: absolute;
    top: 3vh;
    left: 3vw;
    right: 3vw;
    bottom: 3vh;
    background: #fff;
    border-radius: 10px;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    box-shadow: 0 8px 32px rgba(0,0,0,0.3);
    z-index: 1;
}

.pdf-lightbox__header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0.625rem 1rem;
    border-bottom: 1px solid #e0e0e0;
    flex-shrink: 0;
}

.pdf-lightbox__title {
    font: 600 0.9375rem/1.3 var(--font-body, sans-serif);
    color: #333;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.pdf-lightbox__close {
    width: 32px;
    height: 32px;
    border: none;
    background: none;
    font-size: 24px;
    color: #888;
    cursor: pointer;
    border-radius: 4px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    transition: background 0.15s, color 0.15s;
}

.pdf-lightbox__close:hover {
    background: #f0f0f0;
    color: #333;
}

.pdf-lightbox__body {
    flex: 1;
    position: relative;
    min-height: 0;
}

.pdf-lightbox__loading {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    font: 14px/1.5 var(--font-body, sans-serif);
    color: #888;
    text-align: center;
    width: 200px;
}

.pdf-lightbox__progress {
    margin-top: 12px;
    height: 3px;
    background: #e0e0e0;
    border-radius: 3px;
    overflow: hidden;
}

.pdf-lightbox__progress-bar {
    height: 100%;
    width: 40%;
    background: var(--color-heading-blue, #5396FB);
    border-radius: 3px;
    animation: pdf-progress 1.4s ease-in-out infinite;
}

@keyframes pdf-progress {
    0%   { transform: translateX(-100%); }
    100% { transform: translateX(350%); }
}

.pdf-lightbox__iframe {
    width: 100%;
    height: 100%;
    border: none;
}

/* ---- Dark theme ---- */
html[data-theme="dark"] .pdf-card {
    background: #1e2530;
    border-color: #3a3f4a;
}
html[data-theme="dark"] .pdf-card__label { color: #dde4ec; }
html[data-theme="dark"] .pdf-card__name { color: #8898aa; }
html[data-theme="dark"] .pdf-card__btn--view {
    background: #3a7bd5;
    border-color: #3a7bd5;
}
html[data-theme="dark"] .pdf-card__btn--download {
    color: #7ab8ff;
    border-color: #3a3f4a;
}
html[data-theme="dark"] .pdf-lightbox__container {
    background: #1e2530;
}
html[data-theme="dark"] .pdf-lightbox__header {
    border-color: #3a3f4a;
}
html[data-theme="dark"] .pdf-lightbox__title { color: #dde4ec; }
html[data-theme="dark"] .pdf-lightbox__close { color: #8898aa; }
html[data-theme="dark"] .pdf-lightbox__close:hover { background: #252c38; color: #dde4ec; }

/* ---- Dim theme ---- */
html[data-theme="dim"] .pdf-card {
    background: #f0e8d8;
    border-color: #c8c0b0;
}
html[data-theme="dim"] .pdf-card__label { color: #3a3020; }
html[data-theme="dim"] .pdf-card__btn--view {
    background: #4a7fc7;
    border-color: #4a7fc7;
}
html[data-theme="dim"] .pdf-card__btn--download {
    color: #4a7fc7;
    border-color: #c8c0b0;
}

/* ---- Editor ---- */
.pdf-preview-block {
    border: 1px dashed #ccc;
    border-radius: 8px;
    padding: 12px;
    background: #fafafa;
}

.pdf-preview-block__card {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 12px;
    border: 1px solid #ddd;
    border-radius: 6px;
    background: #fff;
}

.pdf-preview-block__icon {
    flex-shrink: 0;
    color: #e74c3c;
}

.pdf-preview-block__icon .dashicons {
    font-size: 32px;
    width: 32px;
    height: 32px;
}

.pdf-preview-block__info {
    flex: 1;
    min-width: 0;
}

.pdf-preview-block__title {
    font-weight: 600;
    font-size: 14px;
    color: #333;
}

.pdf-preview-block__name {
    font-size: 12px;
    color: #888;
    word-break: break-all;
}

.pdf-preview-block__actions {
    font-size: 12px;
    color: #5396FB;
    margin-top: 4px;
}

.pdf-preview-block__placeholder {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    min-height: 120px;
    background: #f0f0f0;
    border-radius: 8px;
    color: #888;
    cursor: pointer;
    transition: background 0.15s;
}

.pdf-preview-block__placeholder:hover {
    background: #e8e8e8;
}

.pdf-preview-block__placeholder .dashicons {
    font-size: 36px;
    width: 36px;
    height: 36px;
    margin-bottom: 8px;
    color: #e74c3c;
}
