/* ========================================
   BITZ4GROUP AI CHATBOT - STYLES
   Color Scheme: Biz4Group Blue (#2563eb, #1e40af)
   ======================================== */

/* ── CSS variables scoped to chatbot only (prevents overriding site :root vars) ── */
.chatbot-minimized,
.chatbot-container,
.dropdown-minimize-btn,
#chatbot-minimized,
#chatbot-container,
#dropdown-minimize-btn {
    --primary-blue: #233c58;
    --primary-blue-dark: #1a2d42;
    --primary-blue-light: #2d4a6b;
    --secondary-gray: #f3f4f6;
    --text-dark: #1f2937;
    --text-light: #6b7280;
    --white: #ffffff;
    --border-color: #e5e7eb;
    --success-green: #10b981;
    --danger-red: #ef4444;
    --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
    --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
    --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.1);
    --shadow-xl: 0 20px 25px -5px rgba(0, 0, 0, 0.1);
    --transition-fast: 0.2s ease;
    --transition-normal: 0.3s ease;

    /* ── Fluid chatbot dimensions ── */
    --chatbot-width:        clamp(300px, 28vw, 440px);
    --chatbot-height:       min(clamp(400px, 65vh, 600px), calc(100vh - 160px));
    --chatbot-max-width:    clamp(300px, 28vw, 440px);
    --chatbot-right:        clamp(12px, 2vw, 30px);
    --chatbot-bottom:       clamp(68px, 8vh, 88px);
    --chatbot-radius:       clamp(16px, 2vw, 24px);
    --maximized-width:      clamp(340px, 42vw, 620px);
    --dropdown-bottom:      clamp(10px, 1.5vh, 22px);

    /* ── Fluid element dimensions ── */
    --avatar-size:          clamp(38px, 4vw, 52px);
    --welcome-avatar-size:  clamp(110px, 18vw, 120px);
    --btn-size:             clamp(30px, 3vw, 38px);
    --send-btn-size:        clamp(34px, 3.5vw, 42px);
    --icon-size:            clamp(16px, 1.6vw, 20px);

    /* ── Fluid typography ── */
    --font-xs:   clamp(11px, 1vw,  12px);
    --font-sm:   clamp(12px, 1.1vw, 13px);
    --font-base: clamp(13px, 1.2vw, 15px);
    --font-md:   clamp(14px, 1.4vw, 16px);
    --font-lg:   clamp(15px, 1.6vw, 18px);
    --font-xl:   clamp(18px, 2vw,  24px);

    /* ── Fluid spacing ── */
    --pad-sm:   clamp(8px,  1vw,  12px);
    --pad-md:   clamp(12px, 1.5vw, 18px);
    --pad-lg:   clamp(16px, 2vw,  22px);
}

/* ========================================
   CHATBOT SCOPED RESET
   ======================================== */

/* Scope reset only to chatbot elements */
.chatbot-minimized *,
.chatbot-container *,
.dropdown-minimize-btn *,
#chatbot-minimized *,
#chatbot-container *,
#dropdown-minimize-btn * {
    box-sizing: border-box;
}

/* ========================================
   MINIMIZED CHATBOT ICON
   ======================================== */

.chatbot-minimized {
    position: fixed;
    bottom: 40px;
    right: 40px;
    cursor: pointer;
    z-index: 1000;
    opacity: 0;
    visibility: hidden;
    transform: translateY(20px);
    transition: opacity 0.3s ease, transform 0.3s ease, visibility 0.3s;
}

