.chat-widget {
    position: fixed;
    bottom: 20px;
    right: 20px;
    width: 350px;
    height: 500px;
    transition: all 0.3s ease;
    z-index: 99999;

}

.chat-widget.minimized {
    height: 60px;
}

.chat-widget.minimized .chat-header {
    border-radius: 12px ;
}

.chat-message.error {
    background: #ffebee;
    color: #c62828;
    align-self: center;
    /* text-align: center; */
}

.chat-widget {
    width: 380px;
    height: 520px;
    background: #1a1f2e;
    border-radius: 12px;
    box-shadow: 0 6px 24px rgba(0, 0, 0, 0.35);
    display: flex;
    flex-direction: column;
    overflow: hidden;
    /* border: 1px solid rgba(255, 255, 255, 0.08); */
}


.chat-header {
    background: #4a5568;
    padding: 14px 18px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    color: white;
    position: relative;
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}

.chat-header::after {
    display: none;
}

.chat-header h3 {
    margin: 0;
    font-size: 15px;
    font-weight: 500;
    padding: 0px !important;

}

.chat-controls {
    display: flex;
    gap: 8px;
}

.chat-controls button {
    background: rgba(255, 255, 255, 0.15);
    border: none;
    color: #e2e8f0;
    width: 30px;
    height: 26px;
    border-radius: 4px;
    cursor: pointer;
    font-size: 13px;
    font-weight: 400;
    transition: all 0.2s ease;
}

.chat-controls button:hover,
.send-button:hover {
    background: rgba(255, 255, 255, 0.25);
}

.clear-btn {
    font-size: 12px !important;
    width: auto !important;
    padding-inline:8px;
    /* text-transform: lowercase; */
}

.chat-container {
    flex: 1;
    padding: 14px;
    overflow-y: auto;
    background: #f7f8fa;
    display: flex;
    flex-direction: column;
    gap: 10px;
    transition: all 0.5s ease-in-out;
}

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

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

.chat-container::-webkit-scrollbar-thumb {
    background: #4a5568;
    border-radius: 10px;
}

.chat-container::-webkit-scrollbar-thumb:hover {
    background: #718096;
}

.chat-message {
    max-width: 85%;
    padding: 10px 14px;
    border-radius: 12px;
    font-size: 13px;
    line-height: 1.4;
    word-wrap: break-word;
    animation: messageSlide 0.3s ease-out;
}

.chat-message.assistant {
    background: #2d3748;
    color: #e2e8f0;
    align-self: flex-start;
    border-bottom-left-radius: 4px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}

.chat-message.user {
    background: #cbd5e0;
    color: #2d3748;
    align-self: flex-end;
    border-bottom-right-radius: 4px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}

.chat-input-container {
    padding: 12px 16px;
    background: #4a5568;
    border-top: 1px solid #2d3748;
    display: flex;
    gap: 10px;
    align-items: center;
    transition: all 0.8s ease-in-out;

}

.chat-input-container input {
    /* border: 1px solid white !important; */

}

.chat-input {
    flex: 1;
    padding: 10px 14px;
    /* border: 1px solid #030303; */
    border-color: #999999 !important;
    border-radius: 6px;
    font-size: 13px;
    outline: none;
    transition: all 0.2s ease;
    background: #2d3748;
    color: #e2e8f0 !important;
}

.chat-input:focus {
    border-color: #c6c6c6 !important;
    background: #2d3748;
    color: white !important;
    box-shadow: 0 0 0 2px rgba(74, 85, 104, 0.3);
}

.chat-input::placeholder {
    color: #a0aec0;
}

.send-button {
    background: #4a5568;
    color: white;
    border: none;
    padding: 5px 16px;
    border-radius: 6px;
    cursor: pointer;
    font-size: 13px;
    font-weight: 500;
    transition: all 0.2s ease;
    box-shadow: none;
}

.send-button:hover {
    background: #2d3748;
    transform: none;
}

