/*===========================================================
= Select                                                    =
===========================================================*/

/* Reset the default `<button/>` styles */
.rrui__select__selected,
.rrui__select__option
{
	padding     : 0;
	white-space : nowrap;
	outline     : none;
	appearance  : none;
	border      : none;
	background  : none;
	cursor      : pointer;
	font-size   : inherit;
	font-family : inherit;
	font-weight : inherit;
	font-style  : inherit;
}

.rrui__select
{
	/*
	Sometimes (e.g. when using mobile dropdown menus)
	`position: relative` could be overridden to `static`
	to allow for the menu stretching to full screen width.
	*/
	position : relative;
	display  : inline-block;
}

.rrui__expandable
{
	opacity : 0;
	pointer-events : none;

	transform                : scaleY(0);
	-webkit-transform        : scaleY(0);
	transform-origin         : 50% top 0px;
	-webkit-transform-origin : 50% top 0px;

	/* 250ms - too slow for short lists */
	transition         : all 150ms cubic-bezier(.76,.04,.46,.75) 0ms;
	-webkit-transition : all 150ms cubic-bezier(.76,.04,.46,.75) 0ms;

	/* prevent white background showing through the transparent border */
	/* http://stackoverflow.com/questions/7473200/transparent-border-expands-background-color-image */
	background-clip         : padding-box;
	-webkit-background-clip : padding-box;
}

.rrui__expandable--expanded
{
	opacity        : 1;
	pointer-events : auto;

	transform                : scaleY(1);
	-webkit-transform        : scaleY(1);
	transform-origin         : 50% top 0px;
	-webkit-transform-origin : 50% top 0px;

	transition         : all 150ms cubic-bezier(0.23, 1, 0.32, 1) 0ms;
	-webkit-transition : all 150ms cubic-bezier(0.23, 1, 0.32, 1) 0ms;
}

.rrui__expandable--overlay
{
	position : absolute;
	z-index  : 1;
}

.rrui__expandable__content
{
	/*
	The inner block's `opacity` is animated too
	(it fades in and out by itself too).
	This is done to fade out the inner block when the dropdown is collapsed
	therefore hiding an otherwise bizarre and unwanted visual clutter
	*/
	opacity: 0;

	/* Mitigates inner content overlapping with itself creating a feeling of a mess */
	transition         : opacity 150ms ease-out;
	-webkit-transition : opacity 150ms ease-out;
}

.rrui__expandable__content--expanded
{
	opacity: 1;
}

.rrui__shadow
{
	box-shadow : 0 2px 5px 0 rgba(0, 0, 0, 0.16), 0 2px 10px 0 rgba(0, 0, 0, 0.12);
}

.rrui__select__options
{
	margin   : 0;
	padding  : 0;
	overflow-y       : auto;
	background-color : white;
}

.rrui__select__options--left-aligned
{
	left : 0;
}

.rrui__select__options--right-aligned
{
	right : 0;
}

.rrui__select__options--simple-left-aligned
{
	left : calc(0.3rem * 4 * -1);
}

.rrui__select__options--simple-right-aligned
{
	right : calc(0.3rem * 4 * -1);
}

.rrui__select__options--downward
{
	/* When an html page is overflown by a long list
	   then this bottom margin helps to see that
	   there's no more options left out being clipped or something */
	margin-bottom : 1em;
}

.rrui__select__options--upward
{
	bottom : 100%;

	/* When an html page is overflown by a long list
	   then this bottom margin helps to see that
	   there's no more options left out being clipped or something */
	margin-top : 1em;
}

.rrui__select__options-list-item:first-child
{
	padding-top    : calc(2 * 0.3rem);
}

.rrui__select__options-list-item:last-child
{
	padding-bottom : calc(2 * 0.3rem);
}

.rrui__select__option
{
	width: 100%;

	padding-left  : calc(0.3rem * 4);
	padding-right : calc(0.3rem * 4);

	padding-top    : calc(0.3rem * 1);
	padding-bottom : calc(0.3rem * 1);

	box-sizing: border-box;
	text-align: left;
	white-space: nowrap;
}

