/**
 * Social Share Styles - Portable
 * Dark theme. Drop this file + icons.js + share.js into any project.
 *
 * Layout variants:
 *   .share-modal        - compact modal (340px, dark overlay)
 *   .share-social-grid  - icon-only grid (homepage/landing)
 *   .share-options      - labeled 3-col grid (dashboard)
 */

/* ── Modal overlay (portable - works without dashboard CSS) ──────────────── */
.confirm-modal-overlay {
	position: fixed;
	top: 0;
	left: 0;
	right: 0;
	bottom: 0;
	background: rgba(0, 0, 0, 0.6);
	backdrop-filter: blur(1px);
	display: flex;
	align-items: center;
	justify-content: center;
	z-index: 10000;
	animation: shareOverlayIn 0.15s ease;
}

@keyframes shareOverlayIn {
	from {
		opacity: 0;
	}
	to {
		opacity: 1;
	}
}

/* ── Modal container ──────────────────────────────────────────────────────── */
.share-modal {
	background: #111113;
	border: 1px solid #232326;
	border-radius: 12px;
	padding: 18px;
	max-width: 340px;
	width: 90%;
}

.share-modal-header {
	display: flex;
	align-items: center;
	justify-content: space-between;
	margin-bottom: 8px;
}

.share-modal-title {
	display: flex;
	align-items: center;
	gap: 8px;
}

.share-modal-logo {
	width: 22px;
	height: 22px;
	border-radius: 4px;
	object-fit: contain;
}

.share-modal-header h3 {
	font-size: 14px;
	font-weight: 600;
	color: #fafafa;
	margin: 0;
}

.share-modal-description {
	font-size: 12px;
	color: #71717a;
	line-height: 1.4;
	margin-bottom: 14px;
}

.share-modal-tagline {
	font-size: 12px;
	color: #71717a;
	line-height: 1.4;
	margin-bottom: 12px;
	white-space: nowrap;
	overflow: hidden;
	text-overflow: ellipsis;
}

/* ── Labeled 3-col grid (.share-options > .share-option) ─────────────────── */
.share-options {
	display: grid;
	grid-template-columns: repeat(3, 1fr);
	gap: 6px;
	margin-bottom: 14px;
}

.share-option {
	display: flex;
	flex-direction: column;
	align-items: center;
	gap: 4px;
	padding: 10px 4px 8px;
	background: #18181b;
	border: 1px solid #1f1f23;
	border-radius: 8px;
	color: #a1a1aa;
	text-decoration: none;
	font-size: 10px;
	font-weight: 500;
	cursor: pointer;
	transition: all 0.2s cubic-bezier(0.34, 1.4, 0.64, 1);
	animation: shareOptionIn 0.3s cubic-bezier(0.34, 1.4, 0.64, 1) backwards;
	animation-delay: calc(var(--i, 0) * 30ms + 80ms);
}

@keyframes shareOptionIn {
	from {
		opacity: 0;
		transform: scale(0.85);
	}
	to {
		opacity: 1;
		transform: scale(1);
	}
}

.share-option:hover {
	transform: translateY(-2px);
	box-shadow: 0 4px 12px rgba(0, 0, 0, 0.25);
}

.share-option:active {
	transform: scale(0.96);
	transition-duration: 0.08s;
}

.share-option svg,
.share-option i {
	width: 18px;
	height: 18px;
	flex-shrink: 0;
	transition: transform 0.2s ease;
}

.share-option:hover svg,
.share-option:hover i {
	transform: scale(1.15);
}

/* ── Icon-only grid (.share-social-grid > .share-social-btn) ─────────────── */
.share-social-grid {
	display: grid;
	grid-template-columns: repeat(6, 1fr);
	gap: 12px;
	margin-bottom: 16px;
}

.share-social-btn {
	padding: 12px;
	border-radius: 8px;
	background: rgba(39, 39, 42, 0.5);
	border: none;
	color: #a1a1aa;
	cursor: pointer;
	transition: all 0.2s;
	display: flex;
	align-items: center;
	justify-content: center;
}

.share-social-btn svg {
	width: 20px;
	height: 20px;
}

.share-social-btn:hover {
	background: var(--hover-color);
	color: white;
	transform: translateY(-2px);
}

/* ── Action buttons (copy + email row) ───────────────────────────────────── */
.share-actions {
	display: flex;
	gap: 12px;
}

.share-action-btn {
	flex: 1;
	padding: 10px;
	border-radius: 8px;
	background: rgba(39, 39, 42, 0.5);
	border: none;
	color: #a1a1aa;
	cursor: pointer;
	transition: all 0.2s;
	display: flex;
	align-items: center;
	justify-content: center;
	gap: 8px;
	font-size: 14px;
}

