/* VichBot Public CSS - Interactive Floating Launcher & Story Video Modal */

:root {
    --vichbot-primary: #7c3aed;
    --vichbot-secondary: #9333ea;
    --vichbot-other-buttons: #374151;
    --vichbot-text: #f9fafb;
    --vichbot-glass: rgba(255, 255, 255, 0.2);
    --vichbot-font: 'Vazirmatn', 'IRANYekan', system-ui, -apple-system, sans-serif;
    --vichbot-font-size: 18px;
}

.vichbot-root {
    position: fixed;
    z-index: 999990;
    direction: rtl;
    font-family: var(--vichbot-font);
}

/* Floating Launcher Widget Positions */
.vichbot-root.pos-right {
    bottom: 28px;
    right: 28px;
}

.vichbot-root.pos-center {
    bottom: 28px;
    left: 50%;
    transform: translateX(-50%);
}

.vichbot-root.pos-left {
    bottom: 28px;
    left: 28px;
}

/* Shapes */
.vichbot-root.shape-circle .vichbot-launcher { border-radius: 50%; }
.vichbot-root.shape-rounded .vichbot-launcher { border-radius: 22px; }
.vichbot-root.shape-square .vichbot-launcher { border-radius: 6px; }

/* Sizes */
.vichbot-root.size-large .vichbot-launcher { width: 96px; height: 96px; }
.vichbot-root.size-medium .vichbot-launcher { width: 76px; height: 76px; }
.vichbot-root.size-small .vichbot-launcher { width: 58px; height: 58px; }

/* Launcher Button */
.vichbot-launcher {
    position: relative;
    padding: 0;
    border: 4px solid #ffffff;
    cursor: pointer;
    background: #000000;
    box-shadow: 0 12px 30px rgba(124, 58, 237, 0.35);
    overflow: hidden;
    transition: transform 0.3s cubic-bezier(0.34, 1.56, 0.64, 1), box-shadow 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
}

.vichbot-launcher:hover {
    transform: scale(1.08);
    box-shadow: 0 18px 36px rgba(124, 58, 237, 0.5);
}

.vichbot-launcher-video,
.vichbot-launcher-img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.vichbot-launcher-placeholder {
    color: #ffffff;
    display: flex;
    align-items: center;
    justify-content: center;
}

.vichbot-pulse-ring {
    position: absolute;
    top: -8px;
    left: -8px;
    right: -8px;
    bottom: -8px;
    border: 3px solid var(--vichbot-primary);
    border-radius: inherit;
    animation: vichbot-pulse 2s infinite;
    pointer-events: none;
}

@keyframes vichbot-pulse {
    0% { transform: scale(0.95); opacity: 0.9; }
    50% { transform: scale(1.12); opacity: 0; }
    100% { transform: scale(0.95); opacity: 0; }
}

.vichbot-hidden {
    display: none !important;
}

/* Story Video Modal */
.vichbot-modal-backdrop {
    position: fixed;
    top: 0; left: 0;
    width: 100vw; height: 100vh;
    background: rgba(0, 0, 0, 0.7);
    backdrop-filter: blur(10px);
    z-index: 999999;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.3s ease;
}

.vichbot-modal-backdrop:not(.vichbot-hidden) {
    opacity: 1;
    pointer-events: auto;
}

.vichbot-modal-container {
    position: relative;
    width: 380px;
    height: 670px;
    max-width: 94vw;
    max-height: 92vh;
    background: #000000;
    border-radius: 24px;
    overflow: hidden;
    box-shadow: 0 25px 60px rgba(0, 0, 0, 0.6);
    display: flex;
    flex-direction: column;
}

/* Progress Bar */
.vichbot-progress-container {
    position: absolute;
    top: 14px;
    left: 14px;
    right: 14px;
    height: 4px;
    background: rgba(255, 255, 255, 0.35);
    border-radius: 2px;
    z-index: 20;
    overflow: hidden;
}

.vichbot-progress-bar {
    height: 100%;
    width: 0%;
    background: var(--vichbot-primary);
    border-radius: 2px;
    transition: width 0.1s linear;
}

/* Header Controls */
.vichbot-modal-header {
    position: absolute;
    top: 26px;
    left: 14px;
    right: 14px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    z-index: 20;
}

.vichbot-step-title {
    color: #ffffff;
    font-size: 15px;
    font-weight: 700;
    text-shadow: 0 2px 6px rgba(0,0,0,0.7);
}

.vichbot-header-actions {
    display: flex;
    gap: 8px;
}

.vichbot-icon-btn {
    background: rgba(0, 0, 0, 0.45);
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.25);
    color: #ffffff;
    width: 38px;
    height: 38px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.2s ease;
}

.vichbot-icon-btn:hover {
    background: rgba(0, 0, 0, 0.8);
    transform: scale(1.08);
}

/* Video Surface */
.vichbot-video-wrapper {
    position: relative;
    width: 100%;
    height: 100%;
    background: #000;
}

.vichbot-video-wrapper video {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.vichbot-play-overlay-btn {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background: rgba(0, 0, 0, 0.45);
    backdrop-filter: blur(12px);
    border: none;
    color: #ffffff;
    width: 72px;
    height: 72px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    z-index: 15;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.2s ease;
}

.vichbot-video-wrapper:hover .vichbot-play-overlay-btn {
    opacity: 1;
    pointer-events: auto;
}

/* Dynamic CTA Buttons Container */
.vichbot-cta-container {
    position: absolute;
    bottom: 26px;
    left: 16px;
    right: 16px;
    display: flex;
    flex-direction: column;
    gap: 12px;
    z-index: 25;
}

.vichbot-cta-btn {
    background: var(--vichbot-primary);
    color: var(--vichbot-text);
    padding: 14px 22px;
    border-radius: 16px;
    font-size: var(--vichbot-font-size);
    font-weight: 800;
    text-align: center;
    cursor: pointer;
    border: 1px solid rgba(255, 255, 255, 0.3);
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.35);
    transition: all 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
    display: flex;
    align-items: center;
    justify-content: center;
    text-decoration: none;
}

.vichbot-glassmorphism .vichbot-cta-btn {
    background: rgba(255, 255, 255, 0.2);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
}

.vichbot-cta-btn:hover {
    background: var(--vichbot-secondary);
    transform: translateY(-3px);
    box-shadow: 0 14px 30px rgba(147, 51, 234, 0.5);
}

/* Custom Popup Form Overlay */
.vichbot-popup-overlay {
    position: absolute;
    top: 0; left: 0;
    width: 100%; height: 100%;
    background: rgba(0, 0, 0, 0.8);
    backdrop-filter: blur(10px);
    z-index: 30;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
}

.vichbot-popup-card {
    background: #ffffff;
    color: #1f2937;
    border-radius: 20px;
    padding: 24px;
    width: 100%;
    max-height: 85%;
    overflow-y: auto;
    position: relative;
    box-shadow: 0 25px 30px rgba(0, 0, 0, 0.4);
}

.vichbot-close-popup-btn {
    position: absolute;
    top: 14px;
    left: 14px;
    background: #f3f4f6;
    border: none;
    font-size: 22px;
    width: 34px;
    height: 34px;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
}
