/*FORMS*/
::ng-deep {
    /*FORM FIELD*/
    .mat-form-field {
        margin-top: 8px;
        margin-bottom: 16px;

        &:not(.is-textarea) {
            height: 40px;
        }

        &.is-textarea {
            padding-bottom: 0 !important;
        }
    }

    .mat-form-field-invalid {
        padding-bottom: 45px;
    }
    .mat-form-field-subscript-wrapper {
        top: 30px;
    }

    .mat-form-field-appearance-outline .mat-form-field-wrapper {
        display: flex;
        margin-bottom: 2px !important;
        padding-bottom: 4px !important;
    }

    .mat-select-value-text {
        position: relative;
        top: 6px;
    }

    input.mat-input-element,
    .mat-select,
    .mat-form-field-hide-placeholder .mat-select-placeholder,
    .mat-select-trigger,
    .mat-date-range-input-container {
        height: 30px;
    }

    input[type=time].mat-input-element {
        align-items: center;

        display: flex;
    }

    .mat-form-field-appearance-outline .mat-form-field-outline,
    .mat-form-field-appearance-outline .mat-form-field-flex {
        color: #686868;
    }
    .mat-checkbox-layout .mat-checkbox-label {
        text-align: left;
        line-height: normal;
        white-space: break-spaces;
    }
    /***DISABLED STYLES************/
    .mat-form-field-appearance-outline.mat-form-field-disabled .mat-form-field-outline,
    .mat-input-element:disabled,
    .mat-form-field-type-mat-native-select.mat-form-field-disabled .mat-form-field-infix::after {
        color: #8b8b8b;

        cursor: not-allowed;
    }

    .mat-form-field-appearance-outline .mat-select-arrow-wrapper {
        transform: translateY(-4%) !important;
    }

    textarea.mat-input-element.cdk-textarea-autosize {
        min-height: 30px !important;
    }

    .mat-form-field-can-float.mat-form-field-should-float .mat-form-field-label,
    .mat-form-field-can-float .mat-input-server:focus+ .mat-form-field-label-wrapper .mat-form-field-label {
        top: 35px !important;
    }

    .is-textarea.mat-form-field-can-float.mat-form-field-should-float .mat-form-field-label,
    .is-textarea.mat-form-field-can-float .mat-input-server:focus+ .mat-form-field-label-wrapper .mat-form-field-label {
        top: 30px !important;
    }

    .mat-form-field-label-wrapper {
        top: -12px !important;
    }

    .mat-form-field-appearance-outline .mat-form-field-prefix,
    .mat-form-field-appearance-outline .mat-form-field-suffix {
        top: -18px !important;
    }

    .mat-form-field-type-mat-date-range-input .mat-form-field-suffix {
        top: -12px !important;
    }

    .mat-form-field-appearance-outline .mat-form-field-outline,
    .mat-form-field-appearance-outline .mat-form-field-flex {
        top: 0 !important;

        height: 40px !important;
    }

    .mat-form-field-appearance-outline .mat-form-field-infix {
        position: relative;
        bottom: 16px;

        padding: $spacing-s 0 !important;

        font-size: $font-m !important;
    }

    .is-textarea.mat-form-field-appearance-outline .mat-form-field-flex,
    .is-textarea .mat-form-field-appearance-outline .mat-form-field-flex,
    .mat-form-field-appearance-outline.is-textarea .mat-form-field-outline {
        height: auto !important;
        min-height: 40px;
    }

    .is-textarea.mat-form-field-appearance-outline .mat-form-field-infix {
        bottom: 9px !important;

        padding-bottom: 0 !important;
    }

    /*   .is-textarea.mat-form-field-hide-placeholder .mat-form-field-flex {
        height: 40px !important;
    } */

    textarea+ .mat-form-field-label-wrapper {
        top: -19px !important;
    }

    .mat-error {
        font-size: $font-s !important;
    }

    .mat-radio-label-content {
        display: flex !important;

        font-size: $font-m !important;

        @include for-size(md-down) {
            font-size: 18px;
        }
    }

    .mat-form-field-appearance-outline .mat-form-field-outline-thick {
        color: $primary;
    }

    .mat-form-field.mat-focused .mat-form-field-label {
        color: $primary;
    }

    .read-only .mat-form-field-appearance-outline.mat-focused .mat-form-field-outline-thick {
        color: #e9f0f9 !important;

        cursor: not-allowed !important;
    }

    .read-only .mat-form-field-appearance-outline {
        opacity: .8;

        cursor: not-allowed !important;
    }

    .mat-drawer-container {
        height: 100vh;
    }

    /*PAGINATOR*/
    .mat-paginator {
        .mat-paginator-page-size {
            height: 55px;
        }

        .mat-select {
            height: 20px;
        }

        .mat-paginator-page-size-select {
            bottom: 3px;
        }

        .mat-select-arrow-wrapper {
            position: relative;
            bottom: 5px;
        }
    }

    /*ACCORDEON*/
    .mat-expansion-panel {
        box-shadow: none !important;

        .mat-radio-button {
            margin: 16px 0 !important;
        }
    }

    .mat-expansion-panel-header {
        height: 100% !important;
        padding: unset;
    }
    .mat-expansion-panel-header:hover {
        background: transparent !important;
    }

    .mat-expansion-panel-body {
        padding: 0 !important;
        padding-right: 0 !important;
    }

    .mat-expansion-indicator {
        position: relative;

        transform: rotate(269deg) !important;
        margin-right: 12px;

        order: -1;
    }

    .mat-expanded {
        > .mat-expansion-indicator {
            bottom: 3px;
            left: 2px;

            transform: rotate(0deg) !important;
        }
    }

    .mat-menu-content {
        padding-top: 0 !important;
        padding-bottom: 0 !important;
    }

    /*TABS*/
    mat-tab-body {
        margin: $spacing-m 0 $spacing-l;
    }

    .mat-tab-label .mat-tab-label-content {
        text-transform: uppercase;
        letter-spacing: .5px;
        font-size: $font-m;
    }

    .mat-tab-label.mat-tab-label-active {
        opacity: 1;
    }

    .mat-tab-group.mat-primary .mat-ink-bar,
    .mat-tab-nav-bar.mat-primary .mat-ink-bar {
        background-color: $secondary;
    }

    .mat-tab-label-active .mat-tab-label-content {
        color: $secondary;

        font-weight: bold;
    }

    .mat-tab-body-wrapper {
        height: inherit;
    }

    .mat-tab-body-content {
        overflow: hidden !important;
    }
}

