/* --- File Detail Page --- */

/* Page container */
.file-page-container {
    position: relative;
    z-index: 1;
    max-width: 760px;
    margin: 0 auto;
    padding: 32px 24px 60px;
}

/* Back link */
.back-link {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-size: 14px;
    color: var(--text-muted);
    text-decoration: none;
    margin-bottom: 20px;
    transition: color var(--transition);
}
.back-link svg {
    width: 16px;
    height: 16px;
}
.back-link:hover {
    color: var(--blue-400);
}

/* ── Notices ── */
.notice {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 24px 28px;
    margin-bottom: 20px;
    text-align: center;
}
.notice h3 {
    font-size: 17px;
    color: var(--text-primary);
    margin-bottom: 8px;
}
.notice p {
    font-size: 14px;
    color: var(--text-muted);
    line-height: 1.6;
    margin: 0;
}

.notice-quarantine {
    border-color: rgba(245, 158, 11, 0.5);
    background: rgba(245, 158, 11, 0.06);
}
.notice-quarantine h3 { color: var(--warning); }
.scanning-icon,
.malware-icon {
    font-size: 36px;
    margin-bottom: 10px;
}
.refresh-hint {
    margin-top: 12px !important;
    font-size: 13px !important;
    font-style: italic;
}

.notice-malware {
    border-color: rgba(239, 68, 68, 0.5);
    background: rgba(239, 68, 68, 0.06);
}
.notice-malware h3 { color: var(--danger); }

.notice-frozen {
    border-color: rgba(59, 130, 246, 0.5);
    background: rgba(59, 130, 246, 0.06);
}
.notice-frozen h3 { color: var(--blue-400); }

.notice-temp {
    border-color: rgba(245, 158, 11, 0.5);
    background: rgba(245, 158, 11, 0.06);
}
.notice-temp h3 { color: var(--warning); }
.countdown {
    font-size: 20px !important;
    font-weight: 700;
    color: var(--warning) !important;
    margin-top: 8px !important;
    font-variant-numeric: tabular-nums;
}

.notice-takedown {
    background: rgba(239, 68, 68, 0.06);
    border: 1px solid rgba(239, 68, 68, 0.3);
    border-radius: var(--radius-sm);
    padding: 18px 20px;
    margin-bottom: 20px;
    text-align: left;
}
.notice-takedown h3 {
    color: var(--danger);
    font-size: 15px;
    margin-bottom: 6px;
}
.notice-takedown p {
    font-size: 14px;
    color: var(--text-muted);
    line-height: 1.6;
}
.takedown-reason {
    margin-top: 12px;
    padding-top: 12px;
    border-top: 1px solid rgba(239, 68, 68, 0.2);
    font-size: 14px;
    color: var(--text-secondary);
}

/* ── Shared card ── */
.file-card,
.preview-card,
.details-card,
.file-detail-card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 28px;
    position: relative;
    overflow: hidden;
    margin-bottom: 20px;
}
.file-card::before {
    content: '';
    position: absolute;
    top: 0; left: 0; right: 0;
    height: 2px;
    background: linear-gradient(90deg, transparent, var(--blue-500), transparent);
}
.file-detail-card {
    padding: 40px;
}
.file-detail-card h2 {
    font-size: 20px;
    color: var(--text-primary);
    margin-bottom: 16px;
}

