/**
 * Copyright (c) Microblink Ltd. All rights reserved.
 */

@import "../styles/globals-sass";

:host {
  display: block;

  padding: $padding-unit-medium;

  border: var(--mb-component-image-box-border-width) solid
    var(--mb-component-image-box-border-color);
  border-radius: var(--mb-component-image-box-border-radius);
  max-width: 100%;

  .label {
    margin: 0;
    padding: 0 0 $padding-unit-small 0;

    height: var(--mb-component-image-box-label-height);
    line-height: var(--mb-component-image-box-label-height);

    color: var(--mb-component-image-box-label-color);

    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;

    font-family: var(--mb-font-family);
    font-size: var(--mb-component-image-box-label-font-size);
    font-weight: var(--mb-component-image-box-label-font-weight);
  }

  .cta {
    all: unset;
    box-sizing: border-box;
    display: flex;
    height: var(--mb-component-image-box-cta-height);
    max-width: 100%;

    color: var(--mb-component-image-box-cta-color);

    text-decoration: none;

    font-family: var(--mb-font-family);
    font-size: var(--mb-component-image-box-cta-font-size);
    font-weight: var(--mb-component-image-box-cta-font-weight);

    cursor: pointer;

    &:hover {
      color: var(--mb-component-image-box-cta-color-hover);
    }

    .cta-label,
    .cta-label {
      max-width: calc(100% - #{$padding-unit-medium + 20px});
      height: var(--mb-component-image-box-cta-label-height);
      line-height: var(--mb-component-image-box-cta-label-height);

      margin: 0;
      padding: 0 $padding-unit-medium 0 0;

      &.filename {
        padding: 0;
        color: var(--mb-component-image-box-file-color);
        font-weight: var(--mb-component-image-box-file-font-weight);

        text-overflow: ellipsis;
        overflow: hidden;
        white-space: nowrap;
      }
    }

    svg {
      display: none;

      width: 20px;
      height: 20px;
      margin: 0;

      &.visible {
        display: inline-block;
      }
    }
  }
}

:host input[type="file"] {
  position: absolute;
  width: 0;
  height: 0;
  opacity: 0;
  clip: rect(1px, 1px, 1px, 1px);
}