.chatbot-minimized.active {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.minimized-container {
    position: relative;
    width: 70px;
    height: 70px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: transform var(--transition-fast);
}

.minimized-container:hover {
    transform: scale(1.08);
}

/* Morphing rings */
.morph-ring {
    position: absolute;
    top: 50%;
    left: 50%;
    border-radius: 50%;
    transform: translate(-50%, -50%);
    pointer-events: none;
}

.morph-ring-1 {
    width: 84px;
    height: 84px;
    border: 3px solid transparent;
    background: linear-gradient( #00d4ff, #764ba2) padding-box,
                linear-gradient(135deg, #00d4ff, #764ba2) border-box;
    animation: morphRing1 3s ease-in-out infinite;
}

.morph-ring-2 {
    width: 104px;
    height: 104px;
    border: 2px solid rgba(0, 212, 255, 0.45);
    animation: morphRing2 3s ease-in-out infinite 0.5s;
}

.morph-ring-3 {
    width: 124px;
    height: 124px;
    border: 1.5px solid rgba(118, 75, 162, 0.3);
    animation: morphRing3 3s ease-in-out infinite 1s;
}

@keyframes morphRing1 {
    0%, 100% {
        transform: translate(-50%, -50%) scale(1) rotate(0deg);
        border-radius: 50%;
    }
    33% {
        transform: translate(-50%, -50%) scale(1.1) rotate(120deg);
        border-radius: 40% 60% 60% 40% / 60% 30% 70% 40%;
    }
    66% {
        transform: translate(-50%, -50%) scale(0.95) rotate(240deg);
        border-radius: 60% 40% 30% 70% / 40% 60% 40% 60%;
    }
}

@keyframes morphRing2 {
    0%, 100% { transform: translate(-50%, -50%) scale(1); opacity: 0.5; }
    50% { transform: translate(-50%, -50%) scale(1.15); opacity: 0.8; }
}

@keyframes morphRing3 {
    0%, 100% { transform: translate(-50%, -50%) scale(1); opacity: 0.3; }
    50% { transform: translate(-50%, -50%) scale(1.2); opacity: 0.5; }
}

.minimized-avatar-wrapper {
    width: 60px;
    height: 60px;
    border-radius: 50%;
    overflow: hidden;
    flex-shrink: 0;
    position: relative;
    z-index: 2;
    border: 3px solid #fff;
    box-shadow: 0 0 16px rgba(0, 220, 255, 0.5), 0 0 30px rgba(0, 200, 255, 0.2);
}

.minimized-avatar {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

/* Mic badge overlay */
.minimized-mic-badge {
    position: absolute;
    bottom: 0;
    right: 0;
    width: 26px;
    height: 26px;
    background: linear-gradient(135deg, #00d4ff, #00b8ff);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #fff;
    z-index: 3;
    border: 2px solid #fff;
    box-shadow: 0 0 10px rgba(0, 212, 255, 0.7);
    animation: micPulse 2s ease-in-out infinite;
}

@keyframes micPulse {
    0%, 100% {
        transform: scale(1);
        box-shadow: 0 0 10px rgba(0, 212, 255, 0.7);
    }
    50% {
        transform: scale(1.1);
        box-shadow: 0 0 18px rgba(0, 212, 255, 0.9);
    }
}

/* ========================================
   MAIN CHATBOT CONTAINER
   ======================================== */

.chatbot-container {
    position: fixed;
    bottom: var(--chatbot-bottom);
    right: var(--chatbot-right);
    width: var(--chatbot-width);
    max-width: var(--chatbot-max-width);
    height: var(--chatbot-height);
    max-height: calc(100vh - 50px);
    min-height: 450px;
    background: var(--white);
    border-radius: var(--chatbot-radius);
    box-shadow: var(--shadow-xl);
    display: flex;
    flex-direction: column;
    overflow: hidden;
    animation: slideInUp 0.4s ease;
    transition: width 0.3s cubic-bezier(0.4, 0, 0.2, 1),
                height 0.3s cubic-bezier(0.4, 0, 0.2, 1),
                bottom 0.3s cubic-bezier(0.4, 0, 0.2, 1),
                right 0.3s cubic-bezier(0.4, 0, 0.2, 1),
                transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    z-index: 999;
    will-change: width, height, transform;
}

.chatbot-container.minimized {
    display: none;
}

.chatbot-container.minimized ~ .dropdown-minimize-btn {
    display: none;
}

.chatbot-container.maximized {
    width: var(--maximized-width);
    max-width: var(--maximized-width);
    height: calc(100vh - 140px);
    max-height: calc(100vh - 140px);
    border-radius: var(--chatbot-radius);
    bottom: var(--chatbot-bottom);
    right: var(--chatbot-right);
    z-index: 1000;
}

.chatbot-container.maximized ~ .dropdown-minimize-btn {
    right: var(--chatbot-right);
    bottom: var(--dropdown-bottom);
}

/* ========================================
   CHATBOT HEADER
   ======================================== */

.chatbot-header {
    background: linear-gradient(135deg, var(--primary-blue) 0%, var(--primary-blue-dark) 100%);
    color: var(--white);
    padding: var(--pad-md) var(--pad-lg);
    display: flex;
    justify-content: space-between;
    align-items: center;
    box-shadow: var(--shadow-md);
}

.header-left {
    display: flex;
    align-items: center;
    gap: var(--pad-sm);
}

.avatar-wrapper {
    position: relative;
}

.avatar {
    width: var(--avatar-size);
    height: var(--avatar-size);
    border-radius: 50%;
    border: 2px solid rgba(255, 255, 255, 0.3);
    object-fit: cover;
}

.status-indicator {
    position: absolute;
    bottom: 2px;
    right: 2px;
    width: 12px;
    height: 12px;
    background: var(--success-green);
    border: 2px solid var(--white);
    border-radius: 50%;
}

.header-info {
    display: flex;
    flex-direction: column;
}

.assistant-name {
    font-size: var(--font-lg);
    font-weight: 600;
    margin: 0;
}

.assistant-status {
    font-size: var(--font-xs);
    opacity: 0.9;
    margin: 2px 0 0 0;
}

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

#chatbot-container .icon-btn {
    width: var(--btn-size);
    height: var(--btn-size);
    background: rgba(255, 255, 255, 0.2);
    border: none;
    border-radius: 8px;
    color: var(--white);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background var(--transition-fast);
}

#chatbot-container .icon-btn:hover {
    background: rgba(255, 255, 255, 0.3);
}

#chatbot-container .icon-btn:active {
    transform: scale(0.95);
}

/* ========================================
   WELCOME SCREEN
   ======================================== */

.welcome-screen {
    flex: 1;
    min-height: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--white);
    padding: clamp(20px, 8vh, 20px) 20px 20px 20px;
    overflow-y: auto;
    box-sizing: border-box;
}

.welcome-content {
    text-align: center;
    width: 100%;
    max-width: 100%;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
}

.welcome-avatar-wrapper {
    position: relative;
    display: inline-block;
    margin: 0 auto;
    padding: clamp(10px, 2vh, 20px);
    padding-bottom: 0;
}
/* 
.orbit-container {
    position: absolute;
    width: 260px;
    height: 260px;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    animation: orbitSpin 12s linear infinite;
    pointer-events: none;
    z-index: 0;
}

@keyframes orbitSpin {
    0%   { transform: translate(-50%, -50%) rotate(0deg); }
    100% { transform: translate(-50%, -50%) rotate(360deg); }
}

.orbit-dot {
    position: absolute;
    width: 10px;
    height: 10px;
    background: linear-gradient(135deg, #00d4ff, #764ba2);
    border-radius: 50%;
    box-shadow: 0 0 12px rgba(0, 212, 255, 0.8);
}

.orbit-dot:nth-child(1) { top: 0;   left: 50%; transform: translateX(-50%); }
.orbit-dot:nth-child(2) { bottom: 0; left: 50%; transform: translateX(-50%); }
.orbit-dot:nth-child(3) { left: 0;  top: 50%;  transform: translateY(-50%); }
.orbit-dot:nth-child(4) { right: 0; top: 50%;  transform: translateY(-50%); } */

.welcome-avatar {
    width: var(--welcome-avatar-size);
    height: var(--welcome-avatar-size);
    border-radius: 50%;
    object-fit: cover;
    box-shadow: var(--shadow-lg);
}

.welcome-call-btn {
    position: absolute;
    bottom: clamp(6px, 1vw, 12px);
    right: clamp(6px, 1vw, 12px);
    width: clamp(38px, 6vw, 48px);
    height: clamp(38px, 6vw, 48px);
    background: #233c58;
    border: 4px solid var(--white);
    border-radius: 50%;
    color: var(--white);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all var(--transition-fast);
    box-shadow: var(--shadow-md);
}
.welcome-call-btn svg {
    width: 24px;
    height: 24px;
}
.welcome-call-btn:hover {
    background: #1a2d42;
    transform: scale(1.1);
    box-shadow: var(--shadow-lg);
}

.welcome-call-btn:active {
    transform: scale(1.05);
}

.welcome-message {
    margin-top: clamp(14px, 2vh, 24px);
    font-size: var(--font-md);
    color: var(--text-dark);
    font-weight: 500;
    line-height: 1.5;
    max-width: 90%;
}

.welcome-highlight {
    color: #233c58;
    font-weight: 700;
    background: linear-gradient(135deg, #233c58, #3b6cb7);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

/* ========================================
   CHAT MESSAGES AREA
   ======================================== */

.chat-messages {
    flex: 1;
    min-height: 0;
    padding: var(--pad-lg);
    overflow-y: auto;
    background: var(--secondary-gray);
    display: flex;
    flex-direction: column;
    gap: clamp(10px, 1.5vh, 16px);
}

.chat-messages::-webkit-scrollbar {
    width: 6px;
}

.chat-messages::-webkit-scrollbar-track {
    background: transparent;
}

.chat-messages::-webkit-scrollbar-thumb {
    background: #cbd5e1;
    border-radius: 3px;
}

.message {
    display: flex;
    gap: 10px;
    animation: fadeIn 0.3s ease;
}

.message.bot {
    align-items: flex-start;
}

.message.user {
    flex-direction: row-reverse;
}

.message-avatar {
    width: clamp(26px, 3vw, 34px);
    height: clamp(26px, 3vw, 34px);
    border-radius: 50%;
    object-fit: cover;
    flex-shrink: 0;
}

.message-content {
    max-width: 78%;
    padding: var(--pad-sm) var(--pad-md);
    border-radius: clamp(12px, 1.5vw, 16px);
    font-size: var(--font-base);
    line-height: 1.5;
    word-wrap: break-word;
}

.message.bot .message-content {
    background: var(--white);
    color: var(--text-dark);
    border-bottom-left-radius: 4px;
    box-shadow: var(--shadow-sm);
}

.message.user .message-content {
    background: linear-gradient(135deg, var(--primary-blue) 0%, var(--primary-blue-light) 100%);
    color: var(--white);
    border-bottom-right-radius: 4px;
}

.project-link {
    color: #2563eb;
    text-decoration: underline;
    font-weight: 500;
    cursor: pointer;
    transition: color 0.2s ease;
}
.project-link:hover {
    color: #1e40af;
}
.message.bot .message-content .project-link {
    color: #2563eb;
}

/* Numbered list styling for project listings */
.message-content p {
    margin: 0;
    padding: 0;
}

.message-content p + ol {
    margin-top: 6px;
}

.message-content ol + p {
    margin-top: 6px;
}

.message-content ol {
    margin: 0;
    padding-left: 20px;
}

.message-content ol li {
    margin-bottom: 6px;
    line-height: 1.6;
}

.message-content ol li:last-child {
    margin-bottom: 0;
}

.message.system .message-content {
    background: #fef3c7;
    color: #92400e;
    border-left: 3px solid #f59e0b;
    max-width: 100%;
    font-size: 13px;
}

.message.system {
    justify-content: center;
}

/* Initial bot message styling */
.initial-message {
    background: linear-gradient(135deg, #eff6ff 0%, #dbeafe 100%);
    border: 1px solid #bfdbfe;
    color: var(--primary-blue-dark);
    padding: 16px;
    border-radius: 12px;
    text-align: center;
    font-weight: 500;
    animation: fadeInScale 0.5s ease;
}

/* Call ended message */
.call-ended-message {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 16px;
    padding: 24px;
    background: var(--white);
    border-radius: 16px;
    box-shadow: var(--shadow-md);
    animation: fadeInScale 0.4s ease;
}

.call-ended-icon {
    width: 48px;
    height: 48px;
    background: #dcfce7;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--success-green);
}

.call-ended-text {
    font-size: 16px;
    font-weight: 600;
    color: var(--text-dark);
}

.rating-section {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 12px;
    width: 100%;
}

.rating-label {
    font-size: 14px;
    color: var(--text-light);
}

.rating-stars {
    display: flex;
    gap: 8px;
}

.star {
    width: 32px;
    height: 32px;
    cursor: pointer;
    color: #d1d5db;
    transition: color var(--transition-fast);
}

.star:hover,
.star.active {
    color: #fbbf24;
}

/* ========================================
   CHAT INPUT AREA
   ======================================== */

.chat-input-wrapper {
    flex-shrink: 0;
    padding: var(--pad-md) var(--pad-lg);
    background: var(--white);
    border-top: 1px solid var(--border-color);
}

.input-container {
    display: flex;
    align-items: center;
    gap: 12px;
    background: var(--secondary-gray);
    border-radius: 12px;
    padding: 8px 12px;
}

.message-input {
    flex: 1;
    border: none;
    background: transparent;
    font-size: var(--font-base);
    color: var(--text-dark);
    outline: none;
    padding: var(--pad-sm);
    font-family: inherit;
}

.message-input:focus {
    font-family: inherit;
    font-weight: 500;
    color: var(--primary-blue-dark);
}

.message-input::placeholder {
    color: var(--text-light);
}

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

#chatbot-container .action-btn {
    width: var(--btn-size);
    height: var(--btn-size);
    border: none;
    border-radius: 8px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all var(--transition-fast);
}

#chatbot-container .mute-btn {
    background: transparent;
    color: var(--text-light);
}

#chatbot-container .mute-btn:hover {
    background: var(--text-light);
    color: var(--white);
}

#chatbot-container .mute-btn.muted {
    background: var(--danger-red);
    color: var(--white);
}

