/* ================================================================
   PROFESSIONAL LIVE CHAT v5.1.1 - Modern Design
   Inspired by: Intercom, Drift, Zendesk
   ================================================================ */

:root {
    --primary-color: #667eea;
    --primary-dark: #5a67d8;
    --secondary-color: #764ba2;
    --success-color: #10b981;
    --text-dark: #1f2937;
    --text-light: #6b7280;
    --text-primary: #ffffff;
    --text-secondary: rgba(255, 255, 255, 0.9);
    --bg-light: #f9fafb;
    --shadow-sm: 0 1px 3px 0 rgba(0, 0, 0, 0.1);
    --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);
}

/* ================================================================
   FLOATING TEXT ANIMATION
   ================================================================ */
.clc-floating-text {
    position: fixed;
    bottom: 95px;
    right: 25px;
    background: linear-gradient(135deg, var(--primary-color) 0%, var(--secondary-color) 100%);
    color: white;
    padding: 14px 22px;
    border-radius: 30px;
    font-size: 15px;
    font-weight: 600;
    box-shadow: var(--shadow-lg);
    z-index: 999998;
    animation: floatBounce 3s ease-in-out infinite;
    white-space: nowrap;
    cursor: pointer;
    transition: all 0.3s ease;
}

@keyframes floatBounce {
    0%, 100% { transform: translateY(0) scale(1); }
    25% { transform: translateY(-12px) scale(1.05); }
    50% { transform: translateY(0) scale(1); }
    75% { transform: translateY(-6px) scale(1.02); }
}

.clc-floating-text:hover {
    animation-play-state: paused;
    transform: scale(1.08) translateY(-5px);
    box-shadow: var(--shadow-xl);
}

/* ================================================================
   CHAT BUTTON - Modern & Pulsing
   ================================================================ */
.clc-chat-button {
    position: fixed;
    bottom: 20px;
    right: 20px;
    width: 70px;
    height: 70px;
    background: linear-gradient(135deg, var(--primary-color) 0%, var(--secondary-color) 100%);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    box-shadow: var(--shadow-xl);
    transition: all 0.3s ease;
    z-index: 999999;
    animation: buttonPulse 2s ease-in-out infinite;
}

@keyframes buttonPulse {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.06); }
}

.clc-chat-button:hover {
    transform: scale(1.15) !important;
    animation: none;
    box-shadow: 0 25px 35px -5px rgba(102, 126, 234, 0.5);
}

.clc-pulse-ring {
    position: absolute;
    width: 100%;
    height: 100%;
    border: 3px solid var(--primary-color);
    border-radius: 50%;
    animation: pulseRing 2s ease-out infinite;
    opacity: 0.7;
}

@keyframes pulseRing {
    0% { transform: scale(1); opacity: 0.7; }
    100% { transform: scale(1.6); opacity: 0; }
}

.clc-badge {
    position: absolute;
    top: -5px;
    right: -5px;
    background: #ef4444;
    color: white;
    width: 26px;
    height: 26px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 13px;
    font-weight: bold;
    border: 3px solid white;
    animation: badgeBounce 1s ease-in-out infinite;
}

@keyframes badgeBounce {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.2); }
}

/* ================================================================
   CHAT BOX - Professional Container
   ================================================================ */
.clc-box {
    position: fixed;
    bottom: 105px;
    right: 20px;
    width: 420px;
    max-width: calc(100vw - 40px);
    height: 650px;
    max-height: calc(100vh - 140px);
    background: white;
    border-radius: 20px;
    box-shadow: var(--shadow-xl);
    display: none;
    flex-direction: column;
    z-index: 999999;
    overflow: hidden;
    animation: slideUpFadeIn 0.4s cubic-bezier(0.68, -0.55, 0.265, 1.55);
}

/* Widget Open State - Show the chat box */
.clc-widget-open .clc-box {
    display: flex !important;
}

/* Hide floating text when widget is open */
.clc-widget-open .clc-floating-text {
    opacity: 0;
    visibility: hidden;
}

