/* public/styles.css */
:root {
	--primary: #6366f1;
	--primary-dark: #4f46e5;
	--success: #22c55e;
	--danger: #ef4444;
	--warning: #f59e0b;
	--telegram: #0088cc;
	--background: #0f172a;
	--surface: #1e293b;
	--surface-light: #334155;
	--text: #f1f5f9;
	--text-muted: #f8f7f7;
	--border: #475569;
}

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

body {
	font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen,
		Ubuntu, sans-serif;
	background: var(--background);
	color: var(--text);
	min-height: 100vh;
	line-height: 1.6;
}

.container {
	max-width: 1200px;
	margin: 0 auto;
  padding: 0 20px;
}

/* ============ LOADING PAGE ============ */
.loading-page {
	min-height: 100vh;
	display: flex;
	align-items: center;
	justify-content: center;
	background: var(--background);
}

.loading-content {
	text-align: center;
	color: var(--text-muted);
}

.loading-icon {
	font-size: 3rem;
	color: var(--primary);
	margin-bottom: 20px;
	animation: pulse 2s infinite;
}

.loading-spinner {
	width: 40px;
	height: 40px;
	border: 3px solid var(--surface-light);
	border-top-color: var(--primary);
	border-radius: 50%;
	margin: 20px auto;
	animation: spin 1s linear infinite;
}

.loading-content p {
	font-size: 1rem;
	color: var(--text-muted);
}

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

@keyframes pulse {
	0%,
	100% {
		opacity: 1;
	}
	50% {
		opacity: 0.5;
	}
}

/* ============ AUTH PAGE ============ */
.auth-page {
	min-height: 100vh;
	display: flex;
	align-items: center;
	justify-content: center;
	padding: 20px;
}

.auth-card {
	background: var(--surface);
	border-radius: 16px;
	padding: 40px;
	width: 100%;
	max-width: 450px;
	box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.5);
}

.auth-header {
	text-align: center;
	margin-bottom: 30px;
}

.auth-icon {
	font-size: 3rem;
	color: var(--primary);
	margin-bottom: 15px;
}

.auth-header h1 {
	font-size: 1.8rem;
	margin-bottom: 8px;
}

.auth-header p {
	color: var(--text-muted);
}

.auth-methods {
	display: flex;
	flex-direction: column;
	gap: 25px;
}

.auth-method {
	text-align: center;
}

.auth-method h3 {
	font-size: 1.1rem;
	margin-bottom: 10px;
	display: flex;
	align-items: center;
	justify-content: center;
	gap: 8px;
}

.auth-method p {
	color: var(--text-muted);
	font-size: 0.9rem;
	margin-bottom: 15px;
}

.auth-method code {
	background: var(--surface-light);
	padding: 2px 8px;
	border-radius: 4px;
	font-family: monospace;
}

.code-input-group {
	display: flex;
	gap: 10px;
	justify-content: center;
}

.code-input-group input {
	width: 150px;
	padding: 15px;
	font-size: 1.2rem;
	text-align: center;
	letter-spacing: 8px;
	border: 2px solid var(--border);
	border-radius: 8px;
	background: var(--background);
	color: var(--text);
	font-family: monospace;
}

.code-input-group input:focus {
	outline: none;
	border-color: var(--primary);
}

.auth-divider {
	display: flex;
	align-items: center;
	gap: 15px;
	color: var(--text-muted);
}

.auth-divider::before,
.auth-divider::after {
	content: '';
	flex: 1;
	height: 1px;
	background: var(--border);
}

.btn-telegram {
	background: var(--telegram);
	color: white;
	width: 100%;
	padding: 15px;
	font-size: 1rem;
	text-decoration: none;
	display: inline-flex;
	align-items: center;
	justify-content: center;
	gap: 10px;
}

.btn-telegram:hover {
	opacity: 0.9;
}

.error-message {
	color: var(--danger);
	font-size: 0.9rem;
	margin-top: 10px;
	min-height: 20px;
}

/* ============ HEADER ============ */
header {
	display: flex;
	justify-content: space-between;
	align-items: center;
	padding: 20px 0;
	border-bottom: 1px solid var(--border);
	margin-bottom: 30px;
	flex-wrap: wrap;
	gap: 20px;
}

header h1 {
	font-size: 1.8rem;
	display: flex;
	align-items: center;
	gap: 10px;
}

header h1 i {
	color: var(--primary);
}

.user-info {
	display: flex;
	align-items: center;
	gap: 15px;
}

.user-info span {
	color: var(--text-muted);
}

/* ============ BUTTONS ============ */
.btn {
	padding: 10px 20px;
	border: none;
	border-radius: 8px;
	cursor: pointer;
	font-weight: 500;
	display: inline-flex;
	align-items: center;
	justify-content: center;
	gap: 8px;
	transition: all 0.2s;
	text-decoration: none;
}

.btn-sm {
	padding: 6px 12px;
	font-size: 0.9rem;
}

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

