/* Ponytail & UI/UX Pro Max Dark Design System */

:root {
	--bg-dark: #09090b;
	--card-bg: rgba(20, 20, 26, 0.75);
	--card-border: rgba(255, 255, 255, 0.08);
	--card-border-glow: rgba(6, 182, 212, 0.25);
	--card-border-hover: rgba(255, 255, 255, 0.16);
	--text-primary: #f4f4f5;
	--text-secondary: #a1a1aa;
	--text-muted: #71717a;
	--accent-cyan: #06b6d4;
	--accent-purple: #8b5cf6;
	--accent-blue: #3b82f6;
	--danger: #ef4444;
	--danger-bg: rgba(239, 68, 68, 0.12);
	--warning: #f59e0b;
	--warning-bg: rgba(245, 158, 11, 0.12);
	--success: #10b981;
	--success-bg: rgba(16, 185, 129, 0.12);
	--font-family:
		"Outfit", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
	--font-mono: "JetBrains Mono", monospace;
	--glow-shadow: 0 0 30px rgba(6, 182, 212, 0.18);
	--border-radius: 20px;
	--transition-smooth: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
}

* {
	margin: 0;
	padding: 0;
	box-sizing: border-box;
}

body {
	background-color: var(--bg-dark);
	color: var(--text-primary);
	font-family: var(--font-family);
	min-height: 100vh;
	display: flex;
	justify-content: center;
	align-items: center;
	overflow-x: hidden;
	position: relative;
	padding: 2rem 1rem;
	line-height: 1.5;
}

/* Background Ambient Glow */
.bg-glow {
	position: fixed;
	width: 650px;
	height: 650px;
	background: radial-gradient(
		circle,
		rgba(139, 92, 246, 0.1) 0%,
		rgba(6, 182, 212, 0.06) 45%,
		rgba(0, 0, 0, 0) 70%
	);
	top: -12%;
	left: 50%;
	transform: translateX(-50%);
	z-index: -1;
	filter: blur(80px);
	pointer-events: none;
}

.container {
	width: 100%;
	max-width: 640px;
	z-index: 1;
	display: flex;
	flex-direction: column;
	gap: 1.25rem;
}

/* Header */
header {
	text-align: center;
	margin-bottom: 0.25rem;
}

header h1 {
	font-size: 2.75rem;
	font-weight: 700;
	letter-spacing: -0.03em;
	margin-bottom: 0.4rem;
	display: flex;
	align-items: center;
	justify-content: center;
	gap: 0.5rem;
}

.gradient-text {
	background: linear-gradient(
		135deg,
		var(--accent-cyan) 0%,
		var(--accent-purple) 100%
	);
	-webkit-background-clip: text;
	-webkit-text-fill-color: transparent;
	background-clip: text;
}

.subtitle {
	color: var(--text-secondary);
	font-size: 0.95rem;
	font-weight: 300;
}

/* =========================================
   Segmented Control Pill Bar (Tab Switcher)
   ========================================= */
.tab-nav {
	display: flex;
	align-items: center;
	justify-content: center;
	width: 100%;
	max-width: 330px;
	margin: 0 auto 0.5rem auto;
	background: rgba(15, 23, 42, 0.85);
	border: 1px solid rgba(255, 255, 255, 0.1);
	border-radius: 9999px;
	padding: 4px;
	gap: 4px;
	box-shadow:
		0 4px 20px rgba(0, 0, 0, 0.4),
		inset 0 1px 1px rgba(255, 255, 255, 0.05);
	backdrop-filter: blur(16px);
	-webkit-backdrop-filter: blur(16px);
}

.tab-btn {
	flex: 1;
	display: inline-flex;
	align-items: center;
	justify-content: center;
	gap: 0.5rem;
	padding: 0.55rem 1.15rem;
	min-height: 42px;
	appearance: none;
	-webkit-appearance: none;
	-moz-appearance: none;
	border: 1px solid transparent;
	outline: none;
	background: transparent;
	color: #94a3b8;
	font-family: var(--font-family);
	font-size: 0.875rem;
	font-weight: 500;
	border-radius: 9999px;
	cursor: pointer;
	transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
	white-space: nowrap;
	user-select: none;
	box-shadow: none;
}