.rrui__select__selected--disabled,
.rrui__select__option--disabled
{
	cursor : default;
}

.rrui__select__option:active
{
	background-color : #3678D1;
	color            : white;
}

.rrui__select__option-icon
{
	margin-right : calc(0.3rem * 3);
}

.rrui__select__separator
{
	height           : 1pt;
	background-color : #B8BDC4;
}

.rrui__select__separator-option
{
	padding-top      : calc(0.3rem * 2);
	padding-bottom   : calc(0.3rem * 2);
}

.rrui__select__options--upward
{
	transform-origin         : 50% bottom 0px;
	-webkit-transform-origin : 50% bottom 0px;
}

.rrui__select__option--focused
{
	background-color: #ECF1F6;
}

.rrui__select__option-icon
{
	margin-right: 0.5em
}

.rrui__select__selected
{
	border-bottom: 1px solid #C5D2E0;

	transition         : border 0.1s;
	-webkit-transition : border 0.1s;

	/* Because Chrome adds `text-align: center` for all buttons */
	text-align: left;
}

.rrui__select__selected:focus
{
	border-bottom-color: #03B2CB;
}

.rrui__select__selected:active
{
	color: #3678D1;
}

.rrui__select__selected--expanded
{
	color: #3678D1;
}

.rrui__select__selected--nothing,
/* For CSS rule specificity */
.rrui__select--expanded .rrui__select__selected--nothing
{
	color: #888C91;
}

.rrui__select--expanded .rrui__select__selected--autocomplete
{
	color: black;
}

.rrui__select__selected,
.rrui__select__option
{
	color : inherit;
}

/* Not introducing an animation on `.rrui__select__option`
   because it would introduce a little clutter due to
   focused option animation in autocomplete mode */
.rrui__select__selected
{
	transition         : background-color 30ms ease-out, color 30ms ease-out;
	-webkit-transition : background-color 30ms ease-out, color 30ms ease-out;
}

.rrui__select__arrow
{
	width  : 0;
	height : 0;

	margin-left   : 0.35em;
	margin-top    : 0.1em;
	margin-bottom : 0.1em;

	opacity: 0.7;

	transition         : opacity 100ms ease-out;
	-webkit-transition : opacity 100ms ease-out;

	/* border-width: arrow_height arrow_width/2 0 arrow_width/2 */
	border-width : 0.35em 0.2em 0 0.2em;

	border-style       : solid;
	border-left-color  : transparent;
	border-right-color : transparent;

	color: #B8BDC4;
}

.rrui__select__arrow--expanded
{
	opacity: 0.3;
}

/* Focused input label */
.rrui__select__selected:focus + .rrui__input-label
{
	color: #03B2CB;
}

/*===========================================================
= React-phone-number-input                                  =
===========================================================*/

/* Material design style input text fields */
.react-phone-number-input__country input,
.react-phone-number-input__phone
{
	outline    : none;
	appearance : none;
}

.react-phone-number-input__country
{
	margin-right : calc(0.3rem * 1.5);
}

.rrui__input
{
	height : calc(0.3rem * 6);
}

/* Styling the phone input field */
.react-phone-number-input__phone,
.rrui__select__selected--autocomplete
{
	width   : calc(0.3rem * 45);
	padding : 0;

	border        : none;
	border-bottom : 1px solid #C5D2E0;

	transition         : border 0.1s;
	-webkit-transition : border 0.1s;
}

.react-phone-number-input__phone:focus
{
	border-bottom-color: #0093C4;
}

.react-phone-number-input__phone--valid:focus
{
	border-bottom-color: #18C900;
}

/* Custom style for flag icons */
.react-phone-number-input .rrui__select__arrow
{
	margin-top  : 0.3rem;
	margin-left : 0.3rem;
}

.react-phone-number-input__icon
{
	display        : inline-block;
	/*vertical-align : top;*/
	width          : 1.24em;
	height         : 0.93em;
	border         : 1px solid #bfbfbf;
}

.react-phone-number-input__icon--international
{
	width         : calc(0.93em + 2px);
	height        : calc(0.93em + 2px);
	padding-left  : 0.155em;
	padding-right : 0.155em;
	border        : none;
}