/* Shared Brittany AI demo — used by industry pages via brittany-ai-demo-section.php */

.ub-ai-demo {
    padding: 64px 0 72px;
    background: #f5f6ff;
    text-align: center;
}

.ub-ai-demo-tag {
    display: inline-block;
    background: #ece8ff;
    color: #05053e;
    font-size: 14px;
    font-weight: 500;
    padding: 8px 20px;
    border-radius: 100px;
    margin-bottom: 16px;
}

.ub-ai-demo-tag span {
    color: #7b61ff;
    font-weight: 700;
    font-style: italic;
}

.ub-ai-demo h2 {
    font-family: 'Space Grotesk', sans-serif;
    font-weight: 700;
    font-size: clamp(28px, 4vw, 44px);
    line-height: 1.2;
    color: #05053e;
    margin: 12px 0 12px;
}

.ub-ai-demo-accent {
    color: #7b61ff;
}

.ub-ai-demo-lead {
    color: #9d7bff;
    font-size: 20px;
    font-weight: 700;
    line-height: 28px;
    margin: 0 auto 8px;
    max-width: 720px;
}

.ub-ai-demo-sub {
    color: #5f5d68;
    font-size: 16px;
    line-height: 26px;
    margin: 0 auto 20px;
    max-width: 720px;
}

.ub-ai-demo-body {
    display: flex;
    align-items: flex-start;
    justify-content: center;
    gap: 24px;
    max-width: 980px;
    margin: 0 auto;
    text-align: center;
}

.ub-ai-demo-left {
    width: 100%;
    max-width: 390px;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 16px;
}

.ub-ai-demo-right {
    flex: 1 1 420px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: flex-start;
    gap: 24px;
    min-width: 0;
    padding-top: 0;
}

.ub-ai-demo-field {
    width: 100%;
    text-align: center;
}

.ub-ai-demo-field label {
    display: block;
    font-size: 12px;
    font-weight: 700;
    letter-spacing: 0.5px;
    color: #5f5d68;
    margin-bottom: 10px;
}

.ub-ai-demo-field input {
    width: 100%;
    padding: 13px 17px;
    border: 1px solid #c9c4d6;
    border-radius: 12px;
    background: #fff;
    font-size: 16px;
    color: #5f5d68;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.05);
    text-align: left;
}

.ub-ai-demo-field input:disabled {
    opacity: 0.55;
    cursor: not-allowed;
}

.ub-ai-demo-avatar {
    width: 166px;
    height: 162px;
    border-radius: 90px;
    border: 1px solid #7b61ff;
    overflow: hidden;
    margin: 0 auto;
    flex-shrink: 0;
}

.ub-ai-demo-avatar img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: center top;
}

.ub-ai-demo-badge {
    display: inline-block;
    background: #eef0ff;
    color: #7b61ff;
    font-size: 12px;
    font-weight: 700;
    padding: 4px 14px;
    border-radius: 20px;
}

.ub-ai-demo-meta {
    position: relative;
    z-index: 6;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    width: 100%;
    max-width: 241px;
    margin: 0;
    font-size: 13px;
    font-weight: 500;
    color: #5f5d68;
}

.ub-ai-demo-lang {
    position: relative;
    z-index: 5;
    flex-shrink: 0;
}

.ub-ai-demo-lang-trigger {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    border: 1px solid #9d7bff;
    border-radius: 17px;
    padding: 4px 12px;
    font-size: 15px;
    font-weight: 500;
    line-height: 1.2;
    color: #5f5d68;
    background: #fff;
    cursor: pointer;
    transition: background 0.2s ease, border-color 0.2s ease, box-shadow 0.2s ease, color 0.2s ease;
}

.ub-ai-demo-lang-trigger:hover:not(:disabled) {
    background: #f6f2ff;
    border-color: #7b61ff;
    color: #05053e;
}

.ub-ai-demo-lang-trigger:focus {
    outline: none;
}

.ub-ai-demo-lang-trigger:focus-visible {
    outline: 2px solid #9d7bff;
    outline-offset: 2px;
}