@keyframes messageSlide {
    from {
        opacity: 0;
        transform: translateY(10px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Responsive adjustments */
@media (max-width: 480px) {
    .chat-widget {
        width: 100%;
        height: 85vh;
        bottom:0;
        right: 0;
        border-radius: 0;
    }
    .chat-header{
        border-radius: 0% !important;
    }
}

/* Loading animation */
.typing-indicator {
    display: flex;
    gap: 4px;
    padding: 10px 15px;
    background: #f5f5f5;
    border-radius: 15px;
    align-self: flex-start;
    margin: 5px 0;
}

.typing-indicator span {
    width: 8px;
    height: 8px;
    background: #2c3e50;
    border-radius: 50%;
    animation: typing 1s infinite ease-in-out;
}

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

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

@keyframes typing {

    0%,
    100% {
        transform: translateY(0);
    }

    50% {
        transform: translateY(-5px);
    }
}

.chat-widget.minimized .chat-container,
.chat-widget.minimized .chat-input-container {
    opacity: 0;
}


.calculation-result {
    background: linear-gradient(135deg, #2c3e50 0%, #53697f 100%);
    min-height: fit-content;
    border-radius: 12px;
    padding: 16px;
    margin: 8px 0;
    box-shadow: 0 4px 15px rgba(102, 126, 234, 0.2);
    border: 1px solid rgba(255, 255, 255, 0.1);
    position: relative;

    display: flex;
    overflow: initial;
    flex-direction: column;
    align-self: center;
    width: 100%;
    transition: all 0.3s ease-in-out;


}


.calculation-result h4 {
    color: white;
    text-align: center;
    margin: 0 0 0px 0;
    font-size: 14px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    opacity: 0.9;
}

.calculation-result span {
    width: 100%;
    background: rgba(255, 255, 255, 0.95);
    margin: 2px 0;
    padding: 8px 12px;
    border-radius: 8px;
    font-size: 13px;
    line-height: 1.4;
    color: #2d3748;
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.2);
    display: flex;
    justify-content: space-between;
}

.calculation-result p:last-child {
    margin-bottom: 0;
}

.calculation-result strong {
    color: #4a5568;
    font-weight: 600;
    font-size: 12px;
    text-transform: uppercase;
    letter-spacing: 0.3px;
}

/* Hover effect for interactivity */
.calculation-result:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(102, 126, 234, 0.3);
}

.calculation-indicator {
    display: flex;
    align-items: center;
    padding: 20px 16px;
    margin: 8px 0;
    background: linear-gradient(135deg, #2c3e50 0%, #53697f 100%);
    border-radius: 10px;
    box-shadow: 0 2px 10px rgba(102, 126, 234, 0.2);
    position: relative;
    overflow: hidden;
    width: 100%;
    transition: all 0.3s ease-in-out;
    align-self: center;
}



.calculation-indicator .calc-icon {
    width: 20px;
    height: 20px;
    margin-right: 12px;
    background: rgba(255, 255, 255, 0.9);
    border-radius: 4px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 12px;
    color: #667eea;
    font-weight: bold;
}

.calculation-indicator .calc-text {
    color: white;
    font-size: 13px;
    font-weight: 500;
    margin-right: 12px;
    opacity: 0.95;
}

.calculation-indicator .calc-dots {
    display: flex;
    gap: 4px;
}

.calculation-indicator .calc-dots span {
    width: 6px;
    height: 6px;
    background: rgba(255, 255, 255, 0.8);
    border-radius: 50%;
    animation: calcPulse 1.4s ease-in-out infinite;
}

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

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

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

@keyframes calcPulse {

    0%,
    60%,
    100% {
        transform: scale(1);
        opacity: 0.8;
    }

    30% {
        transform: scale(1.3);
        opacity: 1;
    }
}

.calculation-result p {
    font-size: 16px;
    font-weight: 500;
    color: #ffffff;
    margin-top: 15px;
    margin-bottom: 5px;
    letter-spacing: 0.3px;
}

.invoice-btn {
  background: linear-gradient(135deg, #667eea 0%, #ab8bcc 100%);
  border: none;
  color: white;
  font-size: 15px;
  font-weight: 600;
  padding: 12px 32px;
  border-radius: 8px;
  cursor: pointer;
  transition: all 0.3s ease;
  text-transform: none;
  letter-spacing: 0.5px;
  box-shadow: 0 4px 15px rgba(102, 126, 234, 0.3);
  position: relative;
  overflow: hidden;
}

.invoice-btn::before {
  content: '';
  position: absolute;
  top: 0;
  left: -120%;
  width: 100%;
  height: 100%;
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.2), transparent);
  transition: left 0.6s;
}

.invoice-btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 25px rgba(102, 126, 234, 0.4);
  background: linear-gradient(135deg, #667eea 0%, #ab8bcc 100%);
}

.invoice-btn:hover::before {
  left: 100%;
}

.invoice-btn:active {
  transform: translateY(-1px);
  box-shadow: 0 4px 15px rgba(102, 126, 234, 0.3);
}
.image-btn {
       height: auto;
    width: 40px;
    aspect-ratio: 1;
    background: #3e4654;
    border: 2px solid #9699b3;
    border-radius: 100%;
    padding: 7px 10px;
    cursor: pointer;
    font-size: 16px;
    /* margin-right: 8px; */
    transition: all ease-in-out 0.2s;
    display: flex
;
    align-items: center;
    justify-content: center;

}
.image-btn svg{
    transform : translate(0px,1px) scale(1.2);
}
.image-btn.disabled{
    background: #565656;
    cursor: unset !important;
    opacity : 0.5;
    pointer-events:  none;
}
.image-btn:hover {
    background: #2c313a;
}

/* Image preview container */
.image-preview-container {
    position: relative;
    padding: 10px;
    border-top: 1px solid #cbcbcb72;
    backdrop-filter: blur(10px);
    background: #56565633;
    display: flex;
    align-items: left;
    justify-content: start;
}

.image-preview {
    max-width: 150px;
    max-height: 50px;
    border-radius: 8px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
}

.remove-image-btn {
    position: absolute;
    top: 5px;
    right: 5px;
    background: #ff4444;
    color: white;
    border: none;
    border-radius: 50%;
    width: 24px;
    height: 24px;
    cursor: pointer;
    font-size: 14px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: bold;
}

.remove-image-btn:hover {
    background: #cc0000;
}

.calculation-error {
    background: #fed7d7;
    color: #c53030;
    padding: 12px 16px;
    border-radius: 8px;
    margin: 8px 0;
    font-size: 13px;
    line-height: 1.4;
    border-left: 4px solid #e53e3e;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}
  .invoice-form-container {
                max-width: 100%;
                margin: 10px 0;
            }
            
            .invoice-form {
                background: #f9f9f9;
                padding: 20px;
                border-radius: 8px;
                border: 1px solid #e0e0e0;
            }
            
            .form-group {
                margin-bottom: 15px;
            }
            
            .form-group label {
                display: block;
                margin-bottom: 5px;
                font-weight: bold;
                color: #333;
            }
            
            .form-group input {
                width: 100%;
                padding: 10px;
                border: 1px solid #ddd;
                border-radius: 4px;
                font-size: 14px;
                box-sizing: border-box;
            }
            
            .form-group input:focus {
                outline: none;
                border-color: #007bff;
                box-shadow: 0 0 0 2px rgba(0, 123, 255, 0.25);
            }
            
            .form-buttons {
                display: flex;
                gap: 10px;
                margin-top: 20px;
            }
            
            .submit-btn, .cancel-btn {
                padding: 10px 20px;
                border: none;
                border-radius: 4px;
                cursor: pointer;
                font-size: 14px;
                transition: background-color 0.3s;
            }
            
            .submit-btn {
                background-color: #007bff;
                color: white;
            }
            
            .submit-btn:hover {
                background-color: #0056b3;
            }
            
            .cancel-btn {
                background-color: #6c757d;
                color: white;
            }
            
            .cancel-btn:hover {
                background-color: #545b62;
            }
            
            .form-group input:invalid {
                border-color: #dc3545;
            }
            
            .error-message {
                color: #dc3545;
                font-size: 12px;
                margin-top: 5px;
            }
            .chat-message.contact-form{
                max-width: 100% ;
                width: 100%;
                background:  linear-gradient(135deg, #667eea 0%, #ab8bcc 100%);
            }
            .chat-message.contact-form p{
                color: white;
            }
            






            


.cbw-suggestion {
    justify-content: center;
    display: flex;
    gap  : 7px 10px;
    flex-wrap: wrap;
}

.cbw-suggestion button {
    border: 1px solid #7b7b7b;
    background: #d5d0d0;
    /* background: none; */
    color: black;
    border-radius: 41px;
    padding-block: 5px;
    padding-inline: 14px;
    cursor: pointer;
}

.chat-message h1, .chat-message h2, .chat-message h3 {
    margin: 0.5em 0;
}
.chat-message p {
        white-space: pre-wrap;
        margin : 0px;
        font-size: 14px;
}
.chatbot-message code {
    background: #f4f4f4;
    padding: 2px 4px;
    border-radius: 3px;
}
.chat-message pre {
    background: #f4f4f4;
    padding: 10px;
    color: #333;
    border-radius: 5px;
    overflow-x: auto;
}
.drag-over{
    background: rgba(74, 85, 104, 0.1);
    transition: all 0.3s ease;
}

.drag-over::after{
    content: "Drop your image here";
    position: absolute;
    align-content: center;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    color: #ffffff;
    font-size: 16px;
    font-weight: bold;
    height: 100%;
    width: 100%;
    background: #0d0d0da3;
    z-index: 100000;
    text-align: center;
    /* backdrop-filter: blur(8px); */
    border: 5px dashed #3c83a8;
    border-radius: 16px;

}