/**
 * Translation System Styles
 * Language Switcher and Translation UI
 */

/* Language Switcher Container */
.ai-outils-language-switcher {
	position: relative;
	display: inline-block;
	margin-left: 15px;
}

/* Language Switcher Toggle Button */
.language-switcher-toggle {
	display: flex;
	align-items: center;
	gap: 6px;
	padding: 8px 12px;
	background: transparent;
	border: 1px solid rgba(255, 255, 255, 0.3);
	border-radius: 6px;
	color: #fff;
	font-size: 14px;
	font-weight: 500;
	cursor: pointer;
	transition: all 0.2s ease;
	white-space: nowrap;
}

.language-switcher-toggle:hover {
	background: rgba(255, 255, 255, 0.1);
	border-color: rgba(255, 255, 255, 0.5);
}

.language-switcher-toggle[aria-expanded="true"] {
	background: rgba(255, 255, 255, 0.15);
}

.current-language-flag {
	font-size: 18px;
	line-height: 1;
}

.current-language-code {
	font-size: 13px;
	letter-spacing: 0.5px;
}

.language-switcher-arrow {
	transition: transform 0.2s ease;
	margin-left: 2px;
}

.language-switcher-toggle[aria-expanded="true"] .language-switcher-arrow {
	transform: rotate(180deg);
}

/* Language Dropdown */
.language-switcher-dropdown {
	position: absolute;
	top: calc(100% + 8px);
	right: 0;
	background: #fff;
	border-radius: 8px;
	box-shadow: 0 4px 20px rgba(0, 0, 0, 0.15);
	min-width: 180px;
	opacity: 0;
	visibility: hidden;
	transform: translateY(-10px);
	transition: all 0.2s ease;
	z-index: 1000;
	overflow: hidden;
}

.language-switcher-dropdown.active {
	opacity: 1;
	visibility: visible;
	transform: translateY(0);
}

.language-option {
	display: flex;
	align-items: center;
	width: 100%;
	padding: 12px 16px;
	background: transparent;
	border: none;
	text-align: left;
	cursor: pointer;
	transition: background 0.15s ease;
	font-size: 14px;
	color: #333;
	gap: 10px;
}

.language-option:hover {
	background: #f5f5f5;
}

.language-option.active {
	background: #f0f7ff;
	color: #0066cc;
	font-weight: 500;
}

.language-flag {
	font-size: 20px;
	line-height: 1;
	width: 24px;
	text-align: center;
}

.language-name {
	flex: 1;
}

.check-icon {
	margin-left: auto;
	color: #0066cc;
}

/* Header Solid State (non-homepage) */
.header-solid .language-switcher-toggle {
	border-color: rgba(0, 0, 0, 0.2);
	color: #333;
}

.header-solid .language-switcher-toggle:hover {
	background: rgba(0, 0, 0, 0.05);
	border-color: rgba(0, 0, 0, 0.3);
}

.header-solid .language-switcher-toggle[aria-expanded="true"] {
	background: rgba(0, 0, 0, 0.08);
}

/* Mobile Responsive */
@media (max-width: 768px) {
	/* Ensure header-actions container is visible on mobile */
	.header-actions {
		display: flex !important;
		align-items: center;
		gap: 8px;
		flex-wrap: nowrap;
		order: 2; /* Before hamburger menu */
		margin-left: auto;
		margin-right: 12px;
	}
	
	.ai-outils-language-switcher {
		margin-left: 0;
		margin-right: 0;
		display: inline-block !important; /* Always visible on mobile */
	}
	
	.language-switcher-toggle {
		padding: 8px 10px;
		font-size: 13px;
		min-width: 50px;
		border-width: 1.5px;
	}
	
	.current-language-code {
		display: inline-block; /* Show code on mobile too */
		font-size: 11px;
		font-weight: 600;
	}
	
	.current-language-flag {
		font-size: 16px;
	}
	
	.language-switcher-dropdown {
		right: 0;
		left: auto;
		min-width: 160px;
		position: fixed; /* Better positioning on mobile */
		z-index: 10000;
		box-shadow: 0 8px 24px rgba(0, 0, 0, 0.2);
	}
	
	/* Hide other header actions on mobile but keep language switcher */
	.header-actions .search-icon-link,
	.header-actions .login-link,
	.header-actions .join-button,
	.header-actions .dashboard-link,
	.header-actions .logout-link {
		display: none !important;
	}
	
	/* Ensure language switcher is always visible */
	.header-actions .ai-outils-language-switcher {
		display: inline-block !important;
		visibility: visible !important;
		opacity: 1 !important;
	}
	
	/* Ensure logo stays on left */
	.site-branding {
		order: 1 !important;
		flex: 0 0 auto !important;
		margin-right: auto !important;
	}
	
	/* Ensure hamburger is on far right */
	.main-navigation {
		order: 3 !important;
		flex: 0 0 auto !important;
	}
}

/* Google Translate Widget Hiding */
.goog-te-banner-frame {
	display: none !important;
}

body {
	top: 0 !important;
}

.goog-te-menu-frame {
	max-width: 100% !important;
}

/* Skip Google Translate Links */
.goog-te-gadget-simple {
	display: none !important;
}

/* Translation Loading State */
[data-translate="true"].translating {
	opacity: 0.6;
	pointer-events: none;
}

/* Accessibility */
.language-switcher-toggle:focus,
.language-option:focus {
	outline: 2px solid #0066cc;
	outline-offset: 2px;
}

/* Screen Reader Text */
.screen-reader-text {
	clip: rect(1px, 1px, 1px, 1px);
	position: absolute !important;
	height: 1px;
	width: 1px;
	overflow: hidden;
}
