/**
 * Fields Dark
**/
.ns-switch {
    button.selected {
        @apply bg-input-button-active text-typography;
    }
    button.unselected {
        @apply bg-slate-500 text-white;
    }
} 

.input-group {
    @apply border-input-edge;
    input, select {
        @apply bg-crud-button-edge text-primary;
    }
    button {
        @apply bg-input-disabled text-white outline-none;
        i, span {
            @apply text-white;
        }
        .disabled {
            @apply bg-input-edge;
        }
    }

    &.info {
        @apply border-info-primary;
        input {
            @apply bg-input-background text-primary;
        }
        button {
            @apply bg-info-primary text-white;
            i, span {
                @apply text-typography;
            }
        }
    }

    &.error {
        @apply border-error-primary;
        input {
            @apply bg-input-background text-primary;
        }
        button {
            @apply bg-error-primary text-white;
            i, span {
                @apply text-typography;
            }
        }
    }

    &.warning {
        @apply border-error-primary;
        input {
            @apply bg-input-background text-primary;
        }
        button {
            @apply bg-error-primary text-white;
            i, span {
                @apply text-typography;
            }
        }
    }
    
    &.success {
        @apply border-success-primary;
        input {
            @apply bg-input-background text-primary;
        }
        button {
            @apply bg-success-primary text-white;
            i, span {
                @apply text-typography;
            }
        }
    }
}

.ns-select {
    select {
        @apply bg-input-background text-primary;
        option {
            @apply bg-input-background;
            &:hover {
                @apply bg-input-option-hover text-white;
            }
        }
    }
}

.ns-input, .ns-switch, .ns-select, .ns-textarea, .ns-media {
    [disabled] {
        @apply bg-input-background border-input-edge text-tertiary;
    }
    
    .ns-enabled {
        @apply bg-transparent;
    }

    label {
        &.has-error {
            @apply text-error-secondary;
        }
    
        &.is-pristine {
            @apply text-primary;
        }
    }

    div {
        &.has-error {
            @apply border-error-secondary;
        }
        &.is-pristine {
            @apply border-input-edge;
        }
    }

    .leading {
        @apply text-primary;
    }

    input, textarea {
        @apply text-primary outline-none bg-input-background border-input-edge;
    }

    button {
        @apply border-input-edge text-white;
        &:hover {
            @apply bg-input-button-hover;
        }
    }

    p.ns-description {
        @apply text-primary;
    }

    p.ns-error {
       @apply text-error-secondary; 
    }
}

/**
 * Forms
**/
.form-input {
    @apply outline-0;
    label {
        @apply text-primary;
    }
    select {
        @apply bg-input-background text-primary;
        option {
            @apply bg-input-background;
            &:hover {
                @apply bg-input-option-hover;
            }
        } 
    }
    input {
        @apply border-input-edge bg-input-background rounded;
        &[disabled] {
            @apply bg-input-disabled;
        }
    }
    p {
        @apply text-secondary;
    }
}

.form-input-invalid {
    label {
        @apply text-error-secondary;
    }
    input {
        @apply border-error-primary bg-error-secondary rounded;
    }
    p {
        @apply text-error-secondary;
    }
}

/**
 * Buttons
**/
.ns-button {
    @apply text-white;

    button, a {
        @apply bg-input-button border-input-edge;
    }

    &:hover {
        a, button {
            @apply bg-input-button-hover border-transparent;
        }
    }
    
    &.hover-success:hover, &.success {
        button, a {
            @apply bg-success-tertiary text-typography;

            span.ns-label {
                @apply bg-input-background text-success-primary;
            }
        }
    }
    
    &.hover-error:hover, &.error {
        button, a {
            @apply bg-error-secondary text-typography;

            span.ns-label {
                @apply bg-input-background text-error-secondary;
            }
        }
    }
    
    &.hover-warning:hover, &.warning {
        button, a {
            @apply bg-warning-primary text-typography;

            span.ns-label {
                @apply bg-input-background text-warning-secondary;
            }
        }
    }
    
    &.hover-default:hover, &.default {
        button, a {
            @apply bg-input-button text-primary;

            span.ns-label {
                @apply bg-surface text-typography;
            }
        }
    }
    
    &.hover-info:hover, &.info {
        button, a {
            @apply bg-info-secondary text-typography;

            span.ns-label {
                @apply bg-input-background text-info-secondary;
            }
        }
    }
    
    .ns-disabled {
        @apply bg-input-background border border-input-edge cursor-not-allowed text-primary;

        span.ns-label {
            @apply bg-input-background text-primary;
        }
    }
}

.ns-buttons {
    @apply shadow;
    
    button.success, a.success {
        @apply bg-success-secondary text-typography;

        span.ns-label {
            @apply bg-input-background text-success-primary;
        }
    }
    button.error, a.error {
        @apply bg-error-secondary text-typography;

        span.ns-label {
            @apply bg-input-background text-error-secondary;
        }
    }
    button.warning, a.warning {
        @apply bg-warning-primary text-typography;

        span.ns-label {
            @apply bg-input-background text-warning-secondary;
        }
    }
    button.default, a.default {
        @apply bg-input-background text-input-disabled;

        span.ns-label {
            @apply bg-surface text-typography;
        }
    }
    button.info, a.info {
        @apply bg-info-secondary text-typography;

        span.ns-label {
            @apply bg-input-background text-info-secondary;
        }
    }
    .ns-disabled {
        @apply bg-input-background border border-input-edge cursor-not-allowed text-primary;

        span.ns-label {
            @apply bg-input-background text-primary;
        }
    }
}

.ns-close-button {
    @apply border-input-edge text-primary;

    &:hover {
        @apply bg-error-secondary border-transparent;
        > i {
            @apply text-typography;
        }
    }
}

.ns-inset-button {
    @apply border-input-button text-primary;
    &:hover, &.active {
        @apply bg-input-button text-white border-transparent;
    }
    &.info:hover, &.info.active {
        @apply bg-info-primary text-white border-transparent;
    }
    &.success:hover, &.success.active {
        @apply bg-success-primary text-white border-transparent;
    }
    &.warning:hover, &.warning.active {
        @apply bg-warning-primary text-white border-transparent;
    }
    &.error:hover, &.error.active  {
        @apply bg-error-primary text-white border-transparent;
    }
}

.ns-multiselect {
    .ns-dropdown {
        @apply bg-box-elevation-background;
    }
}

.ns-date-range-picker .form-control.reportrange-text {
    @apply bg-input-background border-transparent;
}