/* Corporate presentation for the existing EV1 Media Solutions chat widget. */
#chat-button {
    position: fixed;
    right: 24px;
    bottom: 24px;
    z-index: 1100;
    width: 72px;
    height: 72px;
    display: grid;
    place-items: center;
    padding: 3px;
    border: 1px solid #c9d5e8;
    border-radius: 50%;
    background: var(--white);
    box-shadow: 0 16px 38px rgba(7, 26, 58, 0.22);
    cursor: pointer;
    transition: transform 180ms ease, box-shadow 180ms ease, opacity 180ms ease;
}

#chat-button:hover {
    transform: translateY(-3px);
    box-shadow: 0 20px 42px rgba(7, 26, 58, 0.28);
}

#chat-button.hidden {
    opacity: 0;
    pointer-events: none;
    transform: translateY(10px) scale(0.92);
}

.dj-avatar-img {
    width: 64px;
    height: 64px;
    border-radius: 50%;
    object-fit: cover;
}

.chat-notification {
    position: absolute;
    top: -2px;
    right: -2px;
    min-width: 23px;
    height: 23px;
    display: grid;
    place-items: center;
    padding: 0 6px;
    border: 2px solid var(--white);
    border-radius: 999px;
    color: var(--white);
    background: #d92d20;
    font-size: 0.72rem;
    font-weight: 800;
}

#chat-window {
    position: fixed;
    right: 24px;
    bottom: 24px;
    z-index: 1101;
    width: min(390px, calc(100vw - 32px));
    height: min(610px, calc(100vh - 48px));
    display: flex;
    flex-direction: column;
    overflow: hidden;
    border: 1px solid #c9d5e8;
    border-radius: 14px;
    background: var(--white);
    box-shadow: 0 24px 64px rgba(7, 26, 58, 0.28);
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
    transform: translateY(18px) scale(0.98);
    transform-origin: right bottom;
    transition: opacity 180ms ease, visibility 180ms ease, transform 180ms ease;
}

#chat-window.open {
    opacity: 1;
    visibility: visible;
    pointer-events: auto;
    transform: translateY(0) scale(1);
}

.chat-header {
    min-height: 78px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 18px;
    padding: 17px 18px;
    color: var(--white);
    background: var(--navy);
}

.chat-header-info {
    min-width: 0;
    display: flex;
    align-items: center;
    gap: 12px;
}

.chat-status-dot {
    width: 10px;
    height: 10px;
    flex: 0 0 auto;
    border: 2px solid rgba(255, 255, 255, 0.55);
    border-radius: 50%;
    background: #32d583;
    box-shadow: 0 0 0 4px rgba(50, 213, 131, 0.14);
}

.chat-title {
    overflow: hidden;
    color: var(--white);
    font-size: 0.94rem;
    font-weight: 750;
    line-height: 1.3;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.chat-status {
    margin-top: 3px;
    color: #b9c8df;
    font-size: 0.74rem;
}

.chat-close {
    width: 38px;
    height: 38px;
    flex: 0 0 auto;
    display: grid;
    place-items: center;
    padding: 0;
    border: 1px solid rgba(255, 255, 255, 0.22);
    border-radius: 50%;
    color: var(--white);
    background: transparent;
    font-size: 1.75rem;
    line-height: 1;
    cursor: pointer;
}

.chat-close:hover {
    background: rgba(255, 255, 255, 0.1);
}

.chat-messages {
    min-height: 0;
    flex: 1;
    overflow-y: auto;
    padding: 20px 16px;
    background: var(--surface);
    scrollbar-color: #b8c5d8 transparent;
    scrollbar-width: thin;
}

.chat-message {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    margin-bottom: 15px;
}

.chat-message.user {
    align-items: flex-end;
}

.message-content {
    max-width: 86%;
    padding: 11px 13px;
    border: 1px solid var(--line);
    border-radius: 4px 12px 12px 12px;
    color: var(--ink);
    background: var(--white);
    box-shadow: 0 5px 14px rgba(7, 26, 58, 0.06);
    font-size: 0.88rem;
    line-height: 1.55;
    overflow-wrap: anywhere;
}

.chat-message.user .message-content {
    border-color: var(--blue);
    border-radius: 12px 4px 12px 12px;
    color: var(--white);
    background: var(--blue);
}

.message-content a {
    color: var(--blue);
    font-weight: 700;
    text-decoration: underline;
    text-underline-offset: 2px;
}

.chat-message.user .message-content a {
    color: var(--white);
}

.message-time {
    margin-top: 5px;
    padding: 0 4px;
    color: #738198;
    font-size: 0.67rem;
}

.typing-indicator .message-content {
    display: flex;
    align-items: center;
    gap: 4px;
    padding: 14px 16px;
}

.typing-indicator span {
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: #91a0b6;
    animation: chat-typing 1.1s ease-in-out infinite;
}

.typing-indicator span:nth-child(2) {
    animation-delay: 140ms;
}

.typing-indicator span:nth-child(3) {
    animation-delay: 280ms;
}

.chat-input-container {
    display: grid;
    grid-template-columns: 1fr 46px;
    gap: 10px;
    align-items: end;
    padding: 13px;
    border-top: 1px solid var(--line);
    background: var(--white);
}

#chat-input {
    width: 100%;
    min-height: 46px;
    max-height: 110px;
    resize: none;
    padding: 12px 13px;
    border: 1px solid #aebbd0;
    border-radius: 5px;
    color: var(--ink);
    background: var(--white);
    outline: none;
    line-height: 1.4;
}

#chat-input:focus {
    border-color: var(--blue);
    box-shadow: 0 0 0 3px rgba(17, 79, 229, 0.12);
}

#chat-send {
    width: 46px;
    height: 46px;
    display: grid;
    place-items: center;
    padding: 0;
    border: 0;
    border-radius: 5px;
    color: var(--white);
    background: var(--blue);
    cursor: pointer;
    transition: background 160ms ease, transform 160ms ease;
}

#chat-send:hover {
    background: var(--blue-dark);
    transform: translateY(-1px);
}

@keyframes chat-typing {
    0%, 60%, 100% { opacity: 0.35; transform: translateY(0); }
    30% { opacity: 1; transform: translateY(-3px); }
}

@media (max-width: 760px) {
    .confirmation-page {
        padding: 52px 0 72px;
    }

    .confirmation-shell {
        width: min(calc(100% - 32px), 840px);
    }

    .confirmation-panel {
        padding: 36px 24px;
    }

    .confirmation-next {
        grid-template-columns: 1fr;
        gap: 9px;
    }

    #chat-button {
        right: 16px;
        bottom: 16px;
        width: 64px;
        height: 64px;
    }

    .dj-avatar-img {
        width: 56px;
        height: 56px;
    }

    #chat-window {
        right: 16px;
        bottom: 16px;
        width: calc(100vw - 32px);
        height: min(610px, calc(100dvh - 32px));
    }
}

@media (max-width: 420px) {
    #chat-window {
        right: 8px;
        bottom: 8px;
        width: calc(100vw - 16px);
        height: calc(100dvh - 16px);
        border-radius: 10px;
    }

    .chat-header {
        min-height: 72px;
        padding: 14px;
    }

    .chat-title {
        font-size: 0.86rem;
    }
}

@media (prefers-reduced-motion: reduce) {
    .typing-indicator span {
        animation: none;
    }

    #chat-window,
    #chat-button {
        transition-duration: 0.01ms;
    }
}