#chatbot-container .mute-btn.muted:hover {
    background: #dc2626;
}

#chatbot-container .call-btn {
    background: transparent;
    color: var(--text-light);
}

#chatbot-container .call-btn:hover {
    background: var(--primary-blue);
    color: var(--white);
}

/* ── Call icon button in header with animated arcs ── */
#chatbot-container .call-icon-btn {
    background: rgba(255, 255, 255, 0.15);
    color: var(--white);
    position: relative;
}

#chatbot-container .call-icon-btn:hover {
    background: rgba(255, 255, 255, 0.3);
}

#chatbot-container .call-arc-inner,
#chatbot-container .call-arc-outer {
    transform-origin: center;
    animation: none; /* Default: no animation */
}

/* Only animate when call is active */
#chatbot-container .call-icon-btn.calling .call-arc-inner,
#chatbot-container .call-icon-btn.calling .call-arc-outer {
    animation: arcPulse 1.8s ease-in-out infinite;
}

#chatbot-container .call-icon-btn.calling .call-arc-outer {
    animation-delay: 0.4s;
    opacity: 0.7;
}

@keyframes arcPulse {
    0%, 100% { opacity: 1; }
    50%       { opacity: 0.25; }
}

#chatbot-container .send-btn {
    width: var(--send-btn-size);
    height: var(--send-btn-size);
    background: var(--primary-blue);
    color: var(--white);
}

