/* ========================================
   UI Components - Buttons, Forms, Cards, etc.
   ======================================== */

/* Import unified design tokens */
@import 'variables.css';

/* Enhanced Button Styles */
.btn-primary {
	background: var(--gradient-primary);
	color: white;
	border: none;
	padding: 12px 24px;
	border-radius: var(--radius-sm);
	font-weight: 600;
	font-size: var(--font-size-base);
	cursor: pointer;
	transition: all 0.3s ease;
	box-shadow: var(--shadow-md);
}

.btn-primary:hover {
	transform: translateY(-2px);
	box-shadow: var(--shadow-lg);
}

.btn-premium {
	background: var(--gradient-hero);
	color: white;
	border: none;
	padding: 16px 32px;
	border-radius: var(--radius-md);
	font-weight: 700;
	font-size: 16px;
	cursor: pointer;
	transition: all 0.3s ease;
	box-shadow: var(--shadow-lg);
	position: relative;
	overflow: hidden;
}

.btn-premium:before {
	content: '';
	position: absolute;
	top: 0;
	left: -100%;
	width: 100%;
	height: 100%;
	background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.3), transparent);
	transition: left 0.6s;
}

.btn-premium:hover:before {
	left: 100%;
}

.btn-premium:hover {
	transform: translateY(-2px);
	box-shadow: var(--shadow-xl);
}

/* Board Buttons */
.board-btn {
	padding: 4px 8px;
	border: 1px solid var(--border-color);
	border-radius: var(--radius-sm);
	background: var(--main-bg);
	color: var(--text-color);
	font-size: var(--font-size-sm);
	cursor: pointer;
	transition: all 0.2s;
}

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

.board-btn.premium {
	background: var(--gradient-hero);
	color: white;
	border: none;
}

/* Control Panel Toggle */
.control-panel-toggle {
	position: fixed;
	left: 10px;
	top: 70px;
	background: var(--main-bg);
	border: 1px solid var(--border-color);
	border-radius: var(--radius-full);
	padding: var(--spacing-sm) var(--spacing-md);
	cursor: pointer;
	z-index: 10001;
	display: flex;
	align-items: center;
	gap: var(--spacing-sm);
	transition: all 0.3s ease;
	box-shadow: var(--shadow-sm);
}

.control-panel-toggle:hover {
	transform: translateX(2px);
	box-shadow: var(--shadow-md);
}

.control-panel-toggle svg {
	width: 16px;
	height: 16px;
}

/* Authentication UI */
.auth-section {
	display: flex;
	align-items: center;
	gap: var(--spacing-md);
}

.user-profile {
	display: flex;
	align-items: center;
	gap: var(--spacing-sm);
	cursor: pointer;
	padding: var(--spacing-xs);
	border-radius: var(--radius-md);
	transition: background-color 0.2s ease;
}

.user-profile:hover {
	background-color: rgba(0, 0, 0, 0.05);
}

.user-avatar {
	width: 32px;
	height: 32px;
	border-radius: var(--radius-full);
	background: var(--gradient-hero);
	display: flex;
	align-items: center;
	justify-content: center;
	color: white;
	font-weight: 600;
	font-size: var(--font-size-base);
}

.user-name {
	font-size: var(--font-size-base);
	font-weight: 500;
	color: var(--text-color);
}

.auth-btn {
	padding: var(--spacing-sm) 20px;
	border-radius: var(--radius-sm);
	font-weight: 500;
	font-size: var(--font-size-base);
	cursor: pointer;
	transition: all 0.2s ease;
	border: none;
}

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

.login-btn:hover {
	background: var(--secondary-bg);
	border-color: var(--text-color);
}

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

.signup-btn:hover {
	background: var(--primary-dark);
	transform: translateY(-1px);
	box-shadow: var(--shadow-md);
}

/* Plan Cards */
.plan-card {
	background: var(--main-bg);
	border: 1px solid var(--border-color);
	border-radius: var(--radius-lg);
	padding: var(--spacing-xl);
	text-align: center;
	transition: all 0.3s ease;
	position: relative;
	height: 100%;
	display: flex;
	flex-direction: column;
	backdrop-filter: blur(10px);
}

.plan-card:hover {
	transform: translateY(-3px);
	box-shadow: var(--shadow-lg);
	border-color: var(--primary-color);
}

.plan-card.featured {
	border: 2px solid var(--primary-color);
	background: linear-gradient(135deg, rgba(16, 163, 127, 0.05), rgba(16, 163, 127, 0.02));
	box-shadow: var(--shadow-xl);
}

.plan-badge {
	position: absolute;
	top: -12px;
	left: 50%;
	transform: translateX(-50%);
	background: var(--primary-color);
	color: white;
	padding: var(--spacing-xs) 16px;
	border-radius: var(--radius-lg);
	font-size: 11px;
	font-weight: 600;
	letter-spacing: 0.5px;
	text-transform: uppercase;
	box-shadow: var(--shadow-sm);
}

.plan-price {
	font-size: 42px;
	font-weight: 700;
	margin: 16px 0;
	color: var(--primary-color);
	line-height: 1;
}