/*TABLES*/
.mat-cell {
    padding-top: 4px;
    padding-bottom: 4px;
}

mat-cell:first-of-type,
mat-header-cell:first-of-type,
mat-footer-cell:first-of-type {
    padding-left: 0 !important;
}

mat-cell:last-of-type,
mat-header-cell:last-of-type,
mat-footer-cell:last-of-type {
    padding-right: 0 !important;
}

/*DIALOGS*/

.mat-dialog-container {
    min-height: 200px !important;
    padding: 0 !important;
    overflow: hidden !important;

    .mat-dialog-content {
        min-width: 500px;
        min-height: 200px;
        max-height: 92vh;
        padding: $spacing-m $spacing-l !important;
    }

    @media (max-width:580px) {
        display: inline-table;

        .mat-dialog-content {
            width: 95vw !important;
            min-width: 100px;
        }
    }
}

.mat-dialog-title {
    margin: $spacing-m 0 !important;
}

.mat-dialog-title,
.mat-dialog-content {
    margin-right: 0 !important;
    margin-left: 0 !important;
    padding: 0 !important;
}

.mat-dialog-actions {
    margin-top: 10px !important;
    margin-bottom: 0 !important;
    min-height: auto !important;
    padding: 0 !important;
    padding-top: 16px !important;

    .mat-button-base+ .mat-button-base,
    .mat-mdc-button-base+ .mat-mdc-button-base {
        margin-left: $spacing-m !important;
    }
}

.cdk-overlay-pane {
    max-width: 95% !important;
}

/**TOOLTIP***************/
::ng-deep {
    .mat-tooltip {
        //Se comenta la propiedad porque los textos más cortos no cubrian el tooltip entero por lo que quedaba muy desajustado
        //min-width: 420px;
        font-size: $font-m;

        @media (max-width: 900px) {
            display: none;
        }
    }
}

::ng-deep {
    .mat-snack-bar-container {
        span {
            font-size: 18px;
        }

        &.info {
            background: #077;
        }

        &.warning {
            background: #ffb10a;
            color: #212121;
        }

        &.error {
            background-color: #c54646;
            color: #212121;
        }

        &.success {
            background: #077;
            color: $neutral-90;
        }
    }
}

::ng-deep {
    @media(min-width:768px) {
        .mat-expansion-panel-content {
            max-height: 600px;
            overflow-y: auto !important;
        }
    }
}

.mat-form-field:not(.mat-form-field-appearance-legacy) .mat-form-field-prefix .mat-icon,
.mat-form-field:not(.mat-form-field-appearance-legacy) .mat-form-field-suffix .mat-icon {
    position: relative;

    font-size: medium;
}