/* TapeDynamics Chatbot Widget Styles */

:root {
    --td-cyan: #36D7D9;
    --td-dark-navy: #252B42;
    --td-background: #2c3350;
    --td-gray: #8A94A7;
}

/* Chatbot button */
#td-chatbot-button {
    position: fixed;
    bottom: 20px;
    right: 20px;
    width: 60px;
    height: 60px;
    border-radius: 50%;
    background: linear-gradient(135deg, #25D366, #22C55E);
    border: none;
    cursor: pointer;
    box-shadow: 0 4px 20px rgba(37, 211, 102, 0.5);
    z-index: 99999;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
    font-size: 28px;
}

#td-chatbot-button:hover {
    transform: scale(1.1);
    box-shadow: 0 6px 25px rgba(37, 211, 102, 0.7);
}

#td-chatbot-button.active {
    background: #ff4444;
}

/* Chatbot container */
#td-chatbot-container {
    position: fixed;
    bottom: 90px;
    right: 20px;
    width: 380px;
    height: 600px;
    max-height: calc(100vh - 120px);
    background: var(--td-dark-navy);
    border-radius: 16px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.3);
    z-index: 99998;
    display: none;
    flex-direction: column;
    overflow: hidden;
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
}

#td-chatbot-container.active {
    display: flex;
}

/* Header */
.td-chatbot-header {
    background: linear-gradient(135deg, var(--td-cyan), #66D9B8);
    padding: 20px;
    color: white;
    display: flex;
    align-items: center;
    gap: 12px;
}

.td-chatbot-avatar {
    width: 40px;
    height: 40px;
    background: rgba(255, 255, 255, 0.2);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 20px;
}

.td-chatbot-header-text h3 {
    margin: 0;
    font-size: 16px;
    font-weight: 600;
}

.td-chatbot-header-text p {
    margin: 2px 0 0 0;
    font-size: 12px;
    opacity: 0.9;
}

/* Messages area */
.td-chatbot-messages {
    flex: 1;
    overflow-y: auto;
    padding: 20px;
    background: var(--td-background);
}

.td-chatbot-message {
    margin-bottom: 16px;
    display: flex;
    gap: 8px;
    animation: slideIn 0.3s ease;
}

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

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

.td-message-avatar {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: var(--td-cyan);
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    font-size: 16px;
}

.td-chatbot-message.user .td-message-avatar {
    background: var(--td-gray);
}

.td-message-bubble {
    max-width: 75%;
    padding: 12px 16px;
    border-radius: 16px;
    background: rgba(255, 255, 255, 0.1);
    color: white;
    font-size: 14px;
    line-height: 1.5;
}

.td-chatbot-message.user .td-message-bubble {
    background: var(--td-cyan);
    color: var(--td-dark-navy);
}

.td-message-time {
    font-size: 11px;
    opacity: 0.6;
    margin-top: 4px;
}

/* Typing indicator */
.td-typing-indicator {
    display: flex;
    gap: 4px;
    padding: 12px 16px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 16px;
    width: fit-content;
}

.td-typing-indicator span {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: var(--td-cyan);
    animation: typing 1.4s infinite;
}

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

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

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

/* Input area */
.td-chatbot-input-area {
    padding: 16px;
    background: var(--td-dark-navy);
    border-top: 1px solid rgba(255, 255, 255, 0.1);
}

.td-chatbot-input-wrapper {
    display: flex;
    gap: 8px;
    align-items: center;
}

.td-chatbot-input {
    flex: 1;
    padding: 12px 16px;
    background: var(--td-background);
    border: 1px solid rgba(54, 215, 217, 0.3);
    border-radius: 24px;
    color: white;
    font-size: 14px;
    outline: none;
    transition: all 0.3s ease;
}

.td-chatbot-input:focus {
    border-color: var(--td-cyan);
    box-shadow: 0 0 0 3px rgba(54, 215, 217, 0.1);
}

.td-chatbot-input::placeholder {
    color: var(--td-gray);
}

.td-send-button {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: var(--td-cyan);
    border: none;
    color: var(--td-dark-navy);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 18px;
    transition: all 0.3s ease;
    flex-shrink: 0;
}

.td-send-button:hover:not(:disabled) {
    transform: scale(1.1);
    box-shadow: 0 4px 12px rgba(54, 215, 217, 0.4);
}

.td-send-button:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

/* Lead form */
.td-lead-form {
    padding: 16px;
    background: var(--td-background);
    border-radius: 12px;
    margin: 16px 0;
}

.td-lead-form h4 {
    color: var(--td-cyan);
    margin: 0 0 12px 0;
    font-size: 14px;
    font-weight: 600;
}

.td-lead-form input,
.td-lead-form textarea {
    width: 100%;
    padding: 10px 12px;
    background: var(--td-dark-navy);
    border: 1px solid rgba(54, 215, 217, 0.3);
    border-radius: 8px;
    color: white;
    font-size: 13px;
    margin-bottom: 10px;
    font-family: inherit;
}

.td-lead-form input:focus,
.td-lead-form textarea:focus {
    outline: none;
    border-color: var(--td-cyan);
}

.td-lead-form textarea {
    resize: vertical;
    min-height: 60px;
}

.td-lead-submit {
    width: 100%;
    padding: 12px;
    background: var(--td-cyan);
    color: var(--td-dark-navy);
    border: none;
    border-radius: 8px;
    font-weight: 600;
    font-size: 14px;
    cursor: pointer;
    transition: all 0.3s ease;
}

.td-lead-submit:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(54, 215, 217, 0.4);
}

/* Scrollbar */
.td-chatbot-messages::-webkit-scrollbar {
    width: 6px;
}

.td-chatbot-messages::-webkit-scrollbar-track {
    background: rgba(0, 0, 0, 0.1);
}

.td-chatbot-messages::-webkit-scrollbar-thumb {
    background: var(--td-cyan);
    border-radius: 3px;
}

/* Mobile responsive */
@media (max-width: 768px) {
    #td-chatbot-container {
        width: calc(100vw - 40px);
        height: calc(100vh - 120px);
        bottom: 80px;
        right: 20px;
        left: 20px;
    }

    #td-chatbot-button {
        width: 56px;
        height: 56px;
        bottom: 16px;
        right: 16px;
    }
}

/* Welcome message */
.td-welcome-message {
    background: rgba(54, 215, 217, 0.1);
    border: 1px solid var(--td-cyan);
    border-radius: 12px;
    padding: 16px;
    margin-bottom: 16px;
    color: white;
}

.td-welcome-message h4 {
    color: var(--td-cyan);
    margin: 0 0 8px 0;
    font-size: 15px;
}

.td-welcome-message p {
    margin: 0;
    font-size: 13px;
    line-height: 1.5;
    opacity: 0.9;
}
