/* 'card-type' in CSS variables is replaced with the real card type 
   in card-structure.js for easier maintenance */

* {
    -webkit-tap-highlight-color: transparent !important;
    -ms-overflow-style: none; /* for Internet Explorer, Edge */
    scrollbar-width: none; /* for Firefox */

    -webkit-user-select: none; /* Safari */
    -ms-user-select: none; /* IE 10 and IE 11 */
    user-select: none; /* Standard syntax */
}

*::-webkit-scrollbar {
    display: none; /* for Chrome, Safari, and Opera */
}

ha-card {
    background: none;
    opacity: 1;
}

.scrolling-container {
    width: 100%;
    white-space: nowrap;
    mask-image: linear-gradient(to right, transparent, black 8px, black calc(100% - 8px), transparent);
    -webkit-mask-image: linear-gradient(to right, transparent, black 8px, black calc(100% - 8px), transparent);
    overflow: hidden;
}

.scrolling-container span {
    display: inline-block;
    animation-name: bubble-scroll;
    animation-timing-function: linear;
    animation-iteration-count: infinite;
}

.bubble-scroll-separator {
    opacity: .3;
    margin: 0 6px 0 8px;
}

@keyframes bubble-scroll {
    from { transform: translateX(0); }
    to { transform: translateX(-50%); }
}
/* End of scrolling styles */

.bubble-container {
    position: relative;
    width: 100%;
    height: 50px;
    background-color: var(--bubble-card-type-main-background-color, var(--bubble-main-background-color, var(--background-color-2, var(--secondary-background-color))));
    border-radius: var(--bubble-card-type-border-radius, var(--bubble-border-radius, calc(var(--row-height,56px)/2)));
    box-shadow: var(--bubble-card-type-box-shadow, var(--bubble-box-shadow, none));
    overflow: scroll;
    touch-action: auto;
    border: var(--bubble-card-type-border, var(--bubble-border, none));
    box-sizing: border-box;
}

.bubble-wrapper {
    display: flex;
    position: absolute;
    justify-content: space-between;
    align-items: center;
    height: 100%;
    width: 100%;
    transition: all 1.5s;
    border-radius: var(--bubble-card-type-border-radius, var(--bubble-border-radius, calc(var(--row-height,56px)/2)));
    background-color: rgba(0,0,0,0);
    overflow: visible;
}

.bubble-content-container {
    display: contents;
    flex-grow: 1;
}

.bubble-buttons-container {
    --icon-primary-color: var(--primary-text-color);
    display: flex;
    margin-right: 8px;
    gap: 4px;
}

.bubble-background {
    display: flex;
    position: absolute;
    height: 100%;
    width: 100%;
    transition: background-color 1.5s;
    border-radius: var(--bubble-card-type-border-radius, var(--bubble-border-radius, calc(var(--row-height,56px)/2)));
    -webkit-mask-image: radial-gradient(circle, rgba(0, 0, 0, 1) 100%, rgba(0, 0, 0, 0) 100%);
    mask-image: radial-gradient(circle, rgba(0, 0, 0, 1) 100%, rgba(0, 0, 0, 0) 100%);
}

.bubble-icon-container {
    display: flex;
    flex-wrap: wrap;
    align-content: center;
    justify-content: center;
    min-width: 38px;
    min-height: 38px;
    margin: 6px;
    border-radius: var(--bubble-card-type-icon-border-radius, var(--bubble-icon-border-radius, var(--bubble-border-radius, 50%)));
    background-color: var(--bubble-card-type-icon-background-color, var(--bubble-icon-background-color, var(--bubble-secondary-background-color, var(--card-background-color, var(--ha-card-background)))));
    overflow: hidden;
    position: relative;
    transition: all 0.3s ease-in-out;
}

.bubble-icon-feedback-container {
    border-radius: var(--bubble-card-type-icon-border-radius, var(--bubble-icon-border-radius, var(--bubble-border-radius, 50%)));
    overflow: hidden !important;
}

.is-off .bubble-main-icon {
    opacity: 0.6;
}

.is-on .bubble-main-icon {
  filter: brightness(1.1);
  opacity: 1;
}

.bubble-entity-picture {
    background-size: cover;
    background-position: center;
    height: 100%;
    width: 100%;
    position: absolute;
}

.bubble-name,
.bubble-state {
    display: flex;
    position: relative;
    white-space: nowrap;
}

.bubble-name-container {
    display: flex;
    line-height: 18px;
    flex-direction: column;
    justify-content: center;
    flex-grow: 1;
    margin: 0 16px 0 4px;
    pointer-events: none;
    position: relative;
    overflow: hidden;
}

.bubble-name {
    font-size: 13px;
    font-weight: 600;
}

.bubble-state {
    font-size: 12px;
    font-weight: normal;
    opacity: 0.7;
}

.is-unavailable .bubble-wrapper {
    cursor: not-allowed;
}

.is-unavailable .bubble-buttons-container {
    display: none;
}

.is-unavailable {
    opacity: 0.5;
}

.hidden {
    display: none !important;
}

.state-without-name {
    opacity: 1;
    font-size: 14px;
}

.name-without-icon {
    margin-left: 16px;
}

.display-state {
    display: flex;
}

.bubble-action-enabled {
    cursor: pointer;
}

.large .bubble-container {
    height: calc( var(--row-height,56px) * var(--row-size,1) + var(--row-gap,8px) * ( var(--row-size,1) - 1 ));
    border-radius: var(--bubble-card-type-border-radius, var(--bubble-border-radius, calc(var(--row-height,56px)/2)));
}

.large .bubble-icon-container {
    --mdc-icon-size: 24px;
    min-width: 42px;
    min-height: 42px;
    margin-left: 8px;
}