#chatbot-container .send-btn:hover {
    background: var(--primary-blue-dark);
}

#chatbot-container .action-btn:active {
    transform: scale(0.95);
}

/* ========================================
   CALL INTERFACE
   ======================================== */

.call-interface {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(135deg, var(--primary-blue) 0%, var(--primary-blue-dark) 100%);
    display: none;
    align-items: center;
    justify-content: center;
    z-index: 100;
    animation: fadeIn 0.3s ease;
    border-radius: 24px;
}

.call-interface.active {
    display: flex;
}

.call-content {
    text-align: center;
    color: var(--white);
}

.call-avatar-wrapper {
    position: relative;
    display: inline-block;
    margin-bottom: 24px;
}

.call-avatar {
    width: 120px;
    height: 120px;
    border-radius: 50%;
    border: 4px solid rgba(255, 255, 255, 0.3);
    object-fit: cover;
}

.call-status-ring {
    position: absolute;
    top: -8px;
    left: -8px;
    right: -8px;
    bottom: -8px;
    border: 3px solid rgba(255, 255, 255, 0.5);
    border-radius: 50%;
    animation: chatbot-pulse 2s infinite;
    pointer-events: none;
}

/* Mobile: reduce pulse ring size to prevent cutoff */
@media (max-width: 480px) {
    .call-status-ring {
        top: -6px;
        left: -6px;
        right: -6px;
        bottom: -6px;
        border-width: 2px;
    }
    
    .call-avatar {
        width: 100px;
        height: 100px;
    }
}