.plan-features {
	list-style: none;
	padding: 0;
	margin: 16px 0;
	text-align: left;
	flex-grow: 1;
}

.plan-features li {
	padding: var(--spacing-xs) 0;
	display: flex;
	align-items: center;
	gap: var(--spacing-sm);
	font-size: 13px;
	color: var(--text-color);
	border-bottom: 1px solid rgba(0, 0, 0, 0.05);
}

.plan-features li:last-child {
	border-bottom: none;
}

.plan-features .check {
	color: var(--primary-color);
	font-weight: 600;
	font-size: 14px;
}

.plan-features .cross {
	color: var(--text-muted-color);
	font-weight: 500;
	font-size: 14px;
}

/* ========================================
   Top Status Bar - Sync & Participants
   ======================================== */
.top-status-bar {
	position: fixed;
	top: 12px;
	right: 12px;
	display: flex;
	align-items: center;
	gap: 12px;
	padding: 8px 12px;
	background: var(--bg-secondary, rgba(255, 255, 255, 0.9));
	backdrop-filter: blur(10px);
	-webkit-backdrop-filter: blur(10px);
	border: 1px solid var(--border-color, rgba(0, 0, 0, 0.1));
	border-radius: 12px;
	box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
	z-index: 1000;
	font-size: 13px;
}