/* Optional: Rotate button when open */
.clc-widget-open .clc-chat-button {
    transform: scale(0.9);
}

@keyframes slideUpFadeIn {
    from {
        opacity: 0;
        transform: translateY(40px) scale(0.95);
    }
    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

/* ================================================================
   HEADER - Professional with Branding
   ================================================================ */
.clc-header {
    background: linear-gradient(135deg, var(--primary-color) 0%, var(--secondary-color) 100%);
    color: white;
    padding: 20px 24px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    min-height: 80px;
}

.clc-header-brand {
    display: flex;
    align-items: center;
    gap: 14px;
    flex: 1;
}

.clc-logo {
    width: 44px;
    height: 44px;
    border-radius: 12px;
    object-fit: cover;
    background: rgba(255, 255, 255, 0.2);
    padding: 4px;
}

.clc-header-info {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.clc-title {
    font-size: 18px;
    font-weight: 700;
    letter-spacing: -0.3px;
}

.clc-status {
    font-size: 13px;
    opacity: 0.95;
    display: flex;
    align-items: center;
    gap: 6px;
}

.clc-status-dot {
    width: 8px;
    height: 8px;
    background: var(--success-color);
    border-radius: 50%;
    display: inline-block;
    animation: pulse 2s ease-in-out infinite;
    box-shadow: 0 0 8px rgba(16, 185, 129, 0.8);
}

@keyframes pulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.6; }
}

.clc-close {
    background: #ffffff !important;
    border: 2px solid #e5e7eb !important;
    color: #667eea !important;
    font-size: 32px !important;
    font-weight: 300 !important;
    cursor: pointer;
    line-height: 1 !important;
    padding: 0 !important;
    width: 40px !important;
    height: 40px !important;
    border-radius: 50% !important;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    z-index: 10;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15) !important;
    min-height: auto !important;
    text-transform: none !important;
    gap: 0 !important;
}

.clc-close:hover {
    background: rgba(255, 77, 77, 0.9);
    border-color: rgba(255, 77, 77, 1);
    transform: rotate(90deg) scale(1.1);
    box-shadow: 0 4px 16px rgba(255, 77, 77, 0.4);
}

.clc-close:active {
    transform: rotate(90deg) scale(0.95);
}

.clc-close svg {
    color: #667eea;
    stroke: #667eea;
}

/* ================================================================
   CONTACT FORM - Professional Welcome
   ================================================================ */
.clc-contact-form {
    display: flex;
    flex-direction: column;
    height: 100%;
    background: white;
}

.clc-form-content {
    flex: 1;
    padding: 0;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
}

.clc-welcome-message {
    background: linear-gradient(to bottom, var(--bg-light) 0%, white 100%);
    padding: 30px 24px;
    border-bottom: 1px solid #e5e7eb;
}

.clc-agent-profile {
    display: flex;
    align-items: center;
    gap: 14px;
    margin-bottom: 16px;
}

.clc-agent-avatar {
    width: 50px;
    height: 50px;
    background: linear-gradient(135deg, var(--primary-color) 0%, var(--secondary-color) 100%);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    flex-shrink: 0;
}

.clc-agent-info {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.clc-agent-info strong {
    color: var(--text-dark);
    font-size: 15px;
}

.clc-agent-info span {
    color: var(--text-light);
    font-size: 13px;
}

.clc-form-subtitle {
    font-size: 16px;
    color: var(--text-dark);
    margin: 0;
    line-height: 1.6;
}

.clc-form-fields {
    padding: 24px;
    flex: 1;
}

.clc-form-group {
    margin-bottom: 20px;
}

.clc-form-group label {
    display: block;
    font-size: 14px;
    font-weight: 600;
    color: #2d3748;
    margin-bottom: 8px;
}

.clc-form-input {
}

.clc-form-textarea {
    width: 100%;
    padding: 14px 16px;
    border: 2px solid #e5e7eb;
    border-radius: 12px;
    font-size: 15px;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
    transition: all 0.3s;
    resize: vertical;
    min-height: 100px;
    max-height: 200px;
}
    width: 100%;
    padding: 14px 16px;
    border: 2px solid #e5e7eb;
    border-radius: 12px;
    font-size: 15px;
    transition: all 0.3s;
    box-sizing: border-box;
    color: var(--text-dark);
}

