/**
 * Spectra Auth & Session Styles
 */

/* ==================== USER MENU ==================== */

.user-menu {
	display: flex;
	align-items: center;
	gap: 8px;
	/*margin-right: 10px;*/
}

.sign-in-btn {
	background: rgba(74, 158, 255, 0.1);
	color: #6ab0ff;
	border: 1px solid rgba(74, 158, 255, 0.25);
	padding: 5px 14px;
	border-radius: 2px;
	font-size: 13px;
	cursor: pointer;
	transition: background 0.2s, color 0.2s, border-color 0.2s;
	position: relative;
}

.sign-in-btn:hover {
	background: rgba(74, 158, 255, 0.15);
	border-color: rgba(74, 158, 255, 0.4);
	color: #8ac4ff;
}

.user-menu-logged-in {
	display: inline-block;
	align-items: center;
	gap: 8px;
	position: relative;
}

.start-session-btn {
    background: #222;
    color: #888;
    border: none;
    height: 28px;
    border-radius: 2px;
    cursor: pointer;
    display: inline-block;
    transition: background 0.15s, color 0.15s;
    text-align: center;
    padding: 6px 8px;
    position: relative;
}

.start-session-btn:hover {
	background: #333;
	color: #fff;
}

.user-avatar-btn {
	background: transparent;
	border: none;
	display: flex;
	align-items: center;
	gap: 8px;
	cursor: pointer;
	padding: 4px 8px;
	border-radius: 2px;
	color: #ccc;
}

.user-avatar-btn:hover {
	background: #2a2a2a;
}

.user-avatar {
	width: 28px;
	height: 28px;
	border-radius: 50%;
	background: #3a5a8a;
	background-size: cover;
	background-position: center;
	display: flex;
	align-items: center;
	justify-content: center;
	font-size: 12px;
	font-weight: 600;
	color: #fff;
}

.user-name {
	font-size: 13px;
	max-width: 100px;
	overflow: hidden;
	text-overflow: ellipsis;
	white-space: nowrap;
}

.user-dropdown {
	position: absolute;
	top: 100%;
	right: 0;
	margin-top: 8px;
	background: #1a1a1a;
	border: 1px solid #333;
	border-radius: 2px;
	min-width: 200px;
	box-shadow: 0 4px 20px rgba(0,0,0,0.4);
	z-index: 1000;
	overflow: hidden;
}

.user-dropdown-header {
	padding: 12px 16px;
	border-bottom: 1px solid #333;
}

.user-dropdown-name {
	display: block;
	font-weight: 600;
	color: #fff;
	margin-bottom: 2px;
}

.user-dropdown-email {
	display: block;
	font-size: 12px;
	color: #888;
}

.user-dropdown hr {
	margin: 0;
	border: none;
	border-top: 1px solid #333;
}

.user-dropdown-item {
	display: flex;
	align-items: center;
	gap: 10px;
	width: 100%;
	padding: 12px 16px;
	background: transparent;
	border: none;
	color: #ccc;
	font-size: 14px;
	cursor: pointer;
	text-align: left;
	transition: background 0.2s;
}

.user-dropdown-item:hover {
	background: #2a2a2a;
}

.user-dropdown-item i {
	width: 16px;
	text-align: center;
	color: #888;
}

/* Supporter Badge */
.supporter-badge {
	color: #ffd700;
	font-size: 10px;
	margin-left: 2px;
	margin-right: -2px;
}

/* Support Button */
.user-support-btn {
	text-decoration: none;
}

.user-support-btn i {
	color: #ff6b6b;
}

.user-support-btn:hover i {
	color: #ff8585;
}

.user-support-btn.is-supporter {
	background: rgba(255, 215, 0, 0.08);
}

.user-support-btn.is-supporter i {
	color: #ffd700;
}

/* Session participant supporter dot */
.session-participant-supporter {
	color: #ffd700;
	margin-right: 3px;
	font-size: 11px;
}

/* Remote cursor supporter dot */
.remote-cursor-supporter {
	color: #ffd700;
	margin-right: 2px;
	font-size: 9px;
}

/* ==================== AUTH MODAL ==================== */

.auth-modal {
	position: fixed;
	top: 0;
	left: 0;
	right: 0;
	bottom: 0;
	z-index: 100000;
	overflow-y: auto;
	padding: 40px 20px;
}

.auth-modal.hidden {
	display: none;
}

.auth-modal-backdrop {
	position: fixed;
	top: 0;
	left: 0;
	right: 0;
	bottom: 0;
	background: rgba(0, 0, 0, 0.85);
	z-index: -1;
	pointer-events: none;
}