.tab-btn:hover {
	color: #f8fafc;
	background: rgba(255, 255, 255, 0.06);
}

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

.tab-btn.active {
	background: rgba(6, 182, 212, 0.18);
	color: #38bdf8;
	border: 1px solid rgba(56, 189, 248, 0.35);
	box-shadow: 0 2px 12px rgba(6, 182, 212, 0.25);
	font-weight: 600;
}

.tab-icon {
	width: 16px !important;
	height: 16px !important;
	min-width: 16px !important;
	min-height: 16px !important;
	max-width: 16px !important;
	max-height: 16px !important;
	display: inline-block;
	flex-shrink: 0;
	vertical-align: middle;
}

/* Glassmorphism Cards */
.card {
	background: var(--card-bg);
	border: 1px solid var(--card-border);
	border-radius: var(--border-radius);
	backdrop-filter: blur(24px);
	-webkit-backdrop-filter: blur(24px);
	padding: 1.75rem;
	box-shadow: 0 16px 36px -10px rgba(0, 0, 0, 0.5);
	transition: var(--transition-smooth);
}

/* Helper */
.hidden {
	display: none !important;
}

/* Upload Drop Zone */
.drop-zone {
	width: 100%;
	border: 2px dashed rgba(255, 255, 255, 0.16);
	border-radius: calc(var(--border-radius) - 6px);
	padding: 3rem 1.5rem;
	text-align: center;
	position: relative;
	cursor: pointer;
	background: rgba(255, 255, 255, 0.015);
	transition: var(--transition-smooth);
	outline: none;
}

.drop-zone:hover,
.drop-zone:focus-visible,
.drop-zone.dragover {
	border-color: var(--accent-cyan);
	background: rgba(6, 182, 212, 0.04);
	box-shadow: var(--glow-shadow);
	transform: translateY(-2px);
}

.drop-zone-content {
	display: flex;
	flex-direction: column;
	align-items: center;
	gap: 0.75rem;
	pointer-events: none;
}

.icon-wrapper {
	width: 68px;
	height: 68px;
	border-radius: 50%;
	background: rgba(255, 255, 255, 0.04);
	display: flex;
	align-items: center;
	justify-content: center;
	margin-bottom: 0.25rem;
	transition: var(--transition-smooth);
	border: 1px solid rgba(255, 255, 255, 0.06);
}

.upload-icon {
	width: 32px;
	height: 32px;
	color: var(--accent-cyan);
}

.drop-zone:hover .icon-wrapper,
.drop-zone.dragover .icon-wrapper {
	background: rgba(6, 182, 212, 0.12);
	border-color: rgba(6, 182, 212, 0.35);
	transform: scale(1.08);
}

.drop-zone h3 {
	font-size: 1.25rem;
	font-weight: 600;
}

.drop-zone p {
	color: var(--text-secondary);
	font-size: 0.95rem;
}

.pill-badge {
	display: inline-flex;
	align-items: center;
	gap: 0.5rem;
	padding: 0.35rem 0.85rem;
	background: rgba(245, 158, 11, 0.1);
	border: 1px solid rgba(245, 158, 11, 0.25);
	color: #fbbf24;
	border-radius: 9999px;
	font-size: 0.8rem;
	font-weight: 500;
	margin-top: 0.5rem;
}

.pulse-dot {
	width: 6px;
	height: 6px;
	border-radius: 50%;
	background-color: #fbbf24;
	box-shadow: 0 0 8px #fbbf24;
	animation: pulse 2s infinite;
}

@keyframes pulse {
	0% {
		transform: scale(0.95);
		opacity: 0.7;
	}
	50% {
		transform: scale(1.3);
		opacity: 1;
	}
	100% {
		transform: scale(0.95);
		opacity: 0.7;
	}
}