.ub-ai-demo-lang-trigger[aria-expanded="true"] {
    background: #f6f2ff;
    border-color: #7b61ff;
    box-shadow: 0 0 0 3px rgba(157, 123, 255, 0.18);
}

.ub-ai-demo-lang-trigger[aria-expanded="true"] > i {
    transform: rotate(180deg);
}

.ub-ai-demo-lang-trigger:disabled {
    cursor: not-allowed;
    opacity: 0.55;
}

.ub-ai-demo-lang-trigger > i {
    font-size: 11px;
    color: #9d7bff;
    transition: transform 0.2s ease;
}

.ub-ai-demo-lang-menu {
    position: absolute;
    top: calc(100% + 8px);
    right: 0;
    min-width: 168px;
    margin: 0;
    padding: 6px;
    list-style: none;
    background: #fff;
    border: 1px solid #e6e2ff;
    border-radius: 14px;
    box-shadow: 0 14px 36px rgba(11, 11, 46, 0.14);
    opacity: 0;
    visibility: hidden;
    transform: translateY(-6px) scale(0.98);
    transform-origin: top right;
    transition: opacity 0.18s ease, transform 0.18s ease, visibility 0.18s ease;
    pointer-events: none;
    z-index: 20;
}

.ub-ai-demo-lang.is-open .ub-ai-demo-lang-menu {
    opacity: 1;
    visibility: visible;
    transform: translateY(0) scale(1);
    pointer-events: auto;
}

.ub-ai-demo-lang-menu li {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 10px 12px;
    border-radius: 10px;
    cursor: pointer;
    color: #474650;
    transition: background 0.15s ease, color 0.15s ease;
}

.ub-ai-demo-lang-menu li:hover,
.ub-ai-demo-lang-menu li:focus {
    background: #f6f2ff;
    color: #05053e;
    outline: none;
}

.ub-ai-demo-lang-menu li[aria-selected="true"] {
    background: linear-gradient(90deg, rgba(107, 91, 255, 0.12), rgba(184, 167, 255, 0.18));
    color: #05053e;
}

.ub-ai-demo-lang-menu li[aria-selected="true"] .ub-ai-demo-lang-code {
    color: #7b61ff;
}

.ub-ai-demo-lang-code {
    font-size: 14px;
    font-weight: 600;
    color: #7b61ff;
}

.ub-ai-demo-lang-name {
    font-size: 13px;
    font-weight: 500;
    color: inherit;
}