.auth-modal-content {
	position: relative;
	background: #1a1a1a;
	border: 1px solid #444;
	border-radius: 2px;
	padding: 32px;
	width: 100%;
	max-width: 400px;
	margin: 0 auto;
	box-shadow: 0 8px 32px rgba(0,0,0,0.4);
}

.auth-modal-close {
	position: absolute;
	top: 12px;
	right: 12px;
	background: transparent;
	border: none;
	color: #888;
	font-size: 18px;
	cursor: pointer;
	padding: 8px;
	line-height: 1;
	width: 32px;
	height: 32px;
	border-radius: 2px;
	transition: background 0.15s, color 0.15s;
}

.auth-modal-close:hover {
	background: #2a2a2a;
	color: #fff;
}

.auth-view.hidden {
	display: none;
}

.auth-modal h2 {
	margin: 0 0 24px 0;
	font-size: 24px;
	font-weight: 600;
	color: #fff;
	text-align: center;
}

.auth-oauth-buttons {
	display: flex;
	flex-direction: column;
	gap: 12px;
}

.auth-btn {
	display: flex;
	align-items: center;
	justify-content: center;
	gap: 12px;
	width: 100%;
	padding: 12px 16px;
	border: none;
	border-radius: 2px;
	font-size: 14px;
	font-weight: 500;
	cursor: pointer;
	transition: background 0.15s, color 0.15s;
}

.auth-btn-google {
	background: #fff;
	color: #333;
}

.auth-btn-google:hover {
	background: #f5f5f5;
}

.auth-btn-patreon {
	background: #FF424D;
	color: #fff;
	display: none; /* Hidden for now */
}

.auth-btn-patreon:hover {
	background: #e63946;
}

.auth-btn-primary {
	background: #3a5a8a;
	color: #fff;
}

.auth-btn-primary:hover {
	background: #4a6a9a;
}

.auth-btn-primary:disabled {
	background: #2a3a4a;
	cursor: not-allowed;
}

.auth-btn-secondary {
	background: #2a2a2a;
	color: #ccc;
	border: 1px solid #444;
}

.auth-btn-secondary:hover {
	background: #333;
	color: #fff;
}

.auth-divider {
	display: flex;
	align-items: center;
	margin: 24px 0;
	color: #666;
	font-size: 13px;
}

.auth-divider::before,
.auth-divider::after {
	content: '';
	flex: 1;
	height: 1px;
	background: #333;
}

.auth-divider span {
	padding: 0 16px;
}

.auth-form {
	display: flex;
	flex-direction: column;
	gap: 16px;
}

.auth-field {
	display: flex;
	flex-direction: column;
	gap: 6px;
}

.auth-field label {
	font-size: 13px;
	color: #888;
}

.auth-field input {
	background: #0a0a0a;
	border: 1px solid #333;
	border-radius: 2px;
	padding: 12px 14px;
	color: #fff;
	font-size: 14px;
	transition: border-color 0.2s;
}

.auth-field input:focus {
	outline: none;
	border-color: #3a5a8a;
}

.auth-error {
	color: #e74c3c;
	font-size: 13px;
	min-height: 20px;
}

.auth-switch {
	text-align: center;
	margin-top: 20px;
	font-size: 14px;
	color: #888;
}

.auth-switch-link {
	color: #4a9eff;
	text-decoration: none;
}

.auth-switch-link:hover {
	text-decoration: underline;
}

.auth-verify-message {
	color: #aaa;
	line-height: 1.6;
	margin-bottom: 20px;
}

/* ==================== SESSION MODAL ==================== */
/* Uses unified spectra-overlay design */

.session-modal {
	position: fixed;
	top: 0;
	left: 0;
	right: 0;
	bottom: 0;
	display: flex;
	align-items: center;
	justify-content: center;
	z-index: 10000;
	overflow-y: auto;
	padding: 20px;
}

.session-modal.hidden {
	display: none;
}

.session-modal-backdrop {
	position: fixed;
	top: 0;
	left: 0;
	right: 0;
	bottom: 0;
	background: rgba(0, 0, 0, 0.85);
	z-index: -1;
	pointer-events: none;
}

.session-modal-content {
	position: relative;
	background: #1a1a1a;
	border: 1px solid #333;
	border-radius: 2px;
	padding: 25px;
	width: 100%;
	max-width: 450px;
	box-shadow: 0 4px 24px rgba(0, 0, 0, 0.5);
}

.session-modal-close {
	position: absolute;
	top: 8px;
	right: 8px;
	width: 28px;
	height: 28px;
	background: transparent;
	border: none;
	color: #666;
	font-size: 16px;
	cursor: pointer;
	border-radius: 2px;
	display: flex;
	align-items: center;
	justify-content: center;
	transition: background 0.15s, color 0.15s;
}