.call-name {
    font-size: 28px;
    font-weight: 600;
    margin-bottom: 8px;
}

.call-status {
    font-size: 16px;
    opacity: 0.9;
    margin-bottom: 16px;
}

.call-duration {
    font-size: 20px;
    font-weight: 500;
    margin-bottom: 28px;
}

.call-mute-wrapper {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 10px;
    margin-bottom: 24px;
}

.call-mute-btn {
    width: 52px;
    height: 52px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.13);
    border: 2px solid rgba(255, 255, 255, 0.28);
    color: var(--white);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all var(--transition-fast);
    backdrop-filter: blur(6px);
    -webkit-backdrop-filter: blur(6px);
    box-shadow: 0 0 0 0 rgba(255, 255, 255, 0.15),
                inset 0 1px 0 rgba(255, 255, 255, 0.2);
    animation: muteBtnPulse 3s ease-in-out infinite;
}

@keyframes muteBtnPulse {
    0%, 100% { 
        box-shadow: 0 0 0 0 rgba(255, 255, 255, 0.15),
                    inset 0 1px 0 rgba(255, 255, 255, 0.2);
    }
    50% { 
        box-shadow: 0 0 12px rgba(255, 255, 255, 0.2),
                    inset 0 1px 0 rgba(255, 255, 255, 0.25);
    }
}

