/* ========================================
   High Offers Manager - Dark Theme
   Based on facebook-cards-manager design
   ======================================== */

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

:root {
	--bg-app: #0f1115;
	--bg-card: #111;
	--bg-input: #222;
	--bg-muted: rgba(255, 255, 255, 0.05);
	--border: #2a2f3a;
	--border-light: #333;
	--text: #e5e7eb;
	--text-white: #fff;
	--text-muted: #9ca3af;
	--text-secondary: #a1a1aa;
	--primary: #3b82f6;
	--primary-hover: #2563eb;
	--success: #10b981;
	--error: #f87171;
	--error-bg: rgba(248, 113, 113, 0.1);
	--error-text: #fecaca;
	--accent: #15bde8;
	--font-sans: 'Inter', ui-sans-serif, system-ui, -apple-system, sans-serif;
	--header-height: 60px;
	--radius: 8px;
	--radius-lg: 12px;
}

html {
	height: 100%;
}

body {
	font-family: var(--font-sans);
	font-size: 14px;
	line-height: 1.5;
	color: var(--text);
	background: var(--bg-app);
	-webkit-font-smoothing: antialiased;
	-moz-osx-font-smoothing: grayscale;
}

a {
	color: var(--primary);
	text-decoration: none;
}

a:hover {
	color: var(--primary-hover);
}

/* ========================================
   Login Page
   ======================================== */

.login-wrapper {
	display: flex;
	justify-content: center;
	align-items: center;
	min-height: 100vh;
	background: #000;
	padding: 1rem;
}

.login-card {
	background: var(--bg-card);
	padding: 2rem;
	border-radius: var(--radius);
	min-width: 260px;
	width: 350px;
}

.login-header {
	text-align: center;
	margin-bottom: 1.5rem;
}

.login-logo {
	max-height: 80px;
	margin: 0 auto;
	display: block;
}

.login-subtitle {
	margin-top: 1rem;
	color: var(--text);
	font-size: 0.95rem;
	font-weight: 500;
}

/* ========================================
   Forms
   ======================================== */

.form-group {
	margin-bottom: 1rem;
}

.form-group:last-of-type {
	margin-bottom: 1.25rem;
}

.form-input {
	width: 100%;
	padding: 0.5rem 0.75rem;
	border-radius: 4px;
	border: 1px solid var(--border-light);
	background: var(--bg-input);
	color: var(--text-white);
	font-family: var(--font-sans);
	font-size: 0.875rem;
	outline: none;
	transition: border-color 0.15s;
}

.form-input:focus {
	border-color: var(--primary);
}

.form-input::placeholder {
	color: var(--text-muted);
}

/* ========================================
   Buttons
   ======================================== */

.btn {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	gap: 0.5rem;
	padding: 0.5rem 1rem;
	border: none;
	border-radius: 4px;
	font-family: var(--font-sans);
	font-size: 0.875rem;
	font-weight: 600;
	cursor: pointer;
	transition:
		background-color 0.15s,
		opacity 0.15s;
	text-decoration: none;
}

.btn:hover {
	opacity: 0.9;
}

.btn-primary {
	background: var(--primary);
	color: var(--text-white);
}

.btn-primary:hover {
	background: var(--primary-hover);
	color: var(--text-white);
}

.btn-outline {
	background: transparent;
	color: var(--text);
	border: 1px solid var(--border);
}

.btn-outline:hover {
	background: var(--bg-muted);
	color: var(--text-white);
}

.btn-sm {
	padding: 0.375rem 0.75rem;
	font-size: 0.8125rem;
}

.btn-full {
	width: 100%;
}

/* ========================================
   Alerts
   ======================================== */

.alert {
	padding: 0.75rem 1rem;
	border-radius: 4px;
	font-size: 0.875rem;
	margin-bottom: 1rem;
}

.alert-error {
	background: var(--error-bg);
	color: var(--error-text);
	border: 1px solid rgba(248, 113, 113, 0.3);
}

.alert-success {
	background: rgba(16, 185, 129, 0.1);
	color: #a7f3d0;
	border: 1px solid rgba(16, 185, 129, 0.3);
}

/* ========================================
   App Layout
   ======================================== */

.app-body {
	display: flex;
	min-height: 100vh;
	flex-direction: column;
}

.app-wrapper {
	display: flex;
	flex-direction: column;
	flex-grow: 1;
}

/* ========================================
   Header
   ======================================== */

.app-header {
	height: var(--header-height);
	background: var(--bg-app);
	border-bottom: 1px solid var(--border);
	display: flex;
	align-items: center;
	flex-shrink: 0;
}

.header-container {
	width: 100%;
	padding: 0 1.5rem;
	display: flex;
	align-items: center;
	gap: 2rem;
}

.header-left {
	display: flex;
	align-items: center;
	gap: 0.75rem;
}

.header-logo-img {
	width: 36px;
	height: 36px;
}

.header-title {
	font-size: 1rem;
	font-weight: 500;
	color: var(--text-white);
	white-space: nowrap;
}

.header-title:hover {
	color: var(--text-white);
}

.header-nav {
	display: flex;
	align-items: center;
	gap: 1.5rem;
	margin-left: 1rem;
}

.nav-link {
	font-size: 0.875rem;
	color: var(--text);
	padding: 0.25rem 0;
	border-bottom: 2px solid transparent;
	transition:
		color 0.15s,
		border-color 0.15s;
}

.nav-link:hover {
	color: var(--text-white);
}

.nav-active {
	color: var(--text-white);
	font-weight: 500;
	border-bottom-color: var(--text-muted);
}

.header-right {
	margin-left: auto;
	display: flex;
	align-items: center;
	gap: 0.75rem;
}

/* ========================================
   Main Content
   ======================================== */

