/**
 * ISC License
 *
 * Copyright (c) 2026 idnovate.com
 * idnovate is a Registered Trademark & Property of idnovate.com, innovación y desarrollo SCP
 *
 * Permission to use, copy, modify, and/or distribute this software for any
 * purpose with or without fee is hereby granted, provided that the above
 * copyright notice and this permission notice appear in all copies.
 *
 * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH
 * REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
 * AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT,
 * INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM
 * LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR
 * OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
 * PERFORMANCE OF THIS SOFTWARE.
 *
 * @author    idnovate
 * @copyright 2026 idnovate.com
 * @license   https://www.isc.org/licenses/ https://opensource.org/licenses/ISC ISC License
 *
 * Floating button, call page of the customer and video area (also used by the answer page).
 */

/* Some themes give [hidden] a display of their own. */
.vcp [hidden],
.vcp[hidden],
.vcp-fab[hidden] {
    display: none !important;
}

/* ---------------------------------------------------------------- Floating button */

.vcp-fab {
    position: fixed;
    bottom: 20px;
    z-index: 9990;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    min-height: 52px;
    padding: 0 18px 0 14px;
    border-radius: 26px;
    background: var(--vcp-color, #2b5cd8);
    color: #fff;
    font-size: 15px;
    font-weight: 600;
    line-height: 1;
    text-decoration: none;
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.22);
    transition: transform 0.15s ease, box-shadow 0.15s ease;
}

.vcp-fab:hover,
.vcp-fab:focus {
    color: #fff;
    text-decoration: none;
    transform: translateY(-2px);
    box-shadow: 0 10px 26px rgba(0, 0, 0, 0.26);
}

.vcp-fab:focus-visible {
    outline: 3px solid rgba(0, 0, 0, 0.35);
    outline-offset: 3px;
}

.vcp-fab--right {
    right: 20px;
}

.vcp-fab--left {
    left: 20px;
}

.vcp-fab__icon {
    display: inline-flex;
}

/* Icon only: a round button. */
.vcp-fab--icon {
    width: 52px;
    padding: 0;
    justify-content: center;
}

@media (max-width: 575px) {
    .vcp-fab {
        bottom: 14px;
    }

    .vcp-fab--right {
        right: 14px;
    }

    .vcp-fab--left {
        left: 14px;
    }
}

/* ---------------------------------------------------------------- Call page */

.vcp {
    --vcp-accent: #2b5cd8;
    --vcp-danger: #e0413a;
    --vcp-stage-bg: #11161f;
    max-width: 880px;
    margin: 0 auto 30px;
    text-align: center;
}

.vcp-panel {
    max-width: 560px;
    margin: 0 auto;
    padding: 30px 20px;
}

.vcp-panel--inline {
    padding-top: 16px;
}

.vcp-panel__icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 80px;
    height: 80px;
    margin-bottom: 16px;
    border-radius: 50%;
    background: rgba(43, 92, 216, 0.1);
    color: var(--vcp-accent);
}

.vcp-panel__title {
    margin: 0 0 12px;
    font-size: 26px;
    line-height: 1.25;
}

.vcp-panel__text {
    margin: 0 0 20px;
    font-size: 16px;
    line-height: 1.5;
}

.vcp-panel__note {
    margin: 14px 0 0;
    font-size: 13px;
    opacity: 0.75;
}

.vcp-button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    min-height: 48px;
    padding: 0 26px;
    font-size: 16px;
}

.vcp-link {
    display: block;
    margin-top: 14px;
}

.vcp-hours {
    margin: 0 auto 22px;
    border-collapse: collapse;
    text-align: left;
}

.vcp-hours th,
.vcp-hours td {
    padding: 4px 12px;
    font-size: 15px;
}

.vcp-hours th {
    font-weight: 600;
}

/* ---------------------------------------------------------------- Video area */

.vcp-stage {
    position: relative;
    overflow: hidden;
    aspect-ratio: 16 / 9;
    border-radius: 14px;
    background: var(--vcp-stage-bg);
    color: #fff;
}

/* Browsers without aspect-ratio. */
@supports not (aspect-ratio: 16 / 9) {
    .vcp-stage {
        height: 0;
        padding-bottom: 56.25%;
    }
}

.vcp-video {
    display: block;
    background: transparent;
}

.vcp-video--remote {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
}

/* Own image, small, in a corner and mirrored like a mirror. While nobody has answered yet it
   fills the whole area, so the customer sees how they look. */