.call-mute-btn:hover {
    background: rgba(255, 255, 255, 0.24);
    border-color: rgba(255, 255, 255, 0.55);
    box-shadow: 0 0 18px rgba(255, 255, 255, 0.18),
                inset 0 1px 0 rgba(255, 255, 255, 0.25);
    transform: scale(1.08);
}

.call-mute-btn:active {
    transform: scale(0.96);
}

.call-mute-btn.muted {
    background: rgba(239, 68, 68, 0.3);
    border-color: rgba(239, 68, 68, 0.65);
    box-shadow: 0 0 18px rgba(239, 68, 68, 0.3),
                inset 0 1px 0 rgba(255, 255, 255, 0.1);
    animation: none;
}

.call-mute-btn.muted .mute-slash {
    stroke: currentColor;
    stroke-width: 3;
    opacity: 1;
    filter: drop-shadow(0 0 2px rgba(0, 0, 0, 0.3));
}

.call-mute-btn.muted:hover {
    background: rgba(239, 68, 68, 0.45);
    box-shadow: 0 0 24px rgba(239, 68, 68, 0.4);
}

.call-btn-label {
    font-size: 11px;
    font-weight: 600;
    letter-spacing: 0.8px;
    text-transform: uppercase;
    color: rgba(255, 255, 255, 0.75);
}

.end-call-btn {
    background: var(--danger-red);
    color: var(--white);
    border: none;
    padding: 16px 32px;
    border-radius: 50px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 12px;
    transition: all var(--transition-fast);
    box-shadow: var(--shadow-lg);
}

.end-call-btn:hover {
    background: #dc2626;
    transform: translateY(-2px);
    box-shadow: 0 12px 20px -5px rgba(0, 0, 0, 0.3);
}

.end-call-btn:active {
    transform: translateY(0);
}

/* ========================================
   ANIMATIONS
   ======================================== */

@keyframes fadeIn {
    from {
        opacity: 0;
    }
    to {
        opacity: 1;
    }
}