.clc-form-input:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 4px rgba(102, 126, 234, 0.1);
}

.clc-start-btn {
    width: calc(100% - 48px);
    margin: 0 24px 20px 24px;
    padding: 16px 24px;
    background: linear-gradient(135deg, var(--primary-color) 0%, var(--secondary-color) 100%);
    color: #ffffff !important;
    border: none;
    border-radius: 12px;
    font-size: 16px;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.3s;
    text-align: center;
    letter-spacing: 0.3px;
    box-shadow: var(--shadow-md);
    display: flex;
    align-items: center;
    justify-content: center;
}

.clc-start-btn:hover,
.clc-start-btn:active {
    transform: translateY(-2px);
    box-shadow: var(--shadow-lg);
}

.clc-privacy-note {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 0 24px 24px 24px;
    color: var(--text-light);
    font-size: 12px;
}

.clc-privacy-note svg {
    flex-shrink: 0;
}

/* ================================================================
   MESSAGES AREA - Professional Chat
   ================================================================ */
.clc-chat-area {
    display: flex;
    flex-direction: column;
    height: 100%;
    background: white;
}

.clc-messages {
    flex: 1;
    overflow-y: auto;
    padding: 24px;
    background: linear-gradient(to bottom, var(--bg-light) 0%, white 100%);
}

.clc-message {
    margin-bottom: 20px;
    display: flex;
    gap: 12px;
    animation: messageSlideIn 0.4s cubic-bezier(0.68, -0.55, 0.265, 1.55);
}

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

.clc-avatar {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--primary-color) 0%, var(--secondary-color) 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    
    flex-shrink: 0;
    color: white;
    font-weight: 600;
    font-size: 14px;
    box-shadow: var(--shadow-sm);
}

.clc-message-content {
    background: white;
    padding: 12px 16px;
    border-radius: 16px;
    max-width: 75%;
    box-shadow: var(--shadow-sm);
    border: 1px solid #e5e7eb;
}