.btn-primary:hover {
	background: var(--primary-dark);
}

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

.btn-success:hover {
	opacity: 0.9;
}

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

.btn-secondary {
	background: var(--surface-light);
	color: var(--text);
}

.btn-lg {
	padding: 15px 30px;
	font-size: 1.1rem;
}

/* ============ STATS ============ */
.stats-section {
	display: grid;
	grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
	gap: 20px;
	margin-bottom: 30px;
}

.stat-card {
	background: var(--surface);
	padding: 20px;
	border-radius: 12px;
	display: flex;
	align-items: center;
	gap: 15px;
}

.stat-card i {
	font-size: 2rem;
	color: var(--primary);
}

.stat-content {
	display: flex;
	flex-direction: column;
}

.stat-value {
	font-size: 1.5rem;
	font-weight: bold;
}

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

/* ============ SUBSCRIPTIONS ============ */
.actions-section {
	margin-bottom: 30px;
	text-align: center;
}

.subscriptions-section h2 {
	margin-bottom: 20px;
	display: flex;
	align-items: center;
	gap: 10px;
}

.subscriptions-list {
	display: grid;
	gap: 15px;
  padding: 20px 0;
}

.subscription-card {
	background: var(--surface);
	border-radius: 12px;
	padding: 20px;
	display: flex;
	justify-content: space-between;
	align-items: center;
	transition: transform 0.2s;
}

.subscription-card:hover {
	transform: translateY(-2px);
}

.subscription-card.inactive {
	opacity: 0.6;
}

.subscription-info {
	display: flex;
	align-items: center;
	gap: 15px;
}

.subscription-icon {
	width: 50px;
	height: 50px;
	border-radius: 12px;
	background: var(--primary);
	display: flex;
	align-items: center;
	justify-content: center;
	font-size: 1.5rem;
}

.subscription-details h3 {
	margin-bottom: 5px;
}

.subscription-meta {
	color: var(--text-muted);
	font-size: 0.9rem;
	display: flex;
	gap: 15px;
	flex-wrap: wrap;
}

.subscription-amount {
	font-size: 1.3rem;
	font-weight: bold;
	color: var(--success);
}

.subscription-actions {
	display: flex;
	gap: 10px;
}

.subscription-actions button {
	padding: 8px 12px;
	font-size: 0.9rem;
}

.urgency-badge {
	padding: 4px 8px;
	border-radius: 4px;
	font-size: 0.8rem;
	font-weight: 500;
}

.urgency-badge.urgent {
	background: var(--danger);
}

.urgency-badge.warning {
	background: var(--warning);
}

.urgency-badge.normal {
	background: var(--success);
}

/* ============ MODAL ============ */
.modal {
	display: none;
	position: fixed;
	top: 0;
	left: 0;
	width: 100%;
	height: 100%;
	background: rgba(0, 0, 0, 0.7);
	z-index: 1000;
	align-items: center;
	justify-content: center;
}

.modal.active {
	display: flex;
}

.modal-content {
	background: var(--surface);
	border-radius: 16px;
	width: 90%;
	max-width: 500px;
	max-height: 90vh;
	overflow-y: auto;
}

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

.close-btn {
	background: none;
	border: none;
	color: var(--text);
	font-size: 1.5rem;
	cursor: pointer;
}

form {
	padding: 20px;
}

.form-group {
	margin-bottom: 20px;
}

.form-row {
	display: grid;
	grid-template-columns: 1fr 1fr;
	gap: 15px;
}

label {
	display: block;
	margin-bottom: 8px;
	color: var(--text-muted);
}

input,
select,
textarea {
	width: 100%;
	padding: 12px;
	border: 1px solid var(--border);
	border-radius: 8px;
	background: var(--background);
	color: var(--text);
	font-size: 1rem;
}

input:focus,
select:focus,
textarea:focus {
	outline: none;
	border-color: var(--primary);
}

textarea {
	resize: vertical;
	min-height: 80px;
}

.checkbox-label {
	display: flex;
	align-items: center;
	gap: 10px;
	cursor: pointer;
}

.checkbox-label input {
	width: auto;
}

.modal-footer {
	display: flex;
	justify-content: flex-end;
	gap: 10px;
	padding-top: 20px;
	border-top: 1px solid var(--border);
}

.empty-state {
	text-align: center;
	padding: 60px 20px;
	color: var(--text-muted);
}

.empty-state i {
	font-size: 4rem;
	margin-bottom: 20px;
	opacity: 0.5;
}

.loading {
	text-align: center;
	padding: 40px;
	color: var(--text-muted);
}

@media (max-width: 768px) {
	.form-row {
		grid-template-columns: 1fr;
	}

	.subscription-card {
		flex-direction: column;
		align-items: flex-start;
		gap: 15px;
	}

	.subscription-actions {
		width: 100%;
		justify-content: flex-end;
	}

	.code-input-group {
		flex-direction: column;
		align-items: stretch;
	}

	.code-input-group input {
		width: 100%;
	}
}
