/* DTCSS Chatbot Styles */

/* Chat Button */
.chat-button {
    position: fixed;
    bottom: 24px;
    right: 24px;
    width: 60px;
    height: 60px;
    border-radius: 50%;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border: none;
    cursor: pointer;
    box-shadow: 0 4px 12px rgba(102, 126, 234, 0.4);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    z-index: 9998;
    display: flex;
    align-items: center;
    justify-content: center;
}

.chat-button:hover {
    transform: scale(1.1);
    box-shadow: 0 6px 20px rgba(102, 126, 234, 0.6);
}

.chat-button:active {
    transform: scale(0.95);
}

.chat-button .chat-icon,
.chat-button .close-icon {
    width: 28px;
    height: 28px;
    color: white;
    transition: all 0.3s ease;
}

.chat-button .close-icon {
    position: absolute;
    opacity: 0;
    transform: rotate(-90deg);
}

.chat-button.open .chat-icon {
    opacity: 0;
    transform: rotate(90deg);
}

.chat-button.open .close-icon {
    opacity: 1;
    transform: rotate(0deg);
}

.chat-badge {
    position: absolute;
    top: -5px;
    right: -5px;
    background: #ff4757;
    color: white;
    border-radius: 50%;
    width: 24px;
    height: 24px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 12px;
    font-weight: bold;
    animation: pulse 2s infinite;
}

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

/* Chat Window */
.chat-window {
    position: fixed;
    bottom: 100px;
    right: 24px;
    width: 380px;
    max-width: calc(100vw - 48px);
    height: 600px;
    max-height: calc(100vh - 150px);
    background: white;
    border-radius: 16px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.12);
    display: flex;
    flex-direction: column;
    opacity: 0;
    transform: translateY(20px) scale(0.95);
    pointer-events: none;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    z-index: 9997;
}

.chat-window.open {
    opacity: 1;
    transform: translateY(0) scale(1);
    pointer-events: all;
}

/* Chat Header */
.chat-header {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 20px;
    border-radius: 16px 16px 0 0;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.chat-header-info h3 {
    margin: 0;
    font-size: 18px;
    font-weight: 600;
}

.chat-status {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 13px;
    opacity: 0.9;
    margin-top: 4px;
}

.status-dot {
    width: 8px;
    height: 8px;
    background: #2ecc71;
    border-radius: 50%;
    animation: pulse-dot 2s infinite;
}

@keyframes pulse-dot {
    0%, 100% {
        opacity: 1;
    }
    50% {
        opacity: 0.5;
    }
}

.close-button {
    background: rgba(255, 255, 255, 0.2);
    border: none;
    border-radius: 8px;
    width: 32px;
    height: 32px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
}

.close-button:hover {
    background: rgba(255, 255, 255, 0.3);
}

.close-button svg {
    width: 20px;
    height: 20px;
    color: white;
}

/* Chat Messages */
.chat-messages {
    flex: 1;
    overflow-y: auto;
    padding: 20px;
    background: #f8f9fa;
    display: flex;
    flex-direction: column;
    gap: 12px;
}

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

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

.chat-messages::-webkit-scrollbar-thumb {
    background: #ddd;
    border-radius: 3px;
}

.chat-messages::-webkit-scrollbar-thumb:hover {
    background: #ccc;
}

.chat-message {
    display: flex;
    flex-direction: column;
    max-width: 80%;
    animation: slideIn 0.3s ease;
}

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

.bot-message {
    align-self: flex-start;
}

.user-message {
    align-self: flex-end;
}

.message-content {
    padding: 12px 16px;
    border-radius: 12px;
    font-size: 14px;
    line-height: 1.5;
    white-space: pre-line;
}

.bot-message .message-content {
    background: white;
    color: #333;
    border-bottom-left-radius: 4px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.08);
}

.user-message .message-content {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border-bottom-right-radius: 4px;
}

.message-time {
    font-size: 11px;
    color: #999;
    margin-top: 4px;
    padding: 0 4px;
}

.user-message .message-time {
    text-align: right;
}

/* Typing Indicator */
.typing-indicator .message-content {
    padding: 12px 16px;
}

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

.typing-dots span {
    width: 8px;
    height: 8px;
    background: #999;
    border-radius: 50%;
    animation: typing 1.4s infinite;
}

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

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

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

/* Chat Input */
.chat-input-container {
    display: flex;
    gap: 8px;
    padding: 16px;
    background: white;
    border-top: 1px solid #eee;
}

.chat-input {
    flex: 1;
    border: 2px solid #e9ecef;
    border-radius: 24px;
    padding: 12px 20px;
    font-size: 14px;
    outline: none;
    transition: all 0.2s ease;
    font-family: inherit;
}

.chat-input:focus {
    border-color: #667eea;
}

.send-button {
    width: 44px;
    height: 44px;
    border-radius: 50%;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border: none;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
}

.send-button:hover {
    transform: scale(1.05);
}

.send-button:active {
    transform: scale(0.95);
}

.send-button svg {
    width: 20px;
    height: 20px;
    color: white;
}

/* Chat Footer */
.chat-footer {
    padding: 12px 16px;
    background: white;
    border-radius: 0 0 16px 16px;
    border-top: 1px solid #eee;
}

.email-transcript-btn {
    width: 100%;
    padding: 10px;
    background: #f8f9fa;
    border: 1px solid #e9ecef;
    border-radius: 8px;
    font-size: 13px;
    color: #667eea;
    cursor: pointer;
    transition: all 0.2s ease;
    font-weight: 500;
}

.email-transcript-btn:hover {
    background: #e9ecef;
    border-color: #667eea;
}

.email-transcript-btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

/* Links in messages */
.message-content a {
    color: inherit;
    text-decoration: underline;
    font-weight: 500;
    cursor: pointer;
    pointer-events: auto;
}

.bot-message .message-content a {
    color: #667eea;
}

.bot-message .message-content a:hover {
    color: #5568d3;
    text-decoration: underline;
}

.user-message .message-content a {
    color: white;
}

/* Mobile Responsive */
@media (max-width: 768px) {
    .chat-window {
        bottom: 90px;
        right: 12px;
        left: 12px;
        width: auto;
        max-width: none;
        height: 500px;
    }
    
    .chat-button {
        bottom: 16px;
        right: 16px;
        width: 56px;
        height: 56px;
    }
    
    .chat-button .chat-icon,
    .chat-button .close-icon {
        width: 24px;
        height: 24px;
    }
}

@media (max-width: 480px) {
    .chat-window {
        height: calc(100vh - 120px);
        max-height: none;
    }
    
    .chat-message {
        max-width: 85%;
    }
}