@keyframes fadeInScale {
    from {
        opacity: 0;
        transform: scale(0.95);
    }
    to {
        opacity: 1;
        transform: scale(1);
    }
}

@keyframes slideInUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes chatbot-pulse {
    0%, 100% {
        transform: scale(1);
        opacity: 0.5;
    }
    50% {
        transform: scale(1.1);
        opacity: 0.8;
    }
}

/* ========================================
   TYPING INDICATOR
   ======================================== */

.typing-dots {
    display: flex;
    align-items: center;
    gap: 4px;
    padding: 12px 16px;
}

.typing-dots span {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: #233c58;
    opacity: 0.4;
    animation: typingBounce 1.4s infinite ease-in-out both;
}

.typing-dots span:nth-child(1) {
    animation-delay: 0s;
}

.typing-dots span:nth-child(2) {
    animation-delay: 0.2s;
}

.typing-dots span:nth-child(3) {
    animation-delay: 0.4s;
}

@keyframes typingBounce {
    0%, 80%, 100% {
        transform: scale(0.6);
        opacity: 0.4;
    }
    40% {
        transform: scale(1);
        opacity: 1;
    }
}

/* ========================================
   DROPDOWN MINIMIZE BUTTON
   ======================================== */

.dropdown-minimize-btn {
    position: fixed;
    bottom: var(--dropdown-bottom);
    right: var(--chatbot-right);
    width: clamp(36px, 3.5vw, 46px);
    height: clamp(36px, 3.5vw, 46px);
    background: #1e2d40;
    border: 3px solid #ffffff;
    border-radius: 50%;
    color: #ffffff;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.25);
    transition: all var(--transition-fast);
    z-index: 1001;
    outline: 3px solid #e8edf2;
    outline-offset: 0px;
}

.dropdown-minimize-btn:hover {
    background: #233c58;
    transform: scale(1.08);
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.3);
}

.dropdown-minimize-btn:active {
    transform: translateY(0);
}

.dropdown-minimize-btn svg {
    transition: transform var(--transition-fast);
}

.dropdown-minimize-btn:hover svg {
    transform: translateY(1px);
}

/* ========================================
   RESPONSIVE DESIGN
   (clamp() in :root handles fluid scaling;
    overrides only needed for true breakpoints)
   ======================================== */

/* ── Tablets and small laptops (≥ 794px) ── */
@media (min-width: 794px) and (max-width: 1024px) {
    :root {
        --chatbot-height: min(75vh, calc(100vh - 120px));
        --chatbot-width: clamp(320px, 45vw, 480px);
        --welcome-avatar-size: clamp(120px, 18vw, 160px);
        --font-base: 14px;
        --font-md: 15px;
        --font-lg: 17px;
    }
    
    .welcome-screen {
        padding: 20px;
    }
    
    .welcome-screen h2 {
        font-size: clamp(16px, 2vw, 18px);
    }
    
    .welcome-screen p {
        font-size: clamp(13px, 1.5vw, 15px);
    }
    
    .message-content {
        font-size: 14px;
        max-width: 85%;
    }
}

/* ── Smaller laptops / tablets landscape (768px - 1024px) ── */
@media (min-width: 768px) and (max-width: 1200px) {
    :root {
        --chatbot-height: min(75vh, calc(100vh - 120px));
        --chatbot-width: clamp(500px, 45vw, 550px);
        --chatbot-max-width:   calc(100vw - 45px);
    }
}

/* ── Tablet portrait (≤ 767px) ── */
@media (max-width: 767px) {
    :root {
        --chatbot-width:       calc(100vw - 45px);
        --chatbot-max-width:   calc(100vw - 45px);
        --chatbot-height:      min(68vh, calc(100vh - 50px));
        --chatbot-right:       24px;
        --chatbot-bottom:      72px;
        --chatbot-radius:      20px;
        --maximized-width:     calc(100vw - 45px);
        --dropdown-bottom:     14px;
        --welcome-avatar-size: clamp(100px, 28vw, 150px);
    }

    .chatbot-container,
    .chatbot-container.maximized {
       left: 0px;
        max-height: calc(100vh - 59px);
        bottom: 58px;
        right: 0;
        margin: 0 auto;
    }

    .message-content { max-width: 88%; }
}