.file-input {
	display: none;
}

/* Progress Card */
.progress-card {
	display: flex;
	flex-direction: column;
	gap: 1rem;
}

.progress-header {
	display: flex;
	justify-content: space-between;
	align-items: center;
}

.file-info {
	display: flex;
	align-items: center;
	gap: 0.75rem;
	overflow: hidden;
}

.file-type-icon-small {
	width: 20px;
	height: 20px;
	color: var(--accent-cyan);
	flex-shrink: 0;
}

.file-name-progress {
	font-size: 0.95rem;
	font-weight: 500;
	white-space: nowrap;
	overflow: hidden;
	text-overflow: ellipsis;
}

.btn-icon {
	background: transparent;
	border: none;
	color: var(--text-muted);
	cursor: pointer;
	padding: 6px;
	border-radius: 8px;
	display: flex;
	align-items: center;
	justify-content: center;
	transition: var(--transition-smooth);
}

.btn-icon:hover {
	color: var(--danger);
	background: rgba(239, 68, 68, 0.1);
}

.btn-icon svg {
	width: 18px;
	height: 18px;
}

.progress-bar-container {
	width: 100%;
	height: 6px;
	background: rgba(255, 255, 255, 0.08);
	border-radius: 4px;
	overflow: hidden;
}

.progress-bar {
	height: 100%;
	background: linear-gradient(
		90deg,
		var(--accent-cyan) 0%,
		var(--accent-purple) 100%
	);
	border-radius: 4px;
	transition: width 0.15s ease-out;
}

.progress-details {
	display: flex;
	justify-content: space-between;
	font-size: 0.85rem;
	color: var(--text-secondary);
}

