/* Auto Translator - Frontend Language Switcher */

/* ==============================
   SVG Flag
   ============================== */
.at-flag-svg {
	width: 24px;
	height: auto;
	border-radius: 3px;
	vertical-align: middle;
	flex-shrink: 0;
}

/* ==============================
   Floating Switcher (base)
   ============================== */
.at-switcher {
	font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
	font-size: 14px;
	line-height: 1.5;
}

.at-switcher:not(.at-inline) {
	position: fixed;
	z-index: 999999;
}

/* Position variants */
.at-position-bottom-right { bottom: 24px; right: 24px; }
.at-position-bottom-left  { bottom: 24px; left: 24px; }
.at-position-top-right    { top: 24px; right: 24px; }
.at-position-top-left     { top: 24px; left: 24px; }

/* ==============================
   Toggle button
   ============================== */
.at-switcher-toggle {
	display: flex;
	align-items: center;
	gap: 8px;
	padding: 10px 16px;
	background: #1a1a2e;
	color: #ffffff;
	border: none;
	border-radius: 50px;
	cursor: pointer;
	box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2);
	transition: all 0.3s ease;
	user-select: none;
}

.at-switcher-toggle:hover {
	background: #16213e;
	box-shadow: 0 6px 20px rgba(0, 0, 0, 0.3);
	transform: translateY(-2px);
}

.at-switcher-toggle .at-flag-svg {
	width: 20px;
}

.at-current-lang {
	font-size: 13px;
	font-weight: 500;
	white-space: nowrap;
}

.at-chevron {
	width: 12px;
	height: 12px;
	opacity: 0.7;
	transition: transform 0.2s ease;
	flex-shrink: 0;
}

.at-switcher.at-open .at-chevron {
	transform: rotate(180deg);
}

/* Flag-only mode: compact toggle */
.at-display-flag_only .at-switcher-toggle {
	padding: 10px 12px;
}

/* ==============================
   Dropdown
   ============================== */
.at-switcher-dropdown {
	display: none;
	position: absolute;
	background: #ffffff;
	border-radius: 12px;
	box-shadow: 0 8px 30px rgba(0, 0, 0, 0.15);
	min-width: 180px;
	overflow: hidden;
	animation: atFadeIn 0.2s ease;
}

/* Flag-only dropdown: narrower */
.at-display-flag_only .at-switcher-dropdown {
	min-width: 60px;
}

/* Dropdown position */
.at-position-bottom-right .at-switcher-dropdown,
.at-position-bottom-left .at-switcher-dropdown {
	bottom: calc(100% + 8px);
}

.at-position-top-right .at-switcher-dropdown,
.at-position-top-left .at-switcher-dropdown {
	top: calc(100% + 8px);
}

.at-position-bottom-right .at-switcher-dropdown,
.at-position-top-right .at-switcher-dropdown {
	right: 0;
}

.at-position-bottom-left .at-switcher-dropdown,
.at-position-top-left .at-switcher-dropdown {
	left: 0;
}

.at-switcher.at-open .at-switcher-dropdown {
	display: block;
}

/* ==============================
   Language option (shared)
   ============================== */
.at-lang-option {
	display: flex;
	align-items: center;
	gap: 10px;
	padding: 12px 16px;
	color: #333333;
	text-decoration: none;
	transition: background 0.15s ease;
	border-bottom: 1px solid #f0f0f0;
}

.at-lang-option:last-child {
	border-bottom: none;
}

.at-lang-option:hover {
	background: #f5f5f5;
	color: #333333;
	text-decoration: none;
}

.at-lang-option.at-active {
	background: #eef2ff;
	color: #1a1a2e;
	font-weight: 600;
}

.at-lang-option .at-flag {
	display: inline-flex;
	align-items: center;
	line-height: 1;
}

.at-lang-option .at-flag .at-flag-svg {
	width: 22px;
}

.at-lang-option .at-lang-label {
	white-space: nowrap;
}

/* Flag-only mode options */
.at-display-flag_only .at-lang-option {
	justify-content: center;
	padding: 10px 14px;
	gap: 0;
}

/* Text-only mode */
.at-display-text_only .at-lang-option {
	gap: 0;
}

/* ==============================
   Inline layout (shortcode / Elementor)
   ============================== */
.at-inline {
	display: inline-block;
	position: relative;
}

.at-inline .at-switcher-dropdown {
	position: absolute;
	top: calc(100% + 6px);
	left: 0;
	bottom: auto;
}

.at-inline .at-switcher-toggle {
	background: #f0f0f1;
	color: #1d2327;
	box-shadow: none;
	border: 1px solid #ccc;
	padding: 6px 12px;
	font-size: 13px;
}

.at-inline .at-switcher-toggle:hover {
	background: #e0e0e0;
	transform: none;
	box-shadow: none;
}

/* Inline horizontal layout */
.at-layout-inline .at-inline-options {
	display: flex;
	align-items: center;
	gap: 8px;
	flex-wrap: wrap;
}

.at-layout-inline .at-lang-option {
	display: inline-flex;
	align-items: center;
	gap: 6px;
	padding: 6px 12px;
	border-radius: 6px;
	border-bottom: none;
	color: #555;
	text-decoration: none;
	transition: all 0.15s ease;
	font-size: 13px;
}

.at-layout-inline .at-lang-option:hover {
	background: #f0f0f0;
}

.at-layout-inline .at-lang-option.at-active {
	background: #1a1a2e;
	color: #fff;
	font-weight: 500;
}

.at-layout-inline .at-lang-option.at-active:hover {
	background: #16213e;
}

/* Flag-only inline: tighter */
.at-layout-inline.at-display-flag_only .at-lang-option {
	padding: 6px 8px;
	gap: 0;
}

/* ==============================
   Animation
   ============================== */
@keyframes atFadeIn {
	from {
		opacity: 0;
		transform: translateY(8px);
	}
	to {
		opacity: 1;
		transform: translateY(0);
	}
}

/* ==============================
   Mobile responsive
   ============================== */
@media (max-width: 480px) {
	.at-switcher:not(.at-inline) {
		bottom: 16px !important;
		right: 16px !important;
		left: auto !important;
		top: auto !important;
	}

	.at-switcher:not(.at-inline) .at-current-lang {
		display: none;
	}

	.at-switcher:not(.at-inline) .at-switcher-toggle {
		padding: 12px;
		border-radius: 50%;
	}

	.at-switcher:not(.at-inline) .at-switcher-dropdown {
		right: 0;
		left: auto;
		bottom: calc(100% + 8px);
		top: auto;
		min-width: 160px;
	}
}