.session-modal-close:hover {
	background: #333;
	color: #fff;
}

.session-modal-desc {
	color: #888;
	font-size: 13px;
	margin-bottom: 20px;
}

.session-permissions {
	margin: 20px 0;
}

.session-permissions h3 {
	font-size: 14px;
	color: #aaa;
	margin-bottom: 12px;
}

.session-perm {
	display: flex;
	align-items: center;
	gap: 10px;
	padding: 8px 0;
	cursor: pointer;
	color: #ccc;
	font-size: 14px;
}

.session-perm input {
	accent-color: #3a5a8a;
}

.session-perm input:disabled {
	opacity: 0.5;
}

.session-created {
	text-align: center;
}

.session-created h3 {
	color: #4a9eff;
	margin-bottom: 16px;
}

.session-link-container {
	display: flex;
	gap: 8px;
	margin: 16px 0 24px;
}

.session-link-input {
	flex: 1;
	background: #0a0a0a;
	border: 1px solid #333;
	border-radius: 2px;
	padding: 12px 14px;
	color: #fff;
	font-size: 13px;
}

.session-copy-btn {
	background: #2a2a2a;
	border: 1px solid #444;
	border-radius: 2px;
	padding: 12px 14px;
	color: #ccc;
	cursor: pointer;
	transition: background 0.15s, color 0.15s;
}

.session-copy-btn:hover {
	background: #333;
	color: #fff;
}

/* ==================== RIGHT PANELS CONTAINER ==================== */

.right-panels-container {
	position: absolute;
	top: 59px; /* Below header (25px) + 4 timeline lanes (34px) */
	right: 10px;
	width: 150px;
	z-index: 1001;
	display: flex;
	flex-direction: column;
}

/* ==================== SESSION PANEL ==================== */

.session-panel {
	background: #1a1a1af5;
	border: 1px solid #111;
	border-bottom: none;
	border-radius: 0px;
	/* box-shadow: 0 4px 20px rgba(0,0,0,0.3); */
}

.session-panel.hidden {
	display: none;
}

.session-panel-header {
	display: flex;
	align-items: center;
	justify-content: space-between;
	padding: 6px 12px;
	border-bottom: 1px solid #333;
}

.session-panel-title {
	font-size: 12px;
	font-weight: 600;
	color: #888;
	text-transform: uppercase;
	letter-spacing: 0.5px;
}

.session-panel-leave {
	background: transparent;
	border: none;
	color: #888;
	cursor: pointer;
	padding: 4px;
	transition: color 0.2s;
}

.session-panel-leave:hover {
	color: #e74c3c;
}

.session-panel-info {
	padding: 12px;
}

.session-panel-name {
	font-size: 14px;
	color: #fff;
	margin-bottom: 12px;
	display: none;
}

.session-panel-participants {
	display: flex;
	flex-direction: column;
	gap: 8px;
}

.session-participant {
	display: flex;
	align-items: center;
	gap: 8px;
	font-size: 11px;
}

.session-participant-avatar {
	width: 8px;
	height: 8px;
	border-radius: 50%;
}

.session-participant-name {
	color: #ccc;
}

.session-participant-guest {
	color: #666;
	font-size: 11px;
}

/* ==================== REMOTE CURSORS ==================== */

.remote-cursor {
	position: absolute;
	pointer-events: none;
	z-index: 1000;
	transition: transform 0.1s ease-out;
}

.remote-cursor-pointer {
	width: 0;
	height: 0;
	border-left: 6px solid transparent;
	border-right: 6px solid transparent;
	border-bottom: 10px solid var(--cursor-color, #4a9eff);
	transform: rotate(-45deg);
}

.remote-cursor-label {
	position: absolute;
	top: 12px;
	left: 8px;
	background: var(--cursor-color, #4a9eff);
	color: #fff;
	font-size: 10px;
	padding: 2px 6px;
	border-radius: 2px;
	white-space: nowrap;
}

/* ==================== RESPONSIVE ==================== */

@media (max-width: 600px) {
	.auth-modal,
	.session-modal {
		padding: 20px 12px;
	}
	
	.auth-modal-content,
	.session-modal-content {
		padding: 24px;
	}
	
	.user-name {
		display: none;
	}

	.right-panels-container {
		width: 100%;
		right: 0;
		left: 0;
		top: 0;
	}

	.session-panel {
		border-radius: 0;
	}
}

/* ==================== UTILITIES ==================== */

.hidden {
	display: none !important;
}
