/* =============================================
   VisitorCC — Chat Widget Styles
   Floating chat button + panel for visitors
   ============================================= */

/* ── Floating Chat Button ─────────────────── */
.vcc-chat-btn {
    position: fixed;
    bottom: 24px;
    left: 24px;
    width: 56px;
    height: 56px;
    border-radius: 50%;
    background: linear-gradient(135deg, #6366f1, #7c3aed);
    color: white;
    border: none;
    cursor: pointer;
    box-shadow: 0 4px 20px rgba(99, 102, 241, 0.4);
    z-index: 10000;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
}

.vcc-chat-btn:hover {
    transform: scale(1.1);
    box-shadow: 0 6px 28px rgba(99, 102, 241, 0.6);
}

.vcc-chat-btn svg {
    width: 24px;
    height: 24px;
}

.vcc-chat-btn .vcc-unread-badge {
    position: absolute;
    top: -4px;
    right: -4px;
    width: 20px;
    height: 20px;
    background: #ef4444;
    border-radius: 50%;
    font-size: 11px;
    font-weight: 700;
    display: flex;
    align-items: center;
    justify-content: center;
    border: 2px solid #0a0e1a;
}

.vcc-chat-btn .vcc-unread-badge.hidden {
    display: none;
}

/* ── Chat Panel ───────────────────────────── */
.vcc-chat-panel {
    position: fixed;
    bottom: 92px;
    left: 24px;
    width: 360px;
    height: 480px;
    background: rgba(15, 23, 42, 0.97);
    border: 1px solid rgba(99, 102, 241, 0.2);
    border-radius: 16px;
    box-shadow: 0 12px 40px rgba(0, 0, 0, 0.5);
    backdrop-filter: blur(20px);
    z-index: 10001;
    display: none;
    flex-direction: column;
    overflow: hidden;
    font-family: 'Inter', -apple-system, sans-serif;
}

.vcc-chat-panel.open {
    display: flex;
    animation: vccSlideUp 0.3s ease;
}

@keyframes vccSlideUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Header */
.vcc-chat-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 16px 20px;
    border-bottom: 1px solid rgba(99, 102, 241, 0.15);
    background: rgba(15, 23, 42, 0.95);
}

.vcc-chat-header-left {
    display: flex;
    align-items: center;
    gap: 10px;
}

.vcc-chat-header-icon {
    color: #818cf8;
}

.vcc-chat-title {
    font-size: 15px;
    font-weight: 700;
    color: #f1f5f9;
}

.vcc-chat-close {
    background: none;
    border: none;
    color: #94a3b8;
    cursor: pointer;
    padding: 4px;
    border-radius: 6px;
    transition: all 0.2s;
    display: flex;
    align-items: center;
    justify-content: center;
}

.vcc-chat-close:hover {
    color: #f1f5f9;
    background: rgba(99, 102, 241, 0.15);
}