/* ── File head ── */
.file-head {
    display: flex;
    align-items: flex-start;
    gap: 18px;
    margin-bottom: 22px;
}
.file-kind {
    width: 56px;
    height: 56px;
    border-radius: 14px;
    background: rgba(59, 130, 246, 0.12);
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}
.file-kind svg {
    width: 26px;
    height: 26px;
    color: var(--blue-400);
}
.file-kind-image  { background: rgba(16, 185, 129, 0.12); }
.file-kind-image svg { color: #34d399; }
.file-kind-video  { background: rgba(168, 85, 247, 0.14); }
.file-kind-video svg { color: #c084fc; }
.file-kind-audio  { background: rgba(236, 72, 153, 0.14); }
.file-kind-audio svg { color: #f472b6; }
.file-kind-pdf    { background: rgba(239, 68, 68, 0.12); }
.file-kind-pdf svg { color: #f87171; }
.file-kind-archive { background: rgba(245, 158, 11, 0.12); }
.file-kind-archive svg { color: #fbbf24; }

.file-head-text {
    flex: 1;
    min-width: 0;
}
.file-title {
    font-size: 22px;
    font-weight: 700;
    letter-spacing: -0.02em;
    line-height: 1.25;
    color: var(--text-primary);
    margin-bottom: 8px;
    overflow-wrap: anywhere;
}
.file-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 6px 14px;
    font-size: 13px;
    color: var(--text-muted);
}
.file-meta span {
    display: inline-flex;
    align-items: center;
    gap: 6px;
}
.file-meta span + span::before {
    content: '';
    width: 3px;
    height: 3px;
    border-radius: 50%;
    background: var(--border);
}

/* ── File actions ── */
.file-actions {
    display: flex;
    align-items: center;
    gap: 12px;
    flex-wrap: wrap;
}

.btn-download {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    padding: 14px 32px;
    border-radius: var(--radius-sm);
    font-size: 15px;
    font-weight: 600;
    color: #fff;
    background: linear-gradient(135deg, var(--blue-600), var(--blue-700));
    border: none;
    cursor: pointer;
    transition: all 0.3s;
    text-decoration: none;
    font-family: var(--font-family);
    white-space: nowrap;
}
.btn-download:hover {
    background: linear-gradient(135deg, var(--blue-500), var(--blue-600));
    box-shadow: 0 4px 24px var(--blue-glow);
    transform: translateY(-2px);
    color: #fff;
}
.btn-download:active { transform: translateY(0); }
.btn-download svg { width: 18px; height: 18px; }

.btn-view {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 13px 22px;
    border-radius: var(--radius-sm);
    font-size: 14px;
    font-weight: 500;
    color: var(--text-primary);
    background: var(--bg-elevated);
    border: 1px solid var(--border);
    cursor: pointer;
    transition: all 0.2s;
    text-decoration: none;
    font-family: var(--font-family);
    white-space: nowrap;
}
.btn-view:hover {
    background: var(--bg-card-hover);
    border-color: var(--blue-500);
    color: var(--blue-400);
}
.btn-view svg { width: 16px; height: 16px; }

.status-badge {
    display: inline-flex;
    align-items: center;
    padding: 8px 18px;
    border-radius: var(--radius-xs);
    font-size: 13px;
    font-weight: 600;
    letter-spacing: 0.02em;
}
.status-badge-scanning {
    background: rgba(245, 158, 11, 0.12);
    color: var(--warning);
    border: 1px solid rgba(245, 158, 11, 0.3);
}
.status-badge-malware {
    background: rgba(239, 68, 68, 0.12);
    color: var(--danger);
    border: 1px solid rgba(239, 68, 68, 0.3);
}
.status-badge-review {
    background: rgba(59, 130, 246, 0.12);
    color: var(--blue-400);
    border: 1px solid rgba(59, 130, 246, 0.3);
}

/* ── Share box ── */
.share-box {
    margin-top: 22px;
    padding-top: 22px;
    border-top: 1px solid var(--border);
}
.share-label {
    display: block;
    font-size: 12px;
    font-weight: 600;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    color: var(--text-muted);
    margin-bottom: 10px;
}
.share-row {
    display: flex;
    gap: 8px;
    align-items: stretch;
}
.share-input {
    flex: 1;
    min-width: 0;
    padding: 11px 14px;
    background: var(--bg-body);
    border: 1px solid var(--border);
    border-radius: var(--radius-xs);
    color: var(--text-primary);
    font-size: 14px;
    font-family: var(--font-family);
    outline: none;
}
.share-input:focus {
    border-color: var(--blue-500);
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.15);
}
.btn-copy,
.btn-qr-toggle {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    padding: 0 16px;
    border-radius: var(--radius-xs);
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    font-family: var(--font-family);
    transition: all var(--transition);
    white-space: nowrap;
}
.btn-copy {
    color: #fff;
    background: var(--blue-600);
    border: 1px solid transparent;
}
.btn-copy:hover {
    background: var(--blue-500);
    box-shadow: 0 0 20px var(--blue-glow);
}
.btn-copy.is-copied {
    background: rgba(16, 185, 129, 0.2);
    border-color: rgba(16, 185, 129, 0.4);
    color: #6ee7b7;
    box-shadow: none;
}
.btn-qr-toggle {
    color: var(--text-secondary);
    background: transparent;
    border: 1px solid var(--border);
}
.btn-qr-toggle:hover,
.btn-qr-toggle[aria-expanded="true"] {
    color: var(--text-primary);
    border-color: var(--text-muted);
    background: rgba(255, 255, 255, 0.04);
}
.btn-copy svg,
.btn-qr-toggle svg {
    width: 16px;
    height: 16px;
}

.qr-panel {
    display: flex;
    align-items: center;
    gap: 20px;
    margin-top: 14px;
    padding: 16px;
    background: var(--bg-body);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
}
.qr-panel[hidden] { display: none; }
.qr-image-wrapper {
    display: inline-block;
    padding: 8px;
    background: #fff;
    border-radius: var(--radius-xs);
    flex-shrink: 0;
}
.qr-image-wrapper img {
    display: block;
    width: 128px;
    height: 128px;
}
.qr-panel-text strong {
    display: block;
    font-size: 14px;
    color: var(--text-primary);
    margin-bottom: 4px;
}
.qr-panel-text p {
    font-size: 13px;
    color: var(--text-muted);
    margin-bottom: 12px;
}
.btn-qr-download {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 8px 16px;
    border-radius: var(--radius-xs);
    font-size: 13px;
    font-weight: 500;
    color: var(--text-primary);
    background: var(--bg-elevated);
    border: 1px solid var(--border);
    cursor: pointer;
    transition: all 0.2s;
    text-decoration: none;
    font-family: var(--font-family);
}
.btn-qr-download:hover {
    background: var(--bg-card-hover);
    border-color: var(--blue-500);
    color: var(--blue-400);
}

/* ── Preview ── */
.preview-card h2,
.details-card h2 {
    font-size: 13px;
    font-weight: 600;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    color: var(--text-muted);
    margin-bottom: 16px;
}
.preview-card img {
    width: 100%;
    height: auto;
    display: block;
    border-radius: var(--radius-sm);
    background: var(--bg-body);
}
.preview-card video {
    width: 100%;
    display: block;
    border-radius: var(--radius-sm);
    background: #000;
}

.audio-player-wrapper { width: 100%; }
.audio-player-wrapper audio {
    width: 100%;
    outline: none;
}
.audio-visualization {
    position: relative;
    margin-top: 12px;
    background: var(--bg-body);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    overflow: hidden;
}
.audio-visualization canvas {
    display: block;
    width: 100%;
    height: 80px;
}
.audio-progress {
    position: absolute;
    bottom: 0;
    left: 0;
    height: 3px;
    background: linear-gradient(90deg, var(--blue-600), var(--blue-400));
    transition: width 0.1s linear;
}

/* ── Details ── */
.details-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 14px 20px;
    margin: 0;
}
.details-grid > div {
    min-width: 0;
}
.details-grid dt {
    font-size: 12px;
    color: var(--text-muted);
    margin-bottom: 3px;
}
.details-grid dd {
    font-size: 14px;
    font-weight: 500;
    color: var(--text-primary);
    margin: 0;
    overflow-wrap: anywhere;
}
.details-grid dd code {
    font-size: 13px;
}

/* ── Report ── */
.report-section {
    text-align: center;
    margin: 4px 0 20px;
}
.report-link {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-size: 13px;
    color: var(--text-muted);
    text-decoration: none;
    transition: color var(--transition);
}
.report-link svg { width: 14px; height: 14px; }
.report-link:hover { color: var(--danger); }

/* ── Ad ── */
.file-ad-section {
    margin-top: 8px;
    text-align: center;
}

/* ── Responsive ── */
@media (max-width: 640px) {
    .file-page-container {
        padding: 20px 16px 40px;
    }
    .file-card,
    .preview-card,
    .details-card,
    .file-detail-card {
        padding: 20px;
    }
    .file-head {
        gap: 14px;
    }
    .file-kind {
        width: 48px;
        height: 48px;
        border-radius: 12px;
    }
    .file-title {
        font-size: 19px;
    }
    .file-actions {
        flex-direction: column;
        align-items: stretch;
    }
    .share-row {
        flex-wrap: wrap;
    }
    .share-input {
        flex-basis: 100%;
    }
    .btn-copy,
    .btn-qr-toggle {
        flex: 1;
        justify-content: center;
        padding: 11px 14px;
    }
    .qr-panel {
        flex-direction: column;
        text-align: center;
    }
    .details-grid {
        grid-template-columns: 1fr 1fr;
    }
}