/* ── Small screens where avatar overlaps with header (≤ 540px width or ≤ 550px height) ── */
/* @media (max-width: 540px), (max-height: 550px) {
    :root {
        --welcome-avatar-size: clamp(80px, 22vw, 110px);
    }
    
    .welcome-avatar-wrapper {
        transform: scale(0.85);
        padding: clamp(5px, 1vh, 10px);
    }
    
    .welcome-screen {
        padding: clamp(20px, 4vh, 35px) 15px 15px 15px;
    }
} */

/* ── Mobile (≤ 480px) ── */
/* @media (max-width: 480px) {
    :root {
        --chatbot-width:       100%;
        --chatbot-max-width:   100%;
        --chatbot-height:      100dvh;
        --chatbot-right:       0px;
        --chatbot-bottom:      0px;
        --chatbot-radius:      0px;
        --maximized-width:     100%;
        --dropdown-bottom:     14px;
        --welcome-avatar-size: clamp(90px, 28vw, 130px);
        --font-base: 14px;
        --font-md:   15px;
        --font-lg:   16px;
        --pad-sm:    8px;
        --pad-md:    12px;
        --pad-lg:    14px;
        --btn-size:  34px;
    }

    .chatbot-container,
    .chatbot-container.maximized {
        left: 0;
        max-height: 100dvh;
        border-radius: 0;
    }

    .dropdown-minimize-btn {
        bottom: 14px;
        right: 14px;
    }

    .message-content { max-width: 90%; }
} */


/* ── Small phones (≤ 420px) ── */
@media (max-width: 420px) {
    :root {
        --font-base: 13px;
        --font-md:   14px;
        --font-lg:   15px;
        --pad-sm:    6px;
        --pad-md:    10px;
        --pad-lg:    12px;
        --btn-size:  30px;
        --welcome-avatar-size: 88px;
    }

    .message-content { max-width: 92%; }
    
    /* Reduce minimized chatbot morph rings to prevent cutoff */
    .minimized-container {
        width: 52px;
        height: 52px;
    }
    
    .minimized-avatar-wrapper {
        width: 44px;
        height: 44px;
        border-width: 2px;
    }
    
    .morph-ring-1 {
        width: 60px;
        height: 60px;
    }
    
    .morph-ring-2 {
        width: 72px;
        height: 72px;
    }
    
    .morph-ring-3 {
        width: 84px;
        height: 84px;
    }
    
    .minimized-mic-badge {
        width: 18px;
        height: 18px;
    }
    
    .chatbot-minimized {
        bottom: 25px;
        right: 25px;
    }
}

/* ── Very small phones (≤ 320px) ── */
@media (max-width: 320px) {
    .minimized-container {
        width: 48px;
        height: 48px;
    }
    
    .minimized-avatar-wrapper {
        width: 40px;
        height: 40px;
        border-width: 2px;
    }
    
    .morph-ring-1 {
        width: 54px;
        height: 54px;
    }
    
    .morph-ring-2 {
        width: 64px;
        height: 64px;
    }
    
    .morph-ring-3 {
        width: 74px;
        height: 74px;
    }
    
    .minimized-mic-badge {
        width: 16px;
        height: 16px;
    }
    
    .chatbot-minimized {
        bottom: 25px;
        right: 25px;
    }
}

@media (min-width: 768px) and (max-width: 991px){
    .chatbot-minimized{
        right: 40px;
        bottom: 40px;
    }
}
@media (max-width: 767px){
    .welcome-call-btn svg {
        width: 18px;
        height: 18px;
    }
}


/* ========================================
   ELEVENLABS WIDGET OVERRIDE
   ======================================== */

/* Hide the default ElevenLabs widget - we use custom UI */
elevenlabs-convai {
    display: none !important;
    visibility: hidden !important;
    position: absolute !important;
    width: 0 !important;
    height: 0 !important;
    opacity: 0 !important;
}