/* Messages Area */
.vcc-chat-messages {
    flex: 1;
    overflow-y: auto;
    padding: 16px;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.vcc-chat-messages::-webkit-scrollbar {
    width: 4px;
}

.vcc-chat-messages::-webkit-scrollbar-thumb {
    background: rgba(99, 102, 241, 0.3);
    border-radius: 2px;
}

.vcc-chat-empty {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    color: #64748b;
    font-size: 13px;
    text-align: center;
    gap: 6px;
}

/* Message Bubbles */
.vcc-msg {
    max-width: 80%;
    padding: 10px 14px;
    border-radius: 12px;
    font-size: 13px;
    line-height: 1.5;
    word-wrap: break-word;
}

.vcc-msg.visitor {
    align-self: flex-end;
    background: linear-gradient(135deg, #6366f1, #7c3aed);
    color: white;
    border-bottom-right-radius: 4px;
}

.vcc-msg.admin {
    align-self: flex-start;
    background: rgba(30, 41, 59, 0.8);
    color: #e2e8f0;
    border: 1px solid rgba(99, 102, 241, 0.1);
    border-bottom-left-radius: 4px;
}

.vcc-msg-time {
    font-size: 10px;
    color: rgba(255, 255, 255, 0.5);
    margin-top: 4px;
}

.vcc-msg.admin .vcc-msg-time {
    color: #64748b;
}

/* Input Area */
.vcc-chat-input-area {
    display: flex;
    gap: 8px;
    padding: 12px 16px;
    border-top: 1px solid rgba(99, 102, 241, 0.15);
    background: rgba(15, 23, 42, 0.95);
}

.vcc-chat-input {
    flex: 1;
    background: rgba(30, 41, 59, 0.6);
    border: 1px solid rgba(99, 102, 241, 0.15);
    border-radius: 10px;
    padding: 10px 14px;
    color: #f1f5f9;
    font-size: 13px;
    font-family: inherit;
    outline: none;
    transition: border-color 0.2s;
}

.vcc-chat-input:focus {
    border-color: rgba(99, 102, 241, 0.4);
}

.vcc-chat-input::placeholder {
    color: #64748b;
}

.vcc-chat-send {
    background: linear-gradient(135deg, #6366f1, #7c3aed);
    color: white;
    border: none;
    border-radius: 10px;
    padding: 10px 18px;
    font-size: 13px;
    font-weight: 600;
    font-family: inherit;
    cursor: pointer;
    transition: all 0.2s;
}

.vcc-chat-send:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(99, 102, 241, 0.4);
}

/* ── Call Overlay ─────────────────────────── */
.vcc-call-overlay {
    position: fixed;
    inset: 0;
    background: rgba(10, 14, 26, 0.95);
    z-index: 10002;
    display: none;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    font-family: 'Inter', sans-serif;
}

.vcc-call-overlay.active {
    display: flex;
}

.vcc-call-info {
    text-align: center;
    margin-bottom: 32px;
}

.vcc-call-info h3 {
    font-size: 22px;
    font-weight: 700;
    color: #f1f5f9;
    margin-bottom: 8px;
}

.vcc-call-info p {
    font-size: 14px;
    color: #94a3b8;
}

.vcc-call-status {
    font-size: 14px;
    color: #10b981;
    margin-top: 8px;
}

/* Video containers */
.vcc-video-container {
    position: relative;
    width: 100%;
    max-width: 640px;
    margin-bottom: 24px;
}

.vcc-remote-video {
    width: 100%;
    max-height: 400px;
    background: #111827;
    border-radius: 16px;
    border: 1px solid rgba(99, 102, 241, 0.2);
    object-fit: cover;
}

.vcc-local-video {
    position: absolute;
    bottom: 12px;
    right: 12px;
    width: 120px;
    height: 90px;
    background: #1e293b;
    border-radius: 10px;
    border: 2px solid rgba(99, 102, 241, 0.3);
    object-fit: cover;
}

/* Call buttons */
.vcc-call-actions {
    display: flex;
    gap: 16px;
}

.vcc-call-btn {
    width: 56px;
    height: 56px;
    border-radius: 50%;
    border: none;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s;
    color: white;
}

.vcc-call-btn:hover {
    transform: scale(1.1);
}

.vcc-call-btn.accept {
    background: #10b981;
    box-shadow: 0 4px 16px rgba(16, 185, 129, 0.4);
}

.vcc-call-btn.reject,
.vcc-call-btn.end {
    background: #ef4444;
    box-shadow: 0 4px 16px rgba(239, 68, 68, 0.4);
}

.vcc-call-btn.mute {
    background: rgba(30, 41, 59, 0.8);
    border: 1px solid rgba(99, 102, 241, 0.2);
}

.vcc-call-btn.mute.active {
    background: #f59e0b;
}

/* ── Incoming Call Banner ─────────────────── */
.vcc-incoming-call {
    position: fixed;
    top: 20px;
    left: 50%;
    transform: translateX(-50%);
    background: rgba(15, 23, 42, 0.97);
    border: 1px solid rgba(16, 185, 129, 0.3);
    border-radius: 16px;
    padding: 20px 28px;
    display: none;
    align-items: center;
    gap: 20px;
    z-index: 10003;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.5);
    animation: vccSlideDown 0.4s ease;
}

.vcc-incoming-call.active {
    display: flex;
}

@keyframes vccSlideDown {
    from {
        opacity: 0;
        transform: translateX(-50%) translateY(-20px);
    }

    to {
        opacity: 1;
        transform: translateX(-50%) translateY(0);
    }
}

.vcc-incoming-info {
    text-align: left;
}

.vcc-incoming-info h4 {
    font-size: 15px;
    font-weight: 700;
    color: #f1f5f9;
    margin-bottom: 4px;
}

.vcc-incoming-info p {
    font-size: 12px;
    color: #94a3b8;
}

.vcc-incoming-actions {
    display: flex;
    gap: 10px;
}

/* Ringing animation */
@keyframes vccRing {

    0%,
    100% {
        transform: rotate(0deg);
    }

    10%,
    30%,
    50%,
    70%,
    90% {
        transform: rotate(10deg);
    }

    20%,
    40%,
    60%,
    80% {
        transform: rotate(-10deg);
    }
}

.vcc-ringing {
    animation: vccRing 0.5s ease-in-out infinite;
}

/* Camera toggle */
.vcc-call-btn.camera {
    background: rgba(30, 41, 59, 0.8);
    border: 1px solid rgba(99, 102, 241, 0.2);
}

.vcc-call-btn.camera.active {
    background: #ef4444;
    border-color: #ef4444;
}

/* Call timer */
.vcc-call-timer {
    font-size: 24px;
    font-weight: 700;
    color: #818cf8;
    font-variant-numeric: tabular-nums;
    letter-spacing: 2px;
    margin: 4px 0 0;
}

/* System messages in chat */
.vcc-msg.system {
    align-self: center;
    max-width: 100%;
    text-align: center;
    padding: 0;
    margin: 4px 0;
    background: none;
    border-radius: 0;
}

.vcc-system-text {
    display: inline-block;
    font-size: 11px;
    color: #94a3b8;
    background: rgba(30, 41, 59, 0.5);
    padding: 4px 14px;
    border-radius: 12px;
    border: 1px solid rgba(99, 102, 241, 0.1);
}

/* Inline Form in chat */
.vcc-form-message {
    align-self: stretch;
    width: 100%;
    text-align: left;
    margin: 6px 0;
}

.vcc-form-inline {
    background: rgba(15, 23, 42, 0.98);
    border: 1px solid rgba(99, 102, 241, 0.3);
    border-radius: 14px;
    padding: 14px;
    width: 100%;
    max-width: 100%;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.35);
}