.app-main {
	flex: 1;
	padding: 1.5rem 1rem;
}

.container {
	max-width: 1200px;
	margin: 0 auto;
	display: flex;
	flex-direction: column;
	gap: 1.5rem;
}

/* ========================================
   Page Header
   ======================================== */

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

.page-title {
	font-size: 1.5rem;
	font-weight: 600;
	color: var(--text-white);
	line-height: 1.2;
}

.page-description {
	font-size: 0.875rem;
	color: var(--text-muted);
	margin-top: 0.25rem;
}

.divider {
	border-bottom: 1px solid var(--border);
}

/* ========================================
   Stats Bar
   ======================================== */

.stats-bar {
	display: flex;
	gap: 1.5rem;
	flex-wrap: wrap;
}

.stat-item {
	display: flex;
	align-items: center;
	gap: 0.5rem;
}

.stat-label {
	font-size: 0.8125rem;
	color: var(--text-muted);
}

.stat-value {
	font-size: 0.875rem;
	font-weight: 600;
	color: var(--text-white);
}

.stat-badge {
	font-size: 0.75rem;
	font-weight: 500;
	color: var(--accent);
	background: rgba(21, 189, 232, 0.1);
	padding: 0.125rem 0.5rem;
	border-radius: 999px;
	border: 1px solid rgba(21, 189, 232, 0.2);
}

/* ========================================
   Clusters Grid
   ======================================== */

.clusters-grid {
	display: grid;
	grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
	gap: 1rem;
}

.cluster-card {
	background: var(--bg-card);
	border: 1px solid var(--border);
	border-radius: var(--radius-lg);
	overflow: hidden;
	transition: border-color 0.15s;
}

.cluster-card:hover {
	border-color: var(--border-light);
}

.cluster-card-header {
	padding: 1rem 1.25rem;
	display: flex;
	align-items: center;
	justify-content: space-between;
	border-bottom: 1px solid var(--border);
}

.cluster-card-title {
	font-size: 1rem;
	font-weight: 600;
	color: var(--text-white);
}

.cluster-card-count {
	font-size: 0.75rem;
	font-weight: 500;
	color: var(--text-muted);
	text-transform: uppercase;
	letter-spacing: 0.05em;
}

.cluster-card-body {
	padding: 0.75rem 1.25rem;
}

.domain-list {
	list-style: none;
	display: flex;
	flex-direction: column;
	gap: 0.375rem;
}

.domain-item {
	display: flex;
	align-items: center;
	gap: 0.5rem;
	padding: 0.25rem 0;
}

.domain-dot {
	width: 6px;
	height: 6px;
	border-radius: 50%;
	background: var(--success);
	flex-shrink: 0;
}

.domain-name {
	font-size: 0.8125rem;
	color: var(--text);
	font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
}

/* ========================================
   Empty State
   ======================================== */

.empty-state {
	text-align: center;
	padding: 3rem 1rem;
	color: var(--text-muted);
	font-size: 0.9375rem;
}

/* ========================================
   Footer
   ======================================== */

.app-footer {
	border-top: 1px solid var(--border);
	padding: 1.25rem 1.5rem;
	margin-top: auto;
}

.footer-container {
	max-width: 1200px;
	margin: 0 auto;
	display: flex;
	justify-content: center;
	align-items: center;
	gap: 0.5rem;
	font-size: 0.8125rem;
}

.footer-copyright {
	color: var(--text-muted);
}

.footer-link {
	color: var(--text-secondary);
}

.footer-link:hover {
	color: var(--primary);
}

/* ========================================
   Responsive
   ======================================== */

/* ========================================
   Articles Page
   ======================================== */

.app-main-full {
	padding: 1.5rem 1rem;
	flex: 1;
	display: flex;
	flex-direction: column;
}

.container-full {
	width: 100%;
	max-width: 100%;
	padding: 0 1rem;
	flex: 1;
	display: flex;
	flex-direction: column;
}

.articles-grid {
	flex: 1;
	min-height: 300px;
	border-radius: var(--radius);
	overflow: hidden;
	border: 1px solid var(--border);
}


.page-header-right {
	display: flex;
	align-items: center;
}

.btn-copy {
	padding: 0.25rem 0.625rem;
	border: 1px solid var(--border);
	border-radius: 4px;
	background: transparent;
	color: var(--accent);
	font-family: var(--font-sans);
	font-size: 0.75rem;
	font-weight: 500;
	cursor: pointer;
	transition:
		background 0.15s,
		border-color 0.15s;
}

.btn-copy:hover {
	background: rgba(21, 189, 232, 0.1);
	border-color: var(--accent);
}

.toast {
	position: fixed;
	bottom: 1.5rem;
	right: 1.5rem;
	background: #041a12;
	color: #e9fff5;
	border: 1px solid var(--success);
	border-radius: var(--radius);
	padding: 0.625rem 1rem;
	font-size: 0.8125rem;
	font-weight: 500;
	box-shadow: 0 4px 12px rgba(0, 0, 0, 0.4);
	z-index: 9999;
	animation: toast-pop 0.12s ease-out;
}

.toast.hidden {
	display: none;
}

@keyframes toast-pop {
	0% {
		transform: scale(0.96);
		opacity: 0;
	}
	100% {
		transform: scale(1);
		opacity: 1;
	}
}

/* ========================================
   Responsive
   ======================================== */

@media (max-width: 640px) {
	.header-container {
		padding: 0 1rem;
		gap: 1rem;
	}

	.header-title {
		display: none;
	}

	.clusters-grid {
		grid-template-columns: 1fr;
	}

	.stats-bar {
		flex-direction: column;
		gap: 0.75rem;
	}

	.page-header {
		flex-direction: column;
		align-items: flex-start;
		gap: 1rem;
	}
}
