/* ===================================
   Chatbot Widget Styles
   =================================== */

.chatbot-widget {
    position: fixed;
    bottom: 20px;
    right: 20px;
    z-index: 9999;
}

.chatbot-button {
    width: 60px;
    height: 60px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--primary-color), var(--accent-color));
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.8rem;
    cursor: pointer;
    box-shadow: 0 4px 20px rgba(139, 21, 56, 0.4);
    transition: var(--transition);
    position: relative;
}

.chatbot-button:hover {
    transform: scale(1.1);
    box-shadow: 0 6px 25px rgba(139, 21, 56, 0.5);
}

.chatbot-badge {
    position: absolute;
    top: -5px;
    right: -5px;
    width: 24px;
    height: 24px;
    background-color: #FF4444;
    color: white;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.75rem;
    font-weight: 700;
    border: 2px solid white;
    animation: pulse 2s infinite;
}

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

.chatbot-window {
    position: absolute;
    bottom: 80px;
    right: 0;
    width: 380px;
    max-width: calc(100vw - 40px);
    height: 550px;
    max-height: calc(100vh - 120px);
    background: white;
    border-radius: 15px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.2);
    display: none;
    flex-direction: column;
    overflow: hidden;
    animation: slideUp 0.3s ease;
}

.chatbot-window.active {
    display: flex;
}

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

.chatbot-header {
    background: linear-gradient(135deg, var(--primary-color), var(--accent-color));
    color: white;
    padding: 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.chatbot-header-info {
    display: flex;
    align-items: center;
    gap: 12px;
}

.chatbot-header-info img {
    width: 45px;
    height: 45px;
    border-radius: 50%;
    border: 2px solid white;
    object-fit: cover;
}

.chatbot-header-info h4 {
    color: white;
    font-size: 1rem;
    margin-bottom: 3px;
}

.chatbot-status {
    font-size: 0.85rem;
    opacity: 0.9;
    display: flex;
    align-items: center;
    gap: 5px;
}

.status-dot {
    width: 8px;
    height: 8px;
    background-color: #4CAF50;
    border-radius: 50%;
    animation: blink 2s infinite;
}

@keyframes blink {
    0%, 100% {
        opacity: 1;
    }
    50% {
        opacity: 0.5;
    }
}

.chatbot-close {
    background: none;
    border: none;
    color: white;
    font-size: 1.5rem;
    cursor: pointer;
    padding: 5px;
    transition: var(--transition);
    width: 35px;
    height: 35px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
}

.chatbot-close:hover {
    background-color: rgba(255, 255, 255, 0.2);
}

.chatbot-messages {
    flex: 1;
    overflow-y: auto;
    padding: 20px;
    background-color: #F5F5F5;
    display: flex;
    flex-direction: column;
    gap: 15px;
}

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

.chatbot-messages::-webkit-scrollbar-track {
    background: #F5F5F5;
}

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

.chatbot-messages::-webkit-scrollbar-thumb:hover {
    background: #AAA;
}

.chatbot-message {
    display: flex;
    gap: 10px;
    animation: fadeIn 0.3s ease;
}

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

.message-avatar {
    width: 35px;
    height: 35px;
    border-radius: 50%;
    overflow: hidden;
    flex-shrink: 0;
}

.message-avatar img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.message-content {
    flex: 1;
}

.message-content p {
    background: white;
    padding: 12px 15px;
    border-radius: 15px;
    margin-bottom: 5px;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.05);
    line-height: 1.5;
}

.message-time {
    font-size: 0.75rem;
    color: #999;
    padding-left: 15px;
}

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

.user-message .message-content p {
    background: linear-gradient(135deg, var(--primary-color), var(--accent-color));
    color: white;
    border-radius: 15px 15px 0 15px;
}

.bot-message .message-content p {
    border-radius: 15px 15px 15px 0;
}

.user-message .message-time {
    text-align: right;
    padding-right: 15px;
    padding-left: 0;
}

.quick-replies {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-top: 10px;
}

.quick-reply-btn {
    background: white;
    border: 2px solid var(--primary-color);
    color: var(--primary-color);
    padding: 8px 15px;
    border-radius: 20px;
    font-size: 0.85rem;
    cursor: pointer;
    transition: var(--transition);
    display: flex;
    align-items: center;
    gap: 5px;
    font-weight: 500;
}

.quick-reply-btn:hover {
    background: var(--primary-color);
    color: white;
    transform: translateY(-2px);
}

.quick-reply-btn i {
    font-size: 0.9rem;
}

.chatbot-input {
    padding: 15px 20px;
    background: white;
    border-top: 1px solid #E5E5E5;
    display: flex;
    gap: 10px;
    align-items: center;
}

.chatbot-input input {
    flex: 1;
    border: 1px solid #E5E5E5;
    padding: 12px 15px;
    border-radius: 25px;
    font-size: 0.95rem;
    outline: none;
    transition: var(--transition);
}

.chatbot-input input:focus {
    border-color: var(--primary-color);
}

.chatbot-input button {
    width: 45px;
    height: 45px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--primary-color), var(--accent-color));
    color: white;
    border: none;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.1rem;
    transition: var(--transition);
}

.chatbot-input button:hover {
    transform: scale(1.1);
}

.chatbot-input button:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

/* Typing Indicator */
.typing-indicator {
    display: flex;
    gap: 4px;
    padding: 12px 15px;
    background: white;
    border-radius: 15px;
    width: fit-content;
}

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

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

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

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

/* Link Styles in Messages */
.message-content a {
    color: var(--primary-color);
    text-decoration: underline;
    font-weight: 600;
}

.bot-message .message-content a {
    color: var(--primary-color);
}

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

/* Mobile Responsive */
@media (max-width: 480px) {
    .chatbot-widget {
        bottom: 15px;
        right: 15px;
    }
    
    .chatbot-button {
        width: 55px;
        height: 55px;
        font-size: 1.6rem;
    }
    
    .chatbot-window {
        width: calc(100vw - 30px);
        height: calc(100vh - 100px);
        bottom: 75px;
        right: -7.5px;
    }
    
    .chatbot-header {
        padding: 15px;
    }
    
    .chatbot-header-info img {
        width: 40px;
        height: 40px;
    }
    
    .chatbot-messages {
        padding: 15px;
    }
    
    .quick-reply-btn {
        font-size: 0.8rem;
        padding: 7px 12px;
    }
}

/* Landscape Mobile */
@media (max-width: 768px) and (orientation: landscape) {
    .chatbot-window {
        height: calc(100vh - 80px);
    }
}
