/*
 * Copyright (C) 2026 Fluxer Contributors
 *
 * This file is part of Fluxer.
 *
 * Fluxer is free software: you can redistribute it and/or modify
 * it under the terms of the GNU Affero General Public License as published by
 * the Free Software Foundation, either version 3 of the License, or
 * (at your option) any later version.
 *
 * Fluxer is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
 * GNU Affero General Public License for more details.
 *
 * You should have received a copy of the GNU Affero General Public License
 * along with Fluxer. If not, see <https://www.gnu.org/licenses/>.
 */

.container {
	position: relative;
}

.deleteButton {
	display: flex;
	align-items: center;
	justify-content: center;
	right: -2rem;
	position: absolute;
	top: 0.25rem;
	z-index: 10;
	width: 1.5rem;
	height: 1.5rem;
	border-radius: 4px;
	background-color: var(--background-tertiary);
	color: var(--text-tertiary);
	transition:
		background-color 150ms ease,
		color 150ms ease;
}

@media (hover: hover) {
	.deleteButton:hover {
		background-color: var(--status-danger);
		color: var(--text-on-brand-primary);
	}
}

.attachmentContainer {
	display: flex;
	width: 100%;
	min-width: 0;
	align-items: center;
	gap: 0.75rem;
	overflow: hidden;
	border-radius: 8px;
	border: 1px solid var(--background-modifier-accent);
	background-color: var(--background-secondary);
	padding: 0.75rem;
}

.iconContainer {
	display: flex;
	align-items: center;
	justify-content: center;
	width: 3rem;
	height: 3rem;
	flex-shrink: 0;
	border-radius: 8px;
	background-color: var(--background-tertiary);
	color: var(--text-tertiary);
}

.fileInfoContainer {
	min-width: 0;
	flex: 1;
	overflow: hidden;
}

.fileName {
	display: block;
	overflow: hidden;
	font-size: 0.875rem;
	font-weight: 600;
	color: var(--text-primary);
	line-height: 1.25rem;
	white-space: nowrap;
	text-overflow: ellipsis;
}

.fileNameTruncate {
	overflow: hidden;
	white-space: nowrap;
	text-overflow: ellipsis;
}

.fileExtension {
	color: var(--text-tertiary);
}

.fileSize {
	color: var(--text-tertiary);
	font-size: 0.75rem;
	line-height: 1rem;
}

.downloadButton {
	display: flex;
	align-items: center;
	justify-content: center;
	width: 2.5rem;
	height: 2.5rem;
	flex-shrink: 0;
	border-radius: 8px;
	background-color: var(--brand-primary);
	color: var(--text-on-brand-primary);
	transition: background-color 0.1s ease;
	cursor: pointer;
}

@media (hover: hover) {
	.downloadButton:hover {
		background-color: var(--brand-secondary);
	}
}

.downloadButtonDisabled {
	opacity: 0.4;
	pointer-events: none;
}

.statusBadge {
	display: inline-flex;
	align-items: center;
	gap: 0.3rem;
	padding: 0.25rem 0.45rem;
	border-radius: 999px;
	background: color-mix(in srgb, var(--background-secondary) 80%, transparent);
	color: var(--text-secondary);
	border: 1px solid var(--border-color);
	font-size: 0.75rem;
	backdrop-filter: blur(6px);
	opacity: 0.92;
}

.statusIcon {
	width: 14px;
	height: 14px;
}

.textualPreview {
	display: flex;
	flex-direction: column;
	border-radius: var(--radius-md);
	background-color: var(--background-secondary);
	border: 1px solid var(--border-color);
	overflow: hidden;
}

.previewContent {
	position: relative;
	background-color: var(--bg-code-block);
	min-height: 5rem;
}

.previewContentInner {
	display: flex;
	flex-direction: column;
	gap: 0.5rem;
	padding: 0.75rem;
}

.previewContentLoading {
	display: flex;
	align-items: center;
	justify-content: center;
	min-height: 6rem;
	color: var(--text-tertiary);
}

.codeBlock {
	margin: 0;
	padding: 0;
	font-family: var(--font-mono);
	font-size: 0.75rem;
	line-height: 1rem;
	white-space: pre;
	color: var(--text-code);
	overflow-x: auto;
	scrollbar-width: thin;
}

.wrapMode {
	white-space: pre-wrap !important;
	word-break: break-word;
}

.previewTruncationNote {
	color: var(--text-tertiary);
	font-size: 0.75rem;
	line-height: 1rem;
	font-family: var(--font-mono);
}

.previewFooter {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 0.75rem;
	padding: 0.5rem 0.75rem;
	background-color: var(--background-secondary);
	border-top: 1px solid var(--border-color);
}

.previewFooterLeft {
	display: flex;
	flex-direction: column;
	gap: 0.15rem;
	min-width: 0;
	flex: 1;
}

.previewFilename {
	font-size: 0.875rem;
	font-weight: 500;
	color: var(--text-primary);
	overflow: hidden;
	text-overflow: ellipsis;
	white-space: nowrap;
}

.previewFileSize {
	font-size: 0.75rem;
	color: var(--text-tertiary);
}

.previewControls {
	display: inline-flex;
	align-items: center;
	gap: 0.25rem;
}

.previewControlButton {
	border: none;
	background: transparent;
	color: var(--text-secondary);
	width: 2rem;
	height: 2rem;
	border-radius: 4px;
	display: inline-flex;
	align-items: center;
	justify-content: center;
	cursor: pointer;
	transition:
		background-color 0.1s ease,
		color 0.1s ease;
	text-decoration: none;
}

@media (hover: hover) {
	.previewControlButton:hover {
		background-color: var(--background-modifier-hover);
		color: var(--text-primary);
	}
}

.previewError {
	padding: 1rem;
	display: flex;
	align-items: center;
	gap: 0.45rem;
	color: var(--status-danger);
}

.previewLoadingState {
	padding: 1rem;
	display: flex;
	align-items: center;
	justify-content: center;
	gap: 0.5rem;
	color: var(--text-tertiary);
}

.srOnly {
	position: absolute;
	width: 1px;
	height: 1px;
	padding: 0;
	margin: -1px;
	overflow: hidden;
	clip: rect(0, 0, 0, 0);
	border: 0;
}
