@require "variables"

.b-input-wrapper {
    font-size: Input-fontSize;
    position: relative;
    width: 100%;
}

.b-input {
    appearance: none;
    background: transparent;
    border: 1px solid transparent;
    border-radius: borderRadius;
    color: Input-color;
    font-family: inherit;
    font-size: inherit;
    font-weight: inherit;
    line-height: inherit;
    margin: 0;
    padding: 0.75em;
    position: relative;
    z-index: 1;
    width: 100%;

    transition: all 200ms ease;

    // the placeholder sits after the primary input, so we'll apply styling to that instead

    & + .b-input-placeholder {
        background: Input-backgroundColor;
        border-color: Input-borderColor;
        color: Input-placeholder-color;
    }

    &[disabled] {
        color: Input-color-disabled;
        cursor: not-allowed;
        opacity: Input-opacity-disabled;

        & + .b-input-placeholder,
        &:active + .b-input-placeholder,
        &:focus + .b-input-placeholder,
        &:hover + .b-input-placeholder {
            background: Input-backgroundColor-disabled;
            border-color: Input-borderColor-disabled;
        }
    }

    &:active {
        color: Input-color-active;

        & + .b-input-placeholder {
            background: Input-backgroundColor-active;
            border-color: Input-borderColor-active;
        }
    }

    &:focus {
        color: Input-color-focus;

        & + .b-input-placeholder {
            background: Input-backgroundColor-focus;
            border-color: Input-borderColor-focus;
        }
    }

    &:hover {
        color: Input-color-hover;

        & + .b-input-placeholder {
            background: Input-backgroundColor-hover;
            border-color: Input-borderColor-hover;
        }
    }
}

.b-input-placeholder {
    overflow: hidden;
    position: absolute;
    top: 0;
    left: 0;
    bottom: 0;
    right: 0;
    white-space: nowrap;
    text-overflow: ellipsis;
    z-index: 0;
}