.ub-ai-demo .visually-hidden {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

.ub-ai-demo-visualizer {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 32px;
    min-height: 0;
    width: 100%;
    /* Center the mic sphere with the left avatar (162px vs 240px orbit) */
    margin-top: calc((162px - 240px) / 2);
}

.ub-ai-demo-waves {
    display: flex;
    align-items: center;
    gap: 4px;
    height: 54px;
}

.ub-ai-demo-waves span {
    display: block;
    width: 3px;
    border-radius: 100px;
    background: #9d7bff;
    opacity: 0.7;
}

.ub-ai-demo-mic-orbit {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 240px;
    height: 240px;
    flex-shrink: 0;
    border-radius: 50%;
    background: rgba(79, 57, 255, 0.02);
}

.ub-ai-demo-mic-orbit::before,
.ub-ai-demo-mic-orbit::after {
    content: '';
    position: absolute;
    border-radius: 50%;
    pointer-events: none;
}

.ub-ai-demo-mic-orbit::before {
    inset: 32px;
    background: rgba(79, 57, 255, 0.04);
}

.ub-ai-demo-mic-orbit::after {
    inset: 56px;
    background: rgba(79, 57, 255, 0.08);
}

.ub-ai-demo-mic {
    width: 96px;
    height: 96px;
    border-radius: 50%;
    border: 2px solid #9d7bff;
    background:
        radial-gradient(circle at 32% 28%, rgba(255, 255, 255, 0.42) 0%, rgba(255, 255, 255, 0) 40%),
        radial-gradient(circle at 50% 44%, #7b61ff 0%, #624ecc 41%, #4a3a99 82%);
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow:
        0 3px 4px rgba(92, 69, 199, 0.28),
        0 14px 28px rgba(74, 58, 153, 0.32),
        inset 0 -10px 18px rgba(40, 28, 100, 0.42),
        inset 0 8px 14px rgba(255, 255, 255, 0.18);
    position: relative;
    z-index: 1;
    padding: 0;
    margin: 0;
    cursor: pointer;
    font: inherit;
    color: inherit;
    flex-shrink: 0;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.ub-ai-demo-mic:hover:not(:disabled) {
    transform: translateY(-1px) scale(1.02);
    box-shadow:
        0 4px 8px rgba(92, 69, 199, 0.32),
        0 18px 34px rgba(74, 58, 153, 0.36),
        inset 0 -10px 18px rgba(40, 28, 100, 0.42),
        inset 0 8px 14px rgba(255, 255, 255, 0.2);
}

.ub-ai-demo-mic:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

.ub-ai-demo-mic::before,
.ub-ai-demo-mic::after {
    content: '';
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    border-radius: 50%;
    border: 1px solid #6855c7;
    background: transparent;
    pointer-events: none;
    opacity: 0;
    transform: scale(1);
    animation: ub-ai-demo-radar 2.4s cubic-bezier(0.22, 0.61, 0.36, 1) infinite;
}

.ub-ai-demo-mic::after {
    animation-delay: 1.2s;
    border-color: #4a3a99;
}

@keyframes ub-ai-demo-radar {
    0% {
        transform: scale(1);
        opacity: 0.85;
    }
    55% {
        opacity: 0.4;
    }
    100% {
        transform: scale(2.15);
        opacity: 0;
    }
}

@media (prefers-reduced-motion: reduce) {
    .ub-ai-demo-mic::before,
    .ub-ai-demo-mic::after {
        animation: none;
        opacity: 0.45;
        transform: scale(1.35);
        border-color: #624ecc;
    }

    .ub-ai-demo-mic::after {
        transform: scale(1.7);
        opacity: 0.28;
        border-color: #4a3a99;
    }
}

.ub-ai-demo-mic i {
    font-size: 28px;
    color: #fff;
    position: relative;
    z-index: 1;
    filter: drop-shadow(0 1px 1px rgba(40, 28, 100, 0.35));
}

.ub-ai-demo-hint {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    background: #e6e2ff;
    color: #7b61ff;
    font-size: 14px;
    font-weight: 500;
    padding: 10px 24px;
    border-radius: 100px;
}

@media (max-width: 991px) {
    .ub-ai-demo {
        padding: 48px 0 56px;
    }

    .ub-ai-demo-body {
        flex-direction: column;
        align-items: center;
    }

    .ub-ai-demo-right {
        width: 100%;
        max-width: 520px;
        gap: 24px;
    }

    .ub-ai-demo-visualizer {
        overflow: visible;
        min-height: 0;
        margin-top: 0;
    }
}

@media (max-width: 767px) {
    .ub-ai-demo {
        padding: 40px 0 48px;
    }

    .ub-ai-demo-lead {
        font-size: 16px;
        line-height: 24px;
    }

    .ub-ai-demo-body {
        flex-direction: column;
        align-items: center;
        gap: 28px;
        width: 100%;
        padding: 0 4px;
        box-sizing: border-box;
    }

    .ub-ai-demo-left,
    .ub-ai-demo-right {
        width: 100%;
        max-width: 100%;
        gap: 28px;
        padding-top: 0;
    }

    .ub-ai-demo-visualizer {
        gap: 16px;
        min-height: 0;
        margin-top: 0;
    }

    .ub-ai-demo-waves {
        display: none;
    }

    .ub-ai-demo-hint {
        font-size: 13px;
        padding: 10px 16px;
        max-width: 100%;
        text-align: left;
        flex-wrap: wrap;
        justify-content: center;
    }

    .ub-ai-demo-avatar {
        width: 132px;
        height: 128px;
    }

    .ub-ai-demo-mic-orbit {
        width: 180px;
        height: 180px;
    }

    .ub-ai-demo-mic-orbit::before {
        inset: 20px;
    }

    .ub-ai-demo-mic-orbit::after {
        inset: 40px;
    }

    .ub-ai-demo-mic::before,
    .ub-ai-demo-mic::after {
        animation-duration: 2.4s;
    }
}
