/* ============================================================
   IEP File Share — Preview Modal Styles
   ============================================================ */

/* ── Overlay ─────────────────────────────────────────────── */
.iep-fs-preview-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, .82);
    z-index: 99999;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 16px;
    box-sizing: border-box;
    backdrop-filter: blur(4px);
    animation: iep-preview-fade-in .18s ease;
}
@keyframes iep-preview-fade-in {
    from { opacity: 0; }
    to   { opacity: 1; }
}

/* ── Modal shell ─────────────────────────────────────────── */
.iep-fs-preview-modal {
    background: #fff;
    border-radius: 10px;
    width: 100%;
    max-width: 960px;
    max-height: 92vh;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    box-shadow: 0 24px 80px rgba(0,0,0,.5);
    animation: iep-preview-slide-up .2s ease;
}
@keyframes iep-preview-slide-up {
    from { transform: translateY(24px); opacity: 0; }
    to   { transform: translateY(0);    opacity: 1; }
}

/* ── Header ──────────────────────────────────────────────── */
.iep-fs-preview-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    background: #1a1a2e;
    color: #fff;
    padding: 14px 20px;
    flex-shrink: 0;
}
.iep-fs-preview-title-wrap {
    display: flex;
    align-items: center;
    gap: 14px;
    min-width: 0;
}
.iep-fs-preview-icon   { font-size: 28px; flex-shrink: 0; }
.iep-fs-preview-title  { margin: 0; font-size: 15px; font-weight: 700; color: #fff; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 480px; }
.iep-fs-preview-meta   { font-size: 12px; color: rgba(255,255,255,.5); }

.iep-fs-preview-header-actions { display: flex; align-items: center; gap: 10px; flex-shrink: 0; }

.iep-fs-preview-dl-btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    background: #c9a84c;
    color: #1a1a2e;
    border-radius: 5px;
    padding: 7px 14px;
    font-size: 13px;
    font-weight: 700;
    text-decoration: none;
    transition: opacity .2s;
    white-space: nowrap;
}
.iep-fs-preview-dl-btn:hover { opacity: .85; color: #1a1a2e; }

.iep-fs-preview-close {
    background: rgba(255,255,255,.1);
    border: none;
    color: #fff;
    font-size: 18px;
    width: 34px; height: 34px;
    border-radius: 50%;
    cursor: pointer;
    display: flex; align-items: center; justify-content: center;
    transition: background .2s;
    flex-shrink: 0;
}
.iep-fs-preview-close:hover { background: rgba(255,255,255,.25); }

/* ── Body ────────────────────────────────────────────────── */
.iep-fs-preview-body {
    flex: 1;
    overflow: hidden;
    background: #1a1a1a;
    position: relative;
    min-height: 200px;
}

/* Loading */
.iep-fs-preview-spinner-wrap {
    position: absolute;
    inset: 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 14px;
    color: rgba(255,255,255,.5);
    font-size: 14px;
}
.iep-fs-preview-spinner {
    width: 36px; height: 36px;
    border: 3px solid rgba(255,255,255,.15);
    border-top-color: #c9a84c;
    border-radius: 50%;
    animation: iep-fs-spin .8s linear infinite;
}

/* ── PDF iframe ──────────────────────────────────────────── */
.iep-fs-preview-pdf {
    width: 100%;
    height: 70vh;
    border: none;
    display: block;
}

/* ── Image viewer ────────────────────────────────────────── */
.iep-fs-preview-image-wrap {
    width: 100%;
    height: 70vh;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    cursor: zoom-in;
    background: #111;
    position: relative;
}
.iep-fs-preview-image-wrap.zoomed { cursor: zoom-out; }
.iep-fs-preview-img {
    max-width: 100%;
    max-height: 100%;
    object-fit: contain;
    transition: transform .25s ease;
    user-select: none;
    border-radius: 2px;
}
.iep-fs-preview-image-wrap.zoomed .iep-fs-preview-img { transform: scale(2); }
.iep-fs-preview-zoom-hint {
    position: absolute;
    bottom: 12px; right: 12px;
    background: rgba(0,0,0,.55);
    color: rgba(255,255,255,.7);
    font-size: 11px;
    padding: 4px 10px;
    border-radius: 20px;
    pointer-events: none;
}

/* ── Audio player ────────────────────────────────────────── */
.iep-fs-preview-audio-wrap {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 48px 32px;
    gap: 24px;
    background: linear-gradient(135deg, #1a1a2e 0%, #12122a 100%);
    min-height: 280px;
}
.iep-fs-preview-audio-art {
    width: 120px; height: 120px;
    background: rgba(201,168,76,.15);
    border: 2px solid rgba(201,168,76,.3);
    border-radius: 50%;
    display: flex; align-items: center; justify-content: center;
    font-size: 52px;
    animation: iep-audio-pulse 3s ease-in-out infinite;
}
@keyframes iep-audio-pulse {
    0%, 100% { box-shadow: 0 0 0 0 rgba(201,168,76,.3); }
    50%       { box-shadow: 0 0 0 18px rgba(201,168,76,0); }
}
.iep-fs-preview-audio-wrap.playing .iep-fs-preview-audio-art {
    animation: iep-audio-pulse 1.4s ease-in-out infinite;
}
.iep-fs-preview-audio-title {
    color: #fff;
    font-size: 18px;
    font-weight: 700;
    text-align: center;
    max-width: 460px;
}
.iep-fs-preview-audio-wrap audio {
    width: 100%;
    max-width: 480px;
    accent-color: #c9a84c;
}

/* ── Video player ────────────────────────────────────────── */
.iep-fs-preview-video {
    width: 100%;
    max-height: 70vh;
    background: #000;
    display: block;
}

/* ── Text viewer ─────────────────────────────────────────── */
.iep-fs-preview-text-wrap {
    height: 70vh;
    overflow-y: auto;
    background: #1e1e2e;
    position: relative;
}
.iep-fs-preview-text-wrap::-webkit-scrollbar { width: 8px; }
.iep-fs-preview-text-wrap::-webkit-scrollbar-thumb { background: rgba(255,255,255,.15); border-radius: 4px; }
.iep-fs-preview-text-toolbar {
    position: sticky;
    top: 0;
    background: #13131f;
    border-bottom: 1px solid rgba(255,255,255,.08);
    padding: 8px 16px;
    display: flex;
    align-items: center;
    gap: 10px;
    z-index: 2;
}
.iep-fs-preview-text-toolbar span {
    font-size: 12px;
    color: rgba(255,255,255,.4);
}
.iep-fs-preview-copy-btn {
    margin-left: auto;
    background: rgba(255,255,255,.08);
    border: 1px solid rgba(255,255,255,.15);
    color: rgba(255,255,255,.7);
    border-radius: 4px;
    padding: 4px 12px;
    font-size: 12px;
    cursor: pointer;
    transition: background .2s;
}
.iep-fs-preview-copy-btn:hover { background: rgba(255,255,255,.15); }
.iep-fs-preview-text-content {
    margin: 0;
    padding: 20px 24px;
    font-family: 'Fira Code', 'Cascadia Code', 'Consolas', 'Monaco', monospace;
    font-size: 13px;
    line-height: 1.7;
    color: #cdd6f4;
    white-space: pre-wrap;
    word-break: break-all;
    tab-size: 4;
}
.iep-fs-text-truncated-notice {
    background: rgba(201,168,76,.12);
    border: 1px solid rgba(201,168,76,.25);
    color: #c9a84c;
    font-size: 12px;
    padding: 10px 24px;
    text-align: center;
}

/* ── "No preview" fallback ───────────────────────────────── */
.iep-fs-preview-no-preview {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 16px;
    padding: 60px 32px;
    min-height: 280px;
    text-align: center;
}
.iep-fs-preview-no-icon    { font-size: 64px; }
.iep-fs-preview-no-label   { color: rgba(255,255,255,.8); font-size: 18px; font-weight: 700; }
.iep-fs-preview-no-sub     { color: rgba(255,255,255,.4); font-size: 14px; max-width: 340px; line-height: 1.5; }
.iep-fs-preview-no-dl-btn  {
    background: #c9a84c; color: #1a1a2e;
    border: none; border-radius: 6px;
    padding: 12px 28px; font-size: 15px; font-weight: 700;
    cursor: pointer; text-decoration: none;
    margin-top: 8px; transition: opacity .2s;
    display: inline-flex; align-items: center; gap: 8px;
}
.iep-fs-preview-no-dl-btn:hover { opacity: .85; color: #1a1a2e; }

/* File info grid in no-preview / footer */
.iep-fs-preview-info-grid {
    display: flex;
    gap: 24px;
    flex-wrap: wrap;
    justify-content: center;
}
.iep-fs-preview-info-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
}
.iep-fs-preview-info-label { font-size: 11px; color: rgba(255,255,255,.35); text-transform: uppercase; letter-spacing: .5px; }
.iep-fs-preview-info-val   { font-size: 14px; color: rgba(255,255,255,.8); font-weight: 600; }

/* ── Footer ──────────────────────────────────────────────── */
.iep-fs-preview-footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    background: #f5f4f0;
    border-top: 1px solid #e0ddd5;
    padding: 10px 20px;
    flex-shrink: 0;
    gap: 16px;
}
.iep-fs-preview-stats {
    display: flex;
    gap: 20px;
    font-size: 13px;
    color: #666;
    flex-wrap: wrap;
}
.iep-fs-preview-stats span { display: flex; align-items: center; gap: 5px; }
.iep-fs-preview-footer .iep-fs-upvote-btn {
    flex-direction: row;
    gap: 8px;
    padding: 7px 16px;
    margin-bottom: 0;
    background: #fff;
}

/* ── Preview button on cards ─────────────────────────────── */
.iep-fs-preview-btn {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
    background: transparent;
    border: 1px solid #e0ddd5;
    border-radius: 6px;
    padding: 7px 10px;
    cursor: pointer;
    font-size: 11px;
    font-weight: 600;
    color: #555;
    transition: all .2s;
    white-space: nowrap;
}
.iep-fs-preview-btn:hover {
    background: #1a1a2e;
    border-color: #1a1a2e;
    color: #fff;
}
.iep-fs-preview-btn .iep-fs-preview-btn-icon { font-size: 16px; }
.iep-fs-no-preview-btn { opacity: .45; cursor: default; }
.iep-fs-no-preview-btn:hover { background: transparent; border-color: #e0ddd5; color: #555; }

/* Updated card action column to hold 3 items */
.iep-fs-card-action {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 6px;
    min-width: 80px;
}

/* ── Responsive ──────────────────────────────────────────── */
@media (max-width: 640px) {
    .iep-fs-preview-modal { max-height: 100vh; border-radius: 0; }
    .iep-fs-preview-overlay { padding: 0; }
    .iep-fs-preview-pdf, .iep-fs-preview-text-wrap, .iep-fs-preview-image-wrap { height: 55vh; }
    .iep-fs-preview-title { max-width: 180px; font-size: 13px; }
    .iep-fs-preview-stats { gap: 12px; font-size: 12px; }
}
