@import '../variables.less';

@media screen {
	.mw-echo-alert {
		display: block;
		padding: 0.25em 1em;
		margin: 0 -1em;
	}

	/* Handle and position Echo icons */

	#personal h2,
	#personal-extra,
	#personal-extra ul,
	#personal-extra li {
		display: inline-block;
	}

	#personal-extra {
		// Position and keep it from randomly overflowing massively for no apparent reason
		margin: 0.7em 0 -2em 0;
		white-space: nowrap;

		ul {
			list-style: none;
			margin: 0 -1em 0 0;
			padding: 0;
		}

		li {
			margin: 0 0.75em 0 0;
			float: left;
		}
	}

	@media ( min-width: @desktop-small-floor ) {
		// Prevent echo badge labels from overflowing over this
		// since they're just color:transparent and still right there
		#personal {
			position: relative;
			z-index: 5;
		}

		#personal-extra {
			float: left;
			margin-left: -4.5em;
		}

		.extension-icons {
			#p-search {
				margin-right: 21em;
			}
		}

		#mw-page-header-links #ca-more,
		#mw-page-header-links #ca-languages,
		.sidebar-chunk h2 {
			display: none;
		}
	}

	@media ( min-width: @desktop-small-floor ) and ( max-width: @desktop-small-width ) {
		.extension-icons #p-search {
			margin-right: 11em;
		}

		#personal-extra {
			margin-left: -2.5em;
		}
	}

	@media ( min-width: @desktop-mid-floor ) and ( max-width: @desktop-mid-width ) {
		.extension-icons {
			#user-tools {
				width: auto;
			}

			.color-middle {
				margin-right: @column-left-size + 2 * @content-padding + 4em;
			}
		}
	}

	@media ( max-width: @mobile-width ) {
		.mw-echo-ui-notificationBadgeButtonPopupWidget {
			z-index: 2;
		}

		#personal-extra {
			position: absolute;
			top: 0.9em;
			right: 11.75em;

			li {
				margin-right: 1.25em;
			}
		}

		/* Temporary hack:
		 * Make notifications visible. !important is for overriding echo's inline styles.
		 * Remove all of this once the underlying OOUI issue is fixed in general for mobile displays.
		 */
		.mw-echo-ui-overlay {
			margin: 0 10px;

			.oo-ui-popupWidget-anchored > .oo-ui-popupWidget-anchor {
				display: none;
			}

			.mw-echo-ui-notificationBadgeButtonPopupWidget-popup {
				left: 0 !important;
				width: 100%;

				.oo-ui-popupWidget-popup {
					width: initial !important;
					max-width: 500px;

					.oo-ui-clippableElement-clippable {
						width: 100% !important;
					}
				}
			}
		}
	}
}
