@import "../_colors";
@import "../queries";

@mixin confirm-dialog-button($background-color, $text-color) {
    display: flex;
    min-height: 40px;
    padding: 4px 12px;
    justify-content: center;
    align-items: center;
    gap: 8px;
    border-radius: 4px;
    background: $background-color;

    span {
        color: $text-color;
        text-align: center;
    }
}

// Dialogs
body .p-dialog-mask {
    background: rgba(0, 0, 0, 0.5);
}

body .p-dialog {
    box-shadow: 0 2px 8px 0 rgba(0, 0, 0, 0.4);
    background-color: #fff;
    border-radius: 4px;

    .p-dialog-close-button,
    .p-dialog-close-button:not(:disabled):hover {
        background-color: transparent !important;
        color: #212533 !important;
    }

    .p-dialog-header {
        padding: 16px;
        border-bottom: 1px solid #dedce5;

        .p-dialog-close-button:active,
        .p-dialog-close-button:focus {
            background: inherit;
            border: none;
            outline: none;
        }

        .p-dialog-title {
            font-family: "Open Sans", sans-serif;
            font-size: 16px;
            text-transform: uppercase;
        }
    }

    .p-dialog-content {
        padding: 16px;
        overflow-y: auto;
        height: 100%;
    }

    &:not(.p-confirmdialog) {
        .p-dialog-content {
            padding-bottom: 0;
            margin-bottom: 15px;
        }
    }

    .p-dialog-footer {
        border-top: 1px solid #dedce5;
        padding: 15px;
        display: flex;
        justify-content: flex-end;
        gap: 10px;

        .p-confirmdialog-reject-button,
        .p-confirmdialog-accept-button {
            outline: none;
        }

        .p-confirmdialog-reject-button {
            @include confirm-dialog-button(#fff, #428bca);
        }

        .p-confirmdialog-accept-button {
            @include confirm-dialog-button(#428bca, #fff);
        }
    }

    &.p-confirmdialog {
        max-width: 450px;
    }
}

// Responsividade
@media #{$sm-devices} {
    body .p-dialog:not(.p-confirm-dialog) {
        height: 100%;
        max-height: 100%;
        width: 100%;
    }
}

@media #{$md-devices} {
    body .p-dialog:not(.p-confirm-dialog) {
        min-width: 450px;
        max-height: 70%;
        max-width: 70%;
    }
}