.share-action-btn:hover {
	background: rgba(39, 39, 42, 0.8);
	color: #fafafa;
}

/* ── Inline copy link row ────────────────────────────────────────────────── */
.share-link-row {
	display: flex;
	gap: 0;
	align-items: stretch;
	height: 32px;
	animation: shareOptionIn 0.3s cubic-bezier(0.34, 1.4, 0.64, 1) backwards;
	animation-delay: 350ms;
}

.share-link-input {
	flex: 1;
	min-width: 0;
	padding: 0 10px;
	background: #09090b;
	border: 1px solid #1f1f23;
	border-radius: 6px 0 0 6px;
	border-right: none;
	color: #52525b;
	font-size: 11px;
	font-family: "JetBrains Mono", monospace;
	height: 32px;
	box-sizing: border-box;
}

.share-link-input:focus {
	outline: none;
}

.share-copy-btn {
	display: flex;
	align-items: center;
	justify-content: center;
	width: 32px;
	padding: 0;
	background: #1f1f23;
	color: #a1a1aa;
	border: 1px solid #1f1f23;
	border-radius: 0 6px 6px 0;
	cursor: pointer;
	transition: all 0.15s;
	height: 32px;
	box-sizing: border-box;
	flex-shrink: 0;
}

.share-copy-btn:hover {
	background: #27272a;
	color: #e4e4e7;
}

.share-copy-btn:active {
	transform: scale(0.97);
}

.share-copy-btn.copied {
	background: rgba(52, 211, 153, 0.15);
	color: #34d399;
	border-color: rgba(52, 211, 153, 0.2);
}

.share-copy-btn i {
	width: 12px;
	height: 12px;
}

/* ── Platform brand colors ───────────────────────────────────────────────── */
.share-option.x,
.share-option.twitter {
	color: #e4e4e7;
}
.share-option.x:hover,
.share-option.twitter:hover {
	background: rgba(255, 255, 255, 0.06);
	border-color: rgba(255, 255, 255, 0.2);
}

.share-option.bluesky {
	color: #0085ff;
}
.share-option.bluesky:hover {
	background: rgba(0, 133, 255, 0.08);
	border-color: rgba(0, 133, 255, 0.3);
}

.share-option.threads {
	color: #e4e4e7;
}
.share-option.threads:hover {
	background: rgba(255, 255, 255, 0.06);
	border-color: rgba(255, 255, 255, 0.2);
}

.share-option.linkedin {
	color: #0077b5;
}
.share-option.linkedin:hover {
	background: rgba(0, 119, 181, 0.08);
	border-color: rgba(0, 119, 181, 0.3);
}

.share-option.facebook {
	color: #1877f2;
}
.share-option.facebook:hover {
	background: rgba(24, 119, 242, 0.08);
	border-color: rgba(24, 119, 242, 0.3);
}

.share-option.instagram {
	color: #e1306c;
}
.share-option.instagram:hover {
	background: rgba(225, 48, 108, 0.08);
	border-color: rgba(225, 48, 108, 0.3);
}

.share-option.reddit {
	color: #ff4500;
}
.share-option.reddit:hover {
	background: rgba(255, 69, 0, 0.08);
	border-color: rgba(255, 69, 0, 0.3);
}

.share-option.whatsapp {
	color: #25d366;
}
.share-option.whatsapp:hover {
	background: rgba(37, 211, 102, 0.08);
	border-color: rgba(37, 211, 102, 0.3);
}

.share-option.telegram {
	color: #0088cc;
}
.share-option.telegram:hover {
	background: rgba(0, 136, 204, 0.08);
	border-color: rgba(0, 136, 204, 0.3);
}

/* ── Share button ────────────────────────────────────────────────────────── */
.spark-share-btn {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	padding: 0;
	background: transparent;
	color: #818cf8;
	border: none;
	cursor: pointer;
	transition: color 0.2s, transform 0.2s;
}

.spark-share-btn:hover {
	color: #a5b4fc;
	transform: translateY(-1px);
}

/* ── Close button (self-contained) ───────────────────────────────────────── */
.share-close-btn {
	display: flex;
	align-items: center;
	justify-content: center;
	width: 28px;
	height: 28px;
	border-radius: 6px;
	background: transparent;
	border: none;
	color: #52525b;
	cursor: pointer;
	transition: color 0.15s ease, background 0.15s ease, transform 0.2s ease;
	flex-shrink: 0;
}

.share-close-btn:hover {
	background: rgba(239, 68, 68, 0.1);
	color: #ef4444;
	transform: rotate(90deg);
}

/* ── Responsive ──────────────────────────────────────────────────────────── */
@media (max-width: 600px) {
	.share-social-grid {
		grid-template-columns: repeat(3, 1fr);
	}
}