.clc-bot-message .clc-message-content {
    background: linear-gradient(135deg, #f0f9ff 0%, #f5f3ff 100%);
    border: none;
}

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

.clc-user-message .clc-avatar {
    background: linear-gradient(135deg, #10b981 0%, #059669 100%);
}

.clc-user-message .clc-message-content {
    background: linear-gradient(135deg, var(--primary-color) 0%, var(--secondary-color) 100%);
    color: white;
    border: none;
}

.clc-message-content strong {
    display: block;
    margin-bottom: 6px;
    font-size: 13px;
    opacity: 0.9;
}

.clc-message-content p {
    margin: 0;
    font-size: 15px;
    line-height: 1.5;
}

.clc-message-time {
    font-size: 11px;
    color: var(--text-light);
    margin-top: 6px;
    display: flex;
    align-items: center;
    gap: 4px;
}

.clc-user-message .clc-message-time {
    color: rgba(255, 255, 255, 0.8);
}

/* ================================================================
   TYPING INDICATOR - Animated Dots
   ================================================================ */
.clc-typing-indicator {
    padding: 12px 24px;
    background: var(--bg-light);
    border-top: 1px solid #e5e7eb;
    display: flex;
    align-items: center;
    gap: 10px;
}

.clc-typing-dots {
    display: flex;
    gap: 4px;
}

.clc-typing-dots span {
    width: 8px;
    height: 8px;
    background: var(--primary-color);
    border-radius: 50%;
    animation: typingDot 1.4s ease-in-out infinite;
}

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

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

@keyframes typingDot {
    0%, 60%, 100% {
        transform: translateY(0);
        opacity: 0.7;
    }
    30% {
        transform: translateY(-10px);
        opacity: 1;
    }
}

.clc-typing-text {
    font-size: 13px;
    color: var(--text-light);
    font-style: italic;
}

/* ================================================================
   QUICK REPLIES - Suggestion Buttons
   ================================================================ */
.clc-quick-replies {
    padding: 16px 24px;
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    background: white;
    border-top: 1px solid #e5e7eb;
}

.clc-quick-reply {
    padding: 12px 20px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border: none;
    border-radius: 25px;
    font-size: 15px;
    font-weight: 600;
    color: white;
    cursor: pointer;
    transition: all 0.3s;
    box-shadow: 0 2px 8px rgba(102, 126, 234, 0.3);
}

.clc-quick-reply:hover {
    background: linear-gradient(135deg, #5568d3 0%, #6a3f8f 100%);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(102, 126, 234, 0.5);
}

/* ================================================================
   INPUT AREA - Modern & Clean
   ================================================================ */
.clc-input-wrapper {
    background: white;
    border-top: 2px solid #e5e7eb;
    padding: 16px 20px;
}

.clc-input-container {
    display: flex;
    gap: 12px;
    align-items: center;
}

.clc-input {
    flex: 1;
    padding: 14px 18px;
    border: 2px solid #e5e7eb;
    border-radius: 24px;
    font-size: 15px;
    outline: none;
    transition: all 0.3s;
    color: var(--text-dark);
}

.clc-input:focus {
    border-color: var(--primary-color);
    box-shadow: 0 0 0 4px rgba(102, 126, 234, 0.1);
}

.clc-send {
    background: linear-gradient(135deg, var(--primary-color) 0%, var(--secondary-color) 100%);
    color: white;
    border: none;
    padding: 14px;
    border-radius: 50%;
    cursor: pointer;
    transition: all 0.3s;
    width: 50px;
    height: 50px;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: var(--shadow-md);
}

.clc-send:hover {
    transform: scale(1.1) rotate(15deg);
    box-shadow: var(--shadow-lg);
}

.clc-powered-by {
    text-align: center;
    font-size: 11px;
    color: var(--text-light);
    margin-top: 10px;
    opacity: 0.7;
}

/* ================================================================
   MOBILE RESPONSIVE
   ================================================================ */
@media (max-width: 768px) {
    .clc-floating-text {
        bottom: 95px;
        right: 15px;
        font-size: 13px;
        padding: 12px 18px;
    }
    
    .clc-chat-button {
        bottom: 15px;
        right: 15px;
        width: 60px;
        height: 60px;
    }
    
    .clc-box {
        bottom: 85px !important;
        right: 15px !important;
        left: 15px !important;
        width: auto !important;
        height: 520px !important;
        max-height: 65vh !important;
        border-radius: 16px !important;
    }
    
    .clc-header {
        padding: 16px 20px;
        min-height: 70px;
    }
    
    .clc-logo {
        width: 36px;
        height: 36px;
    }
    
    .clc-title {
        font-size: 16px;
    }
    
    .clc-close {
        width: 32px;
        height: 32px;
        font-size: 24px;
    }
    
    .clc-message-content {
        max-width: 80%;
    }
    
    .clc-quick-reply {
        font-size: 13px;
        padding: 8px 14px;
    }
    
    /* Mobile: Make welcome section compact */
    .clc-welcome-message {
        padding: 16px 20px !important;
    }
    
    .clc-form-greeting {
        font-size: 16px !important;
        margin-bottom: 14px !important;
    }
    
    /* Mobile: Compact form spacing */
    .clc-form-group {
        margin-bottom: 14px !important;
    }
    
    .clc-form-content {
        padding-bottom: 0 !important;
        overflow-y: auto !important;
    }
    
    .clc-form-fields {
        padding: 20px 20px 10px 20px !important;
    }
    
    /* Mobile: Sticky button always visible */
    .clc-btn-primary {
        position: sticky !important;
        bottom: 0 !important;
        width: calc(100% - 40px) !important;
        margin: 12px 20px 24px 20px !important;
        background: linear-gradient(135deg, var(--primary-color), var(--secondary-color)) !important;
        box-shadow: 0 -2px 10px rgba(0,0,0,0.1), 0 4px 12px rgba(102, 126, 234, 0.3) !important;
        z-index: 10 !important;
        padding: 15px 32px !important;
        font-size: 16px !important;
    }
    
    .clc-form-step {
        display: flex;
        flex-direction: column;
        height: 100%;
    }
    
    
}

@media (max-width: 480px) {
    .clc-box {
        height: 500px !important;
        max-height: 65vh !important;
    }
    
    .clc-form-content {
        padding-bottom: 50px !important;
    }
    
    .clc-btn-primary {
        font-size: 15px !important;
        padding: 14px 24px !important;
    }
    
    .clc-box {
        max-height: 80vh !important;
    }
}

/* ================================================================
   SCROLLBAR STYLING
   ================================================================ */
.clc-messages::-webkit-scrollbar,
.clc-form-content::-webkit-scrollbar {
    width: 6px;
}

.clc-messages::-webkit-scrollbar-track,
.clc-form-content::-webkit-scrollbar-track {
    background: #f1f3f5;
}

.clc-messages::-webkit-scrollbar-thumb,
.clc-form-content::-webkit-scrollbar-thumb {
    background: var(--primary-color);
    border-radius: 3px;
}

.clc-messages::-webkit-scrollbar-thumb:hover,
.clc-form-content::-webkit-scrollbar-thumb:hover {
    background: var(--primary-dark);
}

/* ═══════════════════════════════════════════════════════════ */
/* TWO-STEP FORM STYLES */
/* ═══════════════════════════════════════════════════════════ */

.clc-form-step {
    padding: 24px;
}

.clc-form-greeting {
    font-size: 18px;
    font-weight: 600;
    color: #2d3748;
    margin-bottom: 24px;
    line-height: 1.4;
}

.clc-agent-avatar {
    width: 48px;
    height: 48px;
    background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    flex-shrink: 0;
}

.clc-header-info {
    flex: 1;
    margin-left: 12px;
}

.clc-header-title {
    display: block;
    font-size: 16px;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 2px;
}

.clc-header-subtitle {
    display: block;
    font-size: 13px;
    color: var(--text-secondary);
}

.clc-btn {
    width: 100%;
    padding: 14px 24px;
    border: none;
    border-radius: 12px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    transition: all 0.3s ease;
}

.clc-btn-primary {
    background: linear-gradient(135deg, var(--primary-color), var(--secondary-color)) !important;
    color: white !important;
    box-shadow: 0 4px 12px rgba(102, 126, 234, 0.3) !important;
    text-transform: none !important;
    font-weight: 600 !important;
    font-family: inherit !important;
    border: none !important;
}

.clc-btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(102, 126, 234, 0.4);
}

.clc-btn-primary:active {

.clc-btn-primary svg {
    stroke: white;
}
    transform: translateY(0);
}

.clc-back-btn {
    background: linear-gradient(135deg, var(--primary-color), var(--secondary-color)) !important;
    border: none;
    color: #ffffff !important;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 12px 24px;
    border-radius: 12px;
    justify-content: center;
    box-shadow: 0 4px 12px rgba(102, 126, 234, 0.3);
    margin-bottom: 16px;
    transition: color 0.2s ease;
}


.clc-back-btn svg {
    stroke: #ffffff;
}
.clc-back-btn:hover {
    background: linear-gradient(135deg, var(--secondary-color), var(--primary-color)) !important;
    transform: translateY(-1px);
    box-shadow: 0 6px 16px rgba(102, 126, 234, 0.4);
}

.clc-form-footer {
    text-align: center;
    font-size: 13px;
    color: var(--text-secondary);
    margin-top: 16px;
}

.clc-required {
    color: #ef4444;
    font-weight: 600;
}

