/* Start Widget */
.cypress-chatbot-widget {
    position: fixed;
    bottom: 30px;
    right: 30px;
    width: 70px;
    height: 70px;
    background: linear-gradient(135deg, #213e31, #2a4d3c);
    border-radius: 50%;
    display: flex;
    justify-content: center;
    align-items: center;
    cursor: pointer;
    box-shadow: 0 4px 15px rgba(0,0,0,0.3);
    z-index: 1000;
    transition: all 0.3s ease;
    animation: chatbot-bounce 2s infinite;
}

.cypress-chatbot-widget:hover {
    transform: scale(1.1);
    box-shadow: 0 6px 20px rgba(0,0,0,0.4);
}

.cypress-chatbot-widget i {
    color: white;
    font-size: 24px;
}

@keyframes chatbot-bounce {
    0%, 20%, 50%, 80%, 100% {
        transform: translateY(0);
    }
    40% {
        transform: translateY(-10px);
    }
    60% {
        transform: translateY(-5px);
    }
}

/* Chatbot Container */
.cypress-chatbot-container {
    width: 100%;
    max-width: 400px;
    height: 600px;
    background-color: white;
    border-radius: 20px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.2);
    overflow: hidden;
    display: flex;
    flex-direction: column;
    position: fixed;
    bottom: 30px;
    right: 30px;
    z-index: 1001;
    display: none;
}

.cypress-chatbot-container.active {
    display: flex;
}

