/* Preset artwork from usx-smarthotel, usx-java-h5/prototypes/ambient-light. */
.ambient-light-mark {
    position: relative;
    flex: none;
    width: 32px;
    height: 32px;
    color: var(--theme-dark);
}

.ambient-light-mark::before,
.ambient-light-mark::after {
    content: '';
    position: absolute;
    background: currentColor;
}

.ambient-light-mark::before {
    width: 6px;
    height: 25px;
    left: 13px;
    top: 1px;
    border-radius: 4px;
    box-shadow: -5px 0 #3030520d, 5px 0 #3030520d;
}

.ambient-light-mark::after {
    width: 18px;
    height: 5px;
    left: 7px;
    bottom: 2px;
    border-radius: 50%;
}

.ambient-light .ambient-modes {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 20px 8px;
    margin-top: 16px;
    padding: 24px 20px;
}

.ambient-modes:empty {
    display: none;
}

.ambient-mode {
    display: flex;
    flex-direction: column;
    align-items: center;
    min-width: 0;
    border: 0;
    background: transparent;
    padding: 0;
    color: var(--theme-dark);
}

.ambient-mode:focus-visible {
    outline: 3px solid var(--theme-primary);
    outline-offset: 4px;
}

.ambient-mode .button-label {
    margin-top: 8px;
    min-height: 34px;
    max-width: 100%;
    line-height: 1.4;
    text-align: center;
    white-space: pre-line;
    overflow-wrap: anywhere;
}

.ambient-mode-icon {
    display: grid;
    place-items: center;
    width: min(64px, 100%);
    aspect-ratio: 1;
    border-radius: 50%;
    background: #f3f4f6;
}

.ambient-mode[aria-pressed="true"] .ambient-mode-icon {
    background: var(--theme-dark);
    color: #fff;
}

.ambient-mode-light {
    box-sizing: border-box;
    width: 24px;
    height: 36px;
    border: 1px solid #0000001f;
    border-radius: 8px;
    background: var(--lamp-colors, #c4c4cc);
    background-size: 100% var(--lamp-size, 100%);
}

.ambient-mode[aria-pressed="true"] .ambient-mode-light {
    border-color: #ffffff29;
}

.ambient-music-note {
    font-size: 24px;
    line-height: 1;
}

.ambient-music-bars {
    display: none;
    align-items: center;
    gap: 2px;
    height: 20px;
}

.ambient-music-bars b {
    width: 2px;
    height: 14px;
    border-radius: 2px;
    background: currentColor;
}

.ambient-music-bars b:nth-child(2) { height: 20px; animation-delay: -.6s; }
.ambient-music-bars b:nth-child(3) { height: 11px; animation-delay: -.2s; }
.ambient-music-bars b:nth-child(4) { height: 17px; animation-delay: -.4s; }

.ambient-light[data-power="on"] .ambient-mode[aria-pressed="true"] .ambient-music-note {
    display: none;
}

.ambient-light[data-power="on"] .ambient-mode[aria-pressed="true"] .ambient-music-bars {
    display: flex;
}

.ambient-mode[data-preset="cool-white"] {
    --lamp-colors: linear-gradient(#cfe8ff, #cfe8ff);
}

.ambient-mode[data-preset="warm-white"] {
    --lamp-colors: linear-gradient(#ffe7be, #ffe7be);
}

.ambient-mode[data-preset="champagne-glow"] {
    --lamp-colors: linear-gradient(#ffc58e, #ffc58e);
}

.ambient-mode[data-preset="miami-rose"] {
    --lamp-colors: linear-gradient(#ffc0d5, #ff4f9d 35%, #a62274 68%, #4a124f);
}

.ambient-mode[data-preset="ocean-current"] {
    --lamp-colors: repeating-linear-gradient(0deg, #00143d 0%, #0059d6 12%, #28d9ff 24%, #0059d6 37%, #00143d 50%);
    --lamp-size: 300%;
    --lamp-animation: usx-ocean 5s linear infinite;
}

.ambient-mode[data-preset="malibu-sunset"] {
    --lamp-colors: repeating-linear-gradient(0deg, #35105f 0%, #8b2d9e 12%, #ff477e 25%, #ff982b 37%, #35105f 50%);
    --lamp-size: 300%;
    --lamp-animation: usx-sunset 9s linear infinite;
}

.ambient-mode[data-preset="glacier-wave"] {
    --lamp-colors: repeating-linear-gradient(0deg, #0c4b74 0%, #31bde1 16%, #e2fbff 24%, #31bde1 32%, #0c4b74 50%);
    --lamp-size: 300%;
    --lamp-animation: usx-glacier 6s ease-in-out infinite;
}

.ambient-mode[data-preset="color-mix"] {
    --lamp-colors: repeating-linear-gradient(0deg, #0068ff 0%, #792dff 8%, #ee2d7a 16%, #ff6b00 25%, #00a66c 33%, #2ed9ff 42%, #0068ff 50%);
    --lamp-size: 300%;
    --lamp-animation: usx-mix 7s linear infinite;
}

@keyframes usx-ocean {
    from { background-position: 0 100%; }
    to { background-position: 0 0%; }
}

@keyframes usx-sunset {
    0% { background-position: 0 0%; }
    50% { background-position: 0 50%; }
    100% { background-position: 0 100%; }
}

@keyframes usx-glacier {
    0%, 100% { background-position: 0 0%; }
    50% { background-position: 0 100%; }
}

@keyframes usx-mix {
    from { background-position: 0 0%; }
    to { background-position: 0 100%; }
}

@keyframes usx-equalize {
    from { transform: scaleY(.3); }
    to { transform: scaleY(1); }
}

@media (prefers-reduced-motion: no-preference) {
    .ambient-mode-light {
        animation: var(--lamp-animation, none);
    }

    .ambient-music-bars b {
        animation-name: usx-equalize;
        animation-duration: .8s;
        animation-timing-function: ease-in-out;
        animation-iteration-count: infinite;
        animation-direction: alternate;
    }
}

.ambient-light[data-power="off"] .ambient-mode {
    opacity: .4;
}

.ambient-light[data-power="off"] .ambient-mode-light {
    background: #c4c4cc;
}

.ambient-light[data-power="off"] .ambient-mode-light,
[inert] .ambient-mode-light,
[inert] .ambient-music-bars b {
    animation-play-state: paused;
}

@media (max-width: 360px) {
    .ambient-light .ambient-modes {
        column-gap: 4px;
        padding: 22px 14px;
    }

    .ambient-mode-icon {
        width: min(56px, 100%);
    }
}