/* Success Card */
.success-card {
	display: flex;
	flex-direction: column;
	gap: 1.25rem;
	animation: fadeIn 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

@keyframes fadeIn {
	from {
		opacity: 0;
		transform: translateY(6px);
	}
	to {
		opacity: 1;
		transform: translateY(0);
	}
}

.success-header {
	text-align: center;
	display: flex;
	flex-direction: column;
	align-items: center;
	gap: 0.4rem;
}

.success-icon-badge {
	width: 52px;
	height: 52px;
	border-radius: 50%;
	background: var(--success-bg);
	border: 1px solid rgba(16, 185, 129, 0.3);
	color: var(--success);
	display: flex;
	align-items: center;
	justify-content: center;
	box-shadow: 0 0 20px rgba(16, 185, 129, 0.2);
	margin-bottom: 0.25rem;
}

.success-icon-badge svg {
	width: 28px;
	height: 28px;
}

.success-header h2 {
	font-size: 1.5rem;
	font-weight: 700;
}

.file-summary {
	color: var(--text-secondary);
	font-size: 0.9rem;
}

/* Timer Badge */
.countdown-container {
	display: flex;
	justify-content: center;
}

.timer-badge {
	display: inline-flex;
	align-items: center;
	gap: 0.45rem;
	padding: 0.45rem 1rem;
	background: rgba(6, 182, 212, 0.1);
	border: 1px solid rgba(6, 182, 212, 0.25);
	border-radius: 9999px;
	color: var(--accent-cyan);
	font-size: 0.9rem;
	font-weight: 500;
	transition: var(--transition-smooth);
}

.timer-badge.warning {
	background: var(--warning-bg);
	border-color: rgba(245, 158, 11, 0.35);
	color: #fbbf24;
}

.timer-badge.danger {
	background: var(--danger-bg);
	border-color: rgba(239, 68, 68, 0.35);
	color: #f87171;
	animation: pulse 1s infinite;
}

.timer-icon {
	width: 16px;
	height: 16px;
}

.timer-digits {
	font-family: var(--font-mono);
	font-size: 1rem;
	letter-spacing: 0.05em;
}

/* Code Share Box */
.section-label {
	display: block;
	font-size: 0.72rem;
	font-weight: 700;
	letter-spacing: 0.1em;
	color: var(--text-muted);
	margin-bottom: 0.4rem;
}

.code-display-box {
	display: flex;
	align-items: center;
	justify-content: space-between;
	background: rgba(0, 0, 0, 0.4);
	border: 1px solid var(--card-border-glow);
	box-shadow: 0 0 15px rgba(6, 182, 212, 0.1);
	border-radius: 12px;
	padding: 0.85rem 1.25rem;
}

.secret-code {
	font-family: var(--font-mono);
	font-size: 2.1rem;
	font-weight: 700;
	letter-spacing: 0.25em;
	color: #ffffff;
	text-shadow: 0 0 12px rgba(6, 182, 212, 0.5);
}

/* Copy Buttons */
.btn-copy {
	display: inline-flex;
	align-items: center;
	gap: 0.4rem;
	padding: 0.55rem 0.95rem;
	background: rgba(255, 255, 255, 0.07);
	border: 1px solid rgba(255, 255, 255, 0.12);
	border-radius: 8px;
	color: var(--text-primary);
	font-family: var(--font-family);
	font-size: 0.85rem;
	font-weight: 500;
	cursor: pointer;
	min-height: 40px;
	transition: var(--transition-smooth);
}

.btn-copy:hover {
	background: rgba(6, 182, 212, 0.15);
	border-color: rgba(6, 182, 212, 0.4);
	color: var(--accent-cyan);
}

.btn-copy.copied {
	background: var(--success-bg);
	border-color: rgba(16, 185, 129, 0.4);
	color: var(--success);
}

.copy-icon {
	width: 16px;
	height: 16px;
}

/* Link Share Section */
.link-input-wrapper {
	display: flex;
	gap: 0.5rem;
}

.share-link-input {
	flex: 1;
	background: rgba(0, 0, 0, 0.35);
	border: 1px solid var(--card-border);
	border-radius: 10px;
	padding: 0.65rem 1rem;
	color: var(--text-secondary);
	font-family: var(--font-mono);
	font-size: 0.88rem;
	outline: none;
	min-height: 44px;
}

.share-link-input:focus {
	border-color: var(--accent-cyan);
	color: var(--text-primary);
}

/* Action Buttons */
.success-actions {
	display: flex;
	justify-content: center;
	margin-top: 0.5rem;
}

.btn-secondary {
	display: inline-flex;
	align-items: center;
	gap: 0.5rem;
	background: rgba(255, 255, 255, 0.05);
	border: 1px solid var(--card-border);
	color: var(--text-secondary);
	font-family: var(--font-family);
	font-size: 0.92rem;
	font-weight: 500;
	padding: 0.65rem 1.25rem;
	border-radius: 10px;
	cursor: pointer;
	min-height: 44px;
	transition: var(--transition-smooth);
}

.btn-secondary:hover {
	background: rgba(255, 255, 255, 0.09);
	color: var(--text-primary);
	border-color: var(--card-border-hover);
}

.btn-secondary svg {
	width: 16px;
	height: 16px;
}

/* TAB 2: RECEIVE FILE VIEW */
.receive-card {
	display: flex;
	flex-direction: column;
	gap: 1.5rem;
}

.receive-header {
	text-align: center;
	display: flex;
	flex-direction: column;
	align-items: center;
	gap: 0.4rem;
}

.receive-icon-badge {
	width: 52px;
	height: 52px;
	border-radius: 50%;
	background: rgba(6, 182, 212, 0.1);
	border: 1px solid rgba(6, 182, 212, 0.25);
	color: var(--accent-cyan);
	display: flex;
	align-items: center;
	justify-content: center;
	margin-bottom: 0.25rem;
}

.receive-icon-badge svg {
	width: 26px;
	height: 26px;
}

.receive-header h2 {
	font-size: 1.5rem;
	font-weight: 700;
}

.receive-header p {
	color: var(--text-secondary);
	font-size: 0.95rem;
}

/* Receive Form & Code Input */
.receive-form {
	width: 100%;
}

.input-group {
	display: flex;
	gap: 0.6rem;
	width: 100%;
}

.code-input {
	flex: 1;
	background: rgba(0, 0, 0, 0.4);
	border: 1px solid var(--card-border);
	border-radius: 12px;
	padding: 0.85rem 1.25rem;
	color: var(--text-primary);
	font-family: var(--font-mono);
	font-size: 1.4rem;
	font-weight: 700;
	letter-spacing: 0.2em;
	text-transform: uppercase;
	text-align: center;
	outline: none;
	min-height: 50px;
	transition: var(--transition-smooth);
}

.code-input:focus {
	border-color: var(--accent-cyan);
	box-shadow: 0 0 20px rgba(6, 182, 212, 0.2);
}

.code-input::placeholder {
	color: rgba(255, 255, 255, 0.2);
	letter-spacing: 0.1em;
	font-weight: 400;
}

.btn-primary {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	gap: 0.5rem;
	background: linear-gradient(
		135deg,
		var(--accent-cyan) 0%,
		var(--accent-blue) 100%
	);
	border: none;
	border-radius: 12px;
	color: #ffffff;
	font-family: var(--font-family);
	font-size: 1rem;
	font-weight: 600;
	padding: 0.85rem 1.5rem;
	cursor: pointer;
	min-height: 50px;
	box-shadow: 0 4px 15px rgba(6, 182, 212, 0.25);
	transition: var(--transition-smooth);
	flex-shrink: 0;
}

.btn-primary:hover {
	transform: translateY(-2px);
	box-shadow: 0 6px 20px rgba(6, 182, 212, 0.35);
}

.btn-primary:active {
	transform: translateY(0);
}

.btn-arrow-icon {
	width: 18px;
	height: 18px;
}

/* Receive Loading Spinner */
.receive-loading {
	display: flex;
	flex-direction: column;
	align-items: center;
	gap: 0.75rem;
	padding: 1.5rem 0;
	color: var(--text-secondary);
	font-size: 0.95rem;
}

.spinner {
	width: 32px;
	height: 32px;
	border: 3px solid rgba(255, 255, 255, 0.1);
	border-top-color: var(--accent-cyan);
	border-radius: 50%;
	animation: spin 0.8s linear infinite;
}

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

/* File Result Card (Found) */
.file-result-card {
	display: flex;
	flex-direction: column;
	gap: 1.25rem;
	background: rgba(255, 255, 255, 0.025);
	border: 1px solid rgba(6, 182, 212, 0.25);
	border-radius: 14px;
	padding: 1.25rem;
	animation: fadeIn 0.25s ease-out;
}

.file-result-info {
	display: flex;
	align-items: center;
	gap: 1rem;
}

.file-result-icon {
	width: 48px;
	height: 48px;
	border-radius: 12px;
	background: rgba(6, 182, 212, 0.1);
	border: 1px solid rgba(6, 182, 212, 0.2);
	color: var(--accent-cyan);
	display: flex;
	align-items: center;
	justify-content: center;
	flex-shrink: 0;
}

.file-result-icon svg {
	width: 24px;
	height: 24px;
}

.file-result-meta {
	flex: 1;
	overflow: hidden;
}

.result-filename {
	font-size: 1.1rem;
	font-weight: 600;
	white-space: nowrap;
	overflow: hidden;
	text-overflow: ellipsis;
	color: var(--text-primary);
}

.result-sub-meta {
	display: flex;
	align-items: center;
	gap: 0.5rem;
	margin-top: 0.25rem;
	font-size: 0.85rem;
	color: var(--text-secondary);
}

.meta-dot {
	color: var(--text-muted);
}

.receiver-timer-badge {
	display: inline-flex;
	align-items: center;
	gap: 0.3rem;
	color: var(--accent-cyan);
	font-weight: 500;
}

.receiver-timer-badge strong {
	font-family: var(--font-mono);
}

.timer-icon-small {
	width: 14px;
	height: 14px;
}

.btn-download-action {
	display: flex;
	align-items: center;
	justify-content: center;
	gap: 0.6rem;
	width: 100%;
	padding: 0.85rem 1.25rem;
	background: linear-gradient(
		135deg,
		var(--accent-cyan) 0%,
		var(--accent-purple) 100%
	);
	border: none;
	border-radius: 12px;
	color: #ffffff;
	font-family: var(--font-family);
	font-size: 1.05rem;
	font-weight: 600;
	cursor: pointer;
	min-height: 48px;
	box-shadow: 0 4px 16px rgba(6, 182, 212, 0.25);
	transition: var(--transition-smooth);
}

.btn-download-action:hover {
	transform: translateY(-2px);
	box-shadow: 0 6px 24px rgba(6, 182, 212, 0.35);
}

.btn-download-action:active {
	transform: translateY(0);
}

.btn-download-action svg {
	width: 20px;
	height: 20px;
}

/* Error Card */
.receive-error-card {
	display: flex;
	flex-direction: column;
	align-items: center;
	text-align: center;
	gap: 0.6rem;
	padding: 1.5rem 1rem;
	background: var(--danger-bg);
	border: 1px solid rgba(239, 68, 68, 0.25);
	border-radius: 14px;
	animation: fadeIn 0.25s ease-out;
}

.error-icon-badge {
	width: 44px;
	height: 44px;
	border-radius: 50%;
	background: rgba(239, 68, 68, 0.2);
	color: var(--danger);
	display: flex;
	align-items: center;
	justify-content: center;
	margin-bottom: 0.25rem;
}

.error-icon-badge svg {
	width: 24px;
	height: 24px;
}

.receive-error-card h3 {
	font-size: 1.15rem;
	font-weight: 600;
	color: #fca5a5;
}

.receive-error-card p {
	color: var(--text-secondary);
	font-size: 0.9rem;
	max-width: 420px;
}

/* Floating Toast Notification */
.toast-container {
	position: fixed;
	bottom: 2rem;
	left: 50%;
	transform: translateX(-50%);
	display: flex;
	flex-direction: column;
	gap: 0.5rem;
	z-index: 1000;
	pointer-events: none;
}

.toast {
	display: flex;
	align-items: center;
	gap: 0.5rem;
	background: rgba(24, 24, 30, 0.95);
	border: 1px solid rgba(255, 255, 255, 0.15);
	color: var(--text-primary);
	padding: 0.65rem 1.15rem;
	border-radius: 10px;
	font-size: 0.88rem;
	font-weight: 500;
	box-shadow: 0 10px 25px rgba(0, 0, 0, 0.5);
	backdrop-filter: blur(12px);
	-webkit-backdrop-filter: blur(12px);
	animation: toastIn 0.25s cubic-bezier(0.4, 0, 0.2, 1);
	pointer-events: auto;
}

.toast.success {
	border-color: rgba(16, 185, 129, 0.35);
	color: #a7f3d0;
}

.toast.error {
	border-color: rgba(239, 68, 68, 0.35);
	color: #fca5a5;
}

@keyframes toastIn {
	from {
		opacity: 0;
		transform: translateY(12px);
	}
	to {
		opacity: 1;
		transform: translateY(0);
	}
}

/* Footer */
footer {
	text-align: center;
	color: var(--text-muted);
	font-size: 0.82rem;
	margin-top: 0.5rem;
}

/* Responsive adjustments */
@media (max-width: 480px) {
	header h1 {
		font-size: 2.2rem;
	}
	.tab-nav {
		max-width: 100%;
	}
	.card {
		padding: 1.25rem;
	}
	.drop-zone {
		padding: 2.25rem 1rem;
	}
	.secret-code {
		font-size: 1.7rem;
		letter-spacing: 0.18em;
	}
	.input-group {
		flex-direction: column;
	}
	.btn-primary {
		width: 100%;
	}
}
