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

}

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

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

.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: 38px !important;
    /* 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: 100vh;
        border-radius: 0;
    }
}

/* 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;
    overflow: hidden;
    display: flex;
    overflow: hidden;
    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);
}