@use "variables" as *;

:host {
    display: block;
    container-type: inline-size;
    container-name: binaryField;
}

.binary-field__container {
    display: flex;
    justify-content: center;
    align-items: center;
    width: 100%;
    border-radius: $border-radius-md;
    border: $field-border-size solid $color-palette-gray-400;
    padding: $spacing-1;
    height: 14.4rem;
    min-width: 12.5rem;

    &:has(.binary-field__actions:empty) {
        gap: 0; // Remove gap when there are no actions, is cleaner than removing the div by logic
    }
}

.binary-field__container--uploading {
    border: $field-border-size dashed $color-palette-gray-400;
}

.binary-field__actions {
    display: flex;
    flex-direction: column;
    gap: $spacing-3;
    justify-content: center;
    align-items: flex-start;

    &:empty {
        display: none;
    }

    .label-ai {
        text-transform: none;
        font-size: $font-size-sm;
    }

    .p-button {
        display: inline-flex;
        user-select: none;
        align-items: center;
        vertical-align: bottom;
        text-align: center;
    }
}

.binary-field__drop-zone {
    border: $field-border-size dashed $input-border-color;
    border-radius: $border-radius-md;
    height: 100%;
    flex: 1;
    overflow: auto;
    margin-right: $spacing-1;
}

.binary-field__drop-zone-btn {
    border: none;
    background: none;
    color: $color-palette-primary-500;
    text-decoration: underline;
    font-size: $font-size-md;
    font-family: $font-default;
    padding: revert;
    cursor: pointer;

    &:disabled {
        color: $button-text-color-disabled;
    }
}

.binary-field__drop-zone--active {
    border-radius: $border-radius-md;
    border-color: $color-palette-secondary-500;
    background: $white;
    box-shadow: $shadow-l;
}

input[type="file"] {
    display: none;
}

@container binaryField (max-width: 306px) {
    .binary-field__container--empty {
        height: auto;
        flex-direction: column;
        justify-content: center;
        align-items: flex-start;
    }

    .binary-field__drop-zone {
        width: 100%;
        margin: 0;
        margin-bottom: $spacing-1;
    }
}