.vcp-video--local {
    position: absolute;
    right: 14px;
    bottom: 84px;
    width: 26%;
    max-width: 220px;
    aspect-ratio: 4 / 3;
    border-radius: 10px;
    object-fit: cover;
    transform: scaleX(-1);
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.4);
    z-index: 2;
}

[data-vcp-state="ringing"] .vcp-video--local {
    right: 0;
    bottom: 0;
    width: 100%;
    max-width: none;
    height: 100%;
    border-radius: 0;
    opacity: 0.55;
    box-shadow: none;
}

.vcp--audio-only .vcp-video--local {
    display: none;
}

.vcp-stage__status {
    position: absolute;
    top: 50%;
    left: 50%;
    z-index: 3;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 16px;
    transform: translate(-50%, -50%);
    font-size: 18px;
    font-weight: 600;
    text-shadow: 0 1px 4px rgba(0, 0, 0, 0.6);
}

.vcp-pulse {
    position: relative;
    width: 18px;
    height: 18px;
    border-radius: 50%;
    background: #3ecf8e;
}

.vcp-pulse::after {
    content: "";
    position: absolute;
    inset: 0;
    border-radius: 50%;
    background: #3ecf8e;
    animation: vcp-pulse 1.4s ease-out infinite;
}

@keyframes vcp-pulse {
    from {
        transform: scale(1);
        opacity: 0.7;
    }

    to {
        transform: scale(3.2);
        opacity: 0;
    }
}

@media (prefers-reduced-motion: reduce) {
    .vcp-pulse::after {
        animation: none;
    }
}

.vcp-progress {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    z-index: 3;
    height: 4px;
    background: rgba(255, 255, 255, 0.15);
}

.vcp-progress__bar {
    display: block;
    width: 100%;
    height: 100%;
    background: #3ecf8e;
    transition: width 1.5s linear;
}

.vcp-controls {
    position: absolute;
    left: 50%;
    bottom: 16px;
    z-index: 4;
    display: flex;
    gap: 14px;
    transform: translateX(-50%);
}

.vcp-control {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 54px;
    height: 54px;
    padding: 0;
    border: 0;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.18);
    color: #fff;
    cursor: pointer;
    backdrop-filter: blur(6px);
    transition: background 0.15s ease;
}

.vcp-control:hover,
.vcp-control:focus {
    background: rgba(255, 255, 255, 0.3);
    outline: none;
}

.vcp-control:focus-visible {
    box-shadow: 0 0 0 3px rgba(255, 255, 255, 0.7);
}

.vcp-control.is-off {
    background: #fff;
    color: #11161f;
}

.vcp-control__off,
.vcp-control.is-off .vcp-control__on {
    display: none;
}

.vcp-control.is-off .vcp-control__off,
.vcp-control__on {
    display: inline-flex;
}

/* An effect that is on (background blur). */
.vcp-control.is-active {
    background: #fff;
    color: #11161f;
}

.vcp-control:disabled {
    opacity: 0.5;
    cursor: progress;
}

.vcp-control.is-expanded .vcp-control__on {
    display: none;
}

.vcp-control.is-expanded .vcp-control__off {
    display: inline-flex;
}

/* Full screen. Written as separate rules: a browser that does not know one of the
   prefixed selectors would drop a shared rule entirely. */
.vcp-stage:fullscreen {
    width: 100%;
    height: 100%;
    aspect-ratio: auto;
    border-radius: 0;
}

.vcp-stage:-webkit-full-screen {
    width: 100%;
    height: 100%;
    aspect-ratio: auto;
    border-radius: 0;
}

/* Same effect where the browser has no full screen for elements (iPhone). */
.vcp--expanded .vcp-stage {
    position: fixed;
    top: 0;
    right: 0;
    bottom: 0;
    left: 0;
    z-index: 100000;
    height: auto;
    padding-bottom: 0;
    aspect-ratio: auto;
    border-radius: 0;
}

.vcp--expanded .vcp-controls {
    bottom: calc(16px + env(safe-area-inset-bottom));
}

html.vcp-lock,
html.vcp-lock body {
    overflow: hidden;
}

.vcp-control--hangup {
    background: var(--vcp-danger);
}

.vcp-control--hangup:hover,
.vcp-control--hangup:focus {
    background: #c22f29;
}

/* Phones: a taller area, closer to the shape of the screen. */
@media (max-width: 575px) {
    .vcp-stage {
        aspect-ratio: 3 / 4;
        border-radius: 10px;
    }

    .vcp-video--local {
        width: 32%;
        bottom: 82px;
        right: 10px;
    }

    .vcp-panel__title {
        font-size: 22px;
    }
}