.vcc-form-inline .vcc-form-header {
    text-align: left;
    margin-bottom: 12px;
}

.vcc-form-inline .vcc-form-header h3 {
    font-size: 15px;
    color: #f1f5f9;
    margin-bottom: 4px;
}

.vcc-form-inline .vcc-form-header p {
    font-size: 12px;
    color: #94a3b8;
}

.vcc-form-group {
    margin-bottom: 10px;
}

.vcc-form-group label {
    display: block;
    font-size: 12px;
    color: #94a3b8;
    margin-bottom: 6px;
    font-weight: 600;
}

.vcc-form-group input,
.vcc-form-group textarea {
    width: 100%;
    background: rgba(30, 41, 59, 0.6);
    border: 1px solid rgba(99, 102, 241, 0.2);
    border-radius: 10px;
    padding: 10px 12px;
    color: #f1f5f9;
    font-size: 13px;
    outline: none;
    transition: all 0.2s;
    font-family: inherit;
}

.vcc-form-group input:focus,
.vcc-form-group textarea:focus {
    border-color: #6366f1;
    background: rgba(30, 41, 59, 0.85);
}

.vcc-form-inline .vcc-form-actions {
    display: flex;
    gap: 10px;
    margin-top: 14px;
}

.vcc-form-inline .vcc-form-btn {
    flex: 1;
    padding: 10px;
    border-radius: 10px;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
    border: none;
    font-family: inherit;
}

.vcc-form-inline .vcc-form-btn.submit {
    background: linear-gradient(135deg, #6366f1, #7c3aed);
    color: white;
}

.vcc-form-inline .vcc-form-btn.submit:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(99, 102, 241, 0.45);
}

.vcc-form-inline .vcc-form-btn.cancel {
    background: rgba(30, 41, 59, 0.8);
    color: #94a3b8;
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.vcc-form-inline .vcc-form-btn.cancel:hover {
    background: rgba(30, 41, 59, 1);
    color: #f1f5f9;
}

.vcc-form-feedback {
    min-height: 16px;
    margin-top: 8px;
    font-size: 11px;
    color: #94a3b8;
    text-align: left;
}

.vcc-form-feedback.error {
    color: #fca5a5;
}

.vcc-form-feedback.success {
    color: #86efac;
}

/* ── Responsive ───────────────────────────── */
@media (max-width: 480px) {
    .vcc-chat-panel {
        width: calc(100vw - 32px);
        left: 16px;
        bottom: 84px;
        height: 60vh;
    }

    .vcc-chat-btn {
        bottom: 16px;
        left: 16px;
        width: 50px;
        height: 50px;
    }
}