.sync-status {
	display: flex;
	align-items: center;
	gap: 6px;
	color: var(--text-secondary, #666);
}

.sync-status .sync-icon {
	font-size: 18px;
	transition: color 0.3s ease;
}

.sync-status .sync-icon.synced {
	color: #10B981;
}

.sync-status .sync-icon.syncing {
	color: #3B82F6;
	animation: spin 1s linear infinite;
}

.sync-status .sync-icon.offline {
	color: #9CA3AF;
}

.sync-status .sync-icon.error {
	color: #EF4444;
}

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

.sync-status .sync-label {
	color: var(--text-muted, #888);
	font-size: 12px;
}

.participants-indicator {
	display: flex;
	align-items: center;
	gap: 8px;
	padding-left: 12px;
	border-left: 1px solid var(--border-color, rgba(0, 0, 0, 0.1));
}

.participant-avatars {
	display: flex;
	align-items: center;
}

.participant-avatars .avatar {
	width: 24px;
	height: 24px;
	border-radius: 50%;
	background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
	border: 2px solid var(--bg-secondary, #fff);
	margin-left: -8px;
	display: flex;
	align-items: center;
	justify-content: center;
	font-size: 11px;
	color: white;
	font-weight: 600;
}

.participant-avatars .avatar:first-child {
	margin-left: 0;
}

.participant-count {
	color: var(--text-muted, #888);
	font-size: 12px;
}

.share-btn {
	display: flex;
	align-items: center;
	justify-content: center;
	width: 32px;
	height: 32px;
	border: none;
	background: var(--primary-color, #10a37f);
	color: white;
	border-radius: 8px;
	cursor: pointer;
	transition: all 0.2s ease;
}

.share-btn:hover {
	background: var(--primary-hover, #0d8a6a);
	transform: scale(1.05);
}

.share-btn .material-icons {
	font-size: 18px;
}

/* ========================================
   Share Modal
   ======================================== */
.share-modal-overlay {
	position: fixed;
	top: 0;
	left: 0;
	right: 0;
	bottom: 0;
	background: rgba(0, 0, 0, 0.5);
	backdrop-filter: blur(4px);
	-webkit-backdrop-filter: blur(4px);
	display: none;
	align-items: center;
	justify-content: center;
	z-index: 10000;
	opacity: 0;
	transition: opacity 0.3s ease;
}

.share-modal-overlay.show {
	display: flex;
	opacity: 1;
}

.share-modal {
	background: var(--bg-primary, #fff);
	border-radius: 16px;
	box-shadow: 0 20px 40px rgba(0, 0, 0, 0.2);
	width: 90%;
	max-width: 480px;
	max-height: 90vh;
	overflow: hidden;
	transform: scale(0.95);
	transition: transform 0.3s ease;
}

.share-modal-overlay.show .share-modal {
	transform: scale(1);
}

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

.share-modal-header h3 {
	margin: 0;
	font-size: 18px;
	font-weight: 600;
	color: var(--text-primary, #1f2937);
}

.share-modal-close {
	display: flex;
	align-items: center;
	justify-content: center;
	width: 32px;
	height: 32px;
	border: none;
	background: transparent;
	color: var(--text-secondary, #6b7280);
	border-radius: 8px;
	cursor: pointer;
	transition: all 0.2s ease;
}

.share-modal-close:hover {
	background: var(--hover-bg, #f3f4f6);
	color: var(--text-primary, #1f2937);
}

.share-modal-body {
	padding: 24px;
	overflow-y: auto;
	max-height: calc(90vh - 160px);
}

.share-section {
	margin-bottom: 24px;
}

.share-section:last-child {
	margin-bottom: 0;
}

.share-section-header {
	display: flex;
	align-items: center;
	gap: 8px;
	margin-bottom: 12px;
	font-weight: 600;
	color: var(--text-primary, #1f2937);
}

.share-section-header .material-icons {
	font-size: 20px;
	color: var(--text-secondary, #6b7280);
}

.share-link-row {
	display: flex;
	gap: 8px;
}

.share-link-input {
	flex: 1;
	padding: 10px 14px;
	border: 1px solid var(--border-color, #e5e7eb);
	border-radius: 8px;
	font-size: 13px;
	font-family: monospace;
	background: var(--bg-secondary, #f9fafb);
	color: var(--text-primary, #1f2937);
}

.share-copy-btn {
	display: flex;
	align-items: center;
	justify-content: center;
	width: 42px;
	height: 42px;
	border: 1px solid var(--border-color, #e5e7eb);
	background: var(--bg-primary, #fff);
	border-radius: 8px;
	cursor: pointer;
	transition: all 0.2s ease;
	color: var(--text-secondary, #6b7280);
}

.share-copy-btn:hover {
	background: var(--hover-bg, #f3f4f6);
	color: var(--primary-color, #10a37f);
}

.share-toggle-row {
	display: flex;
	align-items: center;
	gap: 12px;
	padding: 8px 0;
}

.share-toggle {
	position: relative;
	width: 44px;
	height: 24px;
	cursor: pointer;
}

.share-toggle input {
	opacity: 0;
	width: 0;
	height: 0;
}

.toggle-slider {
	position: absolute;
	top: 0;
	left: 0;
	right: 0;
	bottom: 0;
	background: var(--bg-tertiary, #e5e7eb);
	border-radius: 12px;
	transition: all 0.3s ease;
}

.toggle-slider:before {
	content: '';
	position: absolute;
	width: 20px;
	height: 20px;
	left: 2px;
	top: 2px;
	background: white;
	border-radius: 50%;
	transition: all 0.3s ease;
	box-shadow: 0 1px 3px rgba(0, 0, 0, 0.2);
}

.share-toggle input:checked + .toggle-slider {
	background: var(--primary-color, #10a37f);
}

.share-toggle input:checked + .toggle-slider:before {
	transform: translateX(20px);
}

.toggle-label {
	color: var(--text-secondary, #6b7280);
	font-size: 14px;
}

.share-permission-select {
	width: 100%;
	padding: 10px 14px;
	border: 1px solid var(--border-color, #e5e7eb);
	border-radius: 8px;
	font-size: 14px;
	background: var(--bg-primary, #fff);
	color: var(--text-primary, #1f2937);
	cursor: pointer;
}

.participants-list {
	display: flex;
	flex-direction: column;
	gap: 8px;
}

.participant-item {
	display: flex;
	align-items: center;
	gap: 12px;
	padding: 10px 12px;
	background: var(--bg-secondary, #f9fafb);
	border-radius: 10px;
}

.participant-item .participant-avatar {
	width: 36px;
	height: 36px;
	border-radius: 50%;
	background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
	display: flex;
	align-items: center;
	justify-content: center;
	color: white;
}

.participant-item .participant-avatar .material-icons {
	font-size: 20px;
}

.participant-info {
	flex: 1;
}

.participant-name {
	display: block;
	font-weight: 500;
	color: var(--text-primary, #1f2937);
	font-size: 14px;
}

.participant-role {
	display: block;
	font-size: 12px;
	color: var(--text-muted, #9ca3af);
}

.share-modal-footer {
	padding: 16px 24px;
	border-top: 1px solid var(--border-color, #e5e7eb);
	display: flex;
	justify-content: flex-end;
}

.share-done-btn {
	padding: 10px 24px;
	background: var(--primary-color, #10a37f);
	color: white;
	border: none;
	border-radius: 8px;
	font-size: 14px;
	font-weight: 500;
	cursor: pointer;
	transition: all 0.2s ease;
}

.share-done-btn:hover {
	background: var(--primary-hover, #0d8a6a);
}

/* Dark mode support */
@media (prefers-color-scheme: dark) {
	.top-status-bar {
		background: rgba(30, 30, 30, 0.9);
		border-color: rgba(255, 255, 255, 0.1);
	}

	.share-modal {
		background: #1e1e1e;
	}

	.share-modal-header {
		border-color: rgba(255, 255, 255, 0.1);
	}

	.share-link-input {
		background: #2a2a2a;
		border-color: rgba(255, 255, 255, 0.1);
		color: #fff;
	}

	.participant-item {
		background: #2a2a2a;
	}
}

/* Dark mode class support */
.dark .top-status-bar,
[data-theme="dark"] .top-status-bar {
	background: rgba(30, 30, 30, 0.9);
	border-color: rgba(255, 255, 255, 0.1);
}

.dark .share-modal,
[data-theme="dark"] .share-modal {
	background: #1e1e1e;
}

.dark .share-modal-header,
[data-theme="dark"] .share-modal-header {
	border-color: rgba(255, 255, 255, 0.1);
}

.dark .share-link-input,
[data-theme="dark"] .share-link-input {
	background: #2a2a2a;
	border-color: rgba(255, 255, 255, 0.1);
	color: #fff;
}

.dark .participant-item,
[data-theme="dark"] .participant-item {
	background: #2a2a2a;
}