/* Enhanced Header Styles */
.cypress-chatbot-header {
    background: linear-gradient(135deg, #1a2f23, #213e31);
    color: white;
    padding: 15px 20px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    min-height: 70px;
    flex-shrink: 0;
    border-bottom: 1px solid rgba(255,255,255,0.1);
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
}

.cypress-chatbot-header-main {
    display: flex;
    align-items: center;
    gap: 15px;
    flex: 1;
}

.cypress-chatbot-avatar-container {
    position: relative;
    display: flex;
    align-items: center;
}

.cypress-chatbot-profile {
    width: 48px;
    height: 48px;
    border-radius: 50%;
    object-fit: cover;
    border: 3px solid rgba(255,255,255,0.2);
    background: linear-gradient(45deg, #2a4d3c, #3a6d52);
    box-shadow: 0 4px 12px rgba(0,0,0,0.15);
    transition: all 0.3s ease;
}

.cypress-chatbot-profile:hover {
    border-color: rgba(255,255,255,0.4);
    transform: scale(1.05);
}

.cypress-chatbot-online-dot {
    position: absolute;
    bottom: 2px;
    right: 2px;
    width: 12px;
    height: 12px;
    background: linear-gradient(135deg, #4CAF50, #45a049);
    border-radius: 50%;
    border: 2px solid #213e31;
    animation: chatbot-pulse 2s infinite;
    box-shadow: 0 2px 4px rgba(0,0,0,0.2);
}

@keyframes chatbot-pulse {
    0% { 
        transform: scale(1);
        box-shadow: 0 0 0 0 rgba(76, 175, 80, 0.7);
    }
    70% { 
        transform: scale(1.1);
        box-shadow: 0 0 0 6px rgba(76, 175, 80, 0);
    }
    100% { 
        transform: scale(1);
        box-shadow: 0 0 0 0 rgba(76, 175, 80, 0);
    }
}

.cypress-chatbot-header-info {
    flex: 1;
}

.cypress-chatbot-name {
    font-size: 18px;
    font-weight: 700;
    margin: 0 0 4px 0;
    color: white;
    letter-spacing: -0.2px;
}

.cypress-chatbot-status {
    display: flex;
    align-items: center;
    gap: 12px;
    flex-wrap: wrap;
}

.cypress-chatbot-role {
    font-size: 13px;
    color: rgba(255,255,255,0.8);
    font-weight: 500;
    background: rgba(255,255,255,0.1);
    padding: 4px 10px;
    border-radius: 12px;
    backdrop-filter: blur(10px);
}

.cypress-chatbot-online-status {
    font-size: 12px;
    color: #4CAF50;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 6px;
}

.cypress-chatbot-online-status::before {
    content: "";
    width: 6px;
    height: 6px;
    background: #4CAF50;
    border-radius: 50%;
    animation: status-pulse 1.5s infinite;
}

@keyframes status-pulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.5; }
}

.cypress-chatbot-close {
    background: rgba(255,255,255,0.1);
    border: none;
    color: white;
    width: 36px;
    height: 36px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    font-size: 16px;
    transition: all 0.3s ease;
    backdrop-filter: blur(10px);
    margin-left: 10px;
}

.cypress-chatbot-close:hover {
    background: rgba(255,255,255,0.2);
    transform: rotate(90deg);
    box-shadow: 0 4px 12px rgba(0,0,0,0.2);
}

/* Enlarged Chat Body */
.cypress-chatbot-body {
    flex: 1;
    padding: 15px;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    gap: 15px;
    background-color: #f8f9fa;
}

.cypress-chatbot-message {
    max-width: 80%;
    padding: 12px 16px;
    border-radius: 18px;
    font-size: 14px;
    line-height: 1.4;
}

.cypress-chatbot-message-bot {
    background-color: #e9ecef;
    color: #213e31;
    border-bottom-left-radius: 5px;
    align-self: flex-start;
}

.cypress-chatbot-message-user {
    background: linear-gradient(to right, #213e31, #2a4d3c);
    color: white;
    border-bottom-right-radius: 5px;
    align-self: flex-end;
}

.cypress-chatbot-footer {
    padding: 15px;
    border-top: 1px solid #eee;
    display: flex;
    flex-direction: column;
    gap: 15px;
    background-color: #f9f9f9;
}

.cypress-chatbot-input-container {
    display: flex;
    background-color: white;
    border-radius: 25px;
    padding: 5px 15px;
    border: 1px solid #ddd;
}

.cypress-chatbot-input {
    flex: 1;
    border: none;
    outline: none;
    padding: 10px 5px;
    font-size: 14px;
}

.cypress-chatbot-send {
    background: linear-gradient(to right, #213e31, #2a4d3c);
    color: white;
    border: none;
    width: 36px;
    height: 36px;
    border-radius: 50%;
    display: flex;
    justify-content: center;
    align-items: center;
    cursor: pointer;
}

.cypress-chatbot-options {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    justify-content: center;
}

.cypress-chatbot-option {
    background-color: white;
    border: 1px solid #213e31;
    color: #213e31;
    padding: 8px 15px;
    border-radius: 20px;
    font-size: 13px;
    cursor: pointer;
    transition: all 0.3s ease;
}

.cypress-chatbot-option:hover {
    background-color: #213e31;
    color: white;
}

.cypress-chatbot-controls {
    display: flex;
    justify-content: space-around;
    padding: 10px 20px;
    background-color: #f9f9f9;
    border-top: 1px solid #eee;
}

.cypress-chatbot-control {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 5px;
    color: #666;
    cursor: pointer;
    transition: color 0.3s;
    font-size: 12px;
}

.cypress-chatbot-control i {
    font-size: 18px;
}

.cypress-chatbot-control:hover {
    color: #213e31;
}

.cypress-chatbot-control.active {
    color: #213e31;
    font-weight: bold;
}

.cypress-chatbot-powered {
    text-align: center;
    padding: 10px;
    font-size: 12px;
    color: #888;
    background-color: #f9f9f9;
    border-top: 1px solid #eee;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 5px;
}

.cypress-chatbot-powered a {
    color: #213e31;
    text-decoration: none;
    font-weight: bold;
}

.cypress-chatbot-powered a:hover {
    text-decoration: underline;
}

.cypress-chatbot-logo-container {
    display: flex;
    align-items: center;
    gap: 8px;
}

.cypress-chatbot-logo {
    height: 20px;
    width: auto;
}

/* Animation for new messages */
@keyframes chatbot-fadeIn {
    from { opacity: 0; transform: translateY(10px); }
    to { opacity: 1; transform: translateY(0); }
}

.cypress-chatbot-message {
    animation: chatbot-fadeIn 0.3s ease;
}

/* Scrollbar styling */
.cypress-chatbot-body::-webkit-scrollbar {
    width: 6px;
}

.cypress-chatbot-body::-webkit-scrollbar-track {
    background: #f1f1f1;
}

.cypress-chatbot-body::-webkit-scrollbar-thumb {
    background: #c5c5c5;
    border-radius: 3px;
}

.cypress-chatbot-body::-webkit-scrollbar-thumb:hover {
    background: #a5a5a5;
}

/* Voice recording indicator */
.cypress-chatbot-voice-indicator {
    display: none;
    align-items: center;
    justify-content: center;
    gap: 10px;
    padding: 10px;
    background-color: #f0f8ff;
    border-radius: 20px;
    margin: 10px 20px;
    border: 1px solid #cce7ff;
}

.cypress-chatbot-voice-indicator.active {
    display: flex;
}

.cypress-chatbot-pulse-ring {
    width: 20px;
    height: 20px;
    background-color: #213e31;
    border-radius: 50%;
    animation: chatbot-pulse-ring 1.25s cubic-bezier(0.215, 0.61, 0.355, 1) infinite;
}

@keyframes chatbot-pulse-ring {
    0% {
        transform: scale(0.8);
        opacity: 1;
    }
    80%, 100% {
        transform: scale(1.5);
        opacity: 0;
    }
}

/* History panel */
.cypress-chatbot-history {
    display: none;
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: white;
    z-index: 10;
    padding: 20px;
    overflow-y: auto;
}

.cypress-chatbot-history.active {
    display: block;
}

.cypress-chatbot-history-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
    padding-bottom: 10px;
    border-bottom: 1px solid #eee;
}

.cypress-chatbot-history-item {
    padding: 10px;
    border-bottom: 1px solid #f0f0f0;
    cursor: pointer;
    transition: background-color 0.2s ease;
}

.cypress-chatbot-history-item:hover {
    background-color: #f9f9f9;
}

.cypress-chatbot-history-date {
    font-size: 12px;
    color: #888;
}

.cypress-chatbot-history-preview {
    font-size: 14px;
    margin-top: 5px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* Allow microphone button */
.cypress-chatbot-allow-mic {
    background: linear-gradient(to right, #213e31, #2a4d3c);
    color: white;
    border: none;
    padding: 10px 20px;
    border-radius: 25px;
    font-size: 14px;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 8px;
    margin: 10px auto;
    transition: all 0.3s ease;
}

.cypress-chatbot-allow-mic:hover {
    transform: scale(1.05);
    box-shadow: 0 4px 8px rgba(0,0,0,0.2);
}

.cypress-chatbot-mic-permission {
    text-align: center;
    padding: 10px;
    background-color: #f0f8ff;
    border-radius: 10px;
    margin: 10px 20px;
    border: 1px solid #cce7ff;
}

/* Voice message styling */
.cypress-chatbot-voice-message {
    font-style: italic;
    color: #2a4d3c;
}

/* Preloader Styles */
.cypress-chatbot-preloader {
    display: flex;
    align-items: center;
    margin: 10px 0;
    padding: 12px 16px;
    background: #f8f9fa;
    border-radius: 18px;
    border-bottom-left-radius: 4px;
    max-width: 80%;
    animation: fadeIn 0.3s ease-in;
}

.cypress-chatbot-preloader-avatar {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    overflow: hidden;
    margin-right: 10px;
    flex-shrink: 0;
}

.cypress-chatbot-preloader-avatar img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.cypress-chatbot-preloader-content {
    flex: 1;
}

.cypress-chatbot-preloader-text {
    font-size: 12px;
    color: #6c757d;
    margin-bottom: 4px;
    font-weight: 500;
}

.cypress-chatbot-preloader-dots {
    display: flex;
    gap: 4px;
}

.cypress-chatbot-preloader-dots span {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: #6c757d;
    animation: preloaderBounce 1.4s ease-in-out infinite both;
}

.cypress-chatbot-preloader-dots span:nth-child(1) {
    animation-delay: -0.32s;
}

.cypress-chatbot-preloader-dots span:nth-child(2) {
    animation-delay: -0.16s;
}

.cypress-chatbot-preloader-dots span:nth-child(3) {
    animation-delay: 0s;
}

@keyframes preloaderBounce {
    0%, 80%, 100% {
        transform: scale(0.8);
        opacity: 0.5;
    }
    40% {
        transform: scale(1);
        opacity: 1;
    }
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Remove old typing indicator styles if they exist */
.cypress-typing {
    display: none !important;
}

/* Responsive Design */
@media (max-width: 480px) {
    .cypress-chatbot-container {
        max-width: 100%;
        height: 100%;
        bottom: 0;
        right: 0;
        border-radius: 0;
    }
    
    .cypress-chatbot-header {
        padding: 12px 15px;
        min-height: 60px;
    }
    
    .cypress-chatbot-profile {
        width: 42px;
        height: 42px;
    }
    
    .cypress-chatbot-name {
        font-size: 16px;
    }
    
    .cypress-chatbot-status {
        gap: 8px;
    }
    
    .cypress-chatbot-role {
        font-size: 12px;
        padding: 3px 8px;
    }
    
    .cypress-chatbot-body {
        padding: 12px;
    }
    
    .cypress-chatbot-message {
        max-width: 85%;
        font-size: 13px;
    }
}