/* PIB WhatsApp Chatbot Styles */
.pib-chatbot {
    position: fixed;
    bottom: 20px;
    right: 20px;
    z-index: 9999;
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
}

/* Chat Button */
.chatbot-toggle {
    width: 60px;
    height: 60px;
    border-radius: 50%;
    background: linear-gradient(135deg, #25D366 0%, #128C7E 100%);
    border: none;
    color: white;
    font-size: 24px;
    cursor: pointer;
    box-shadow: 0 4px 20px rgba(37, 211, 102, 0.3);
    transition: all 0.3s ease;
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
}

.chatbot-toggle:hover {
    transform: scale(1.1);
    box-shadow: 0 6px 25px rgba(37, 211, 102, 0.4);
}

.chatbot-toggle::before {
    content: '';
    position: absolute;
    top: -2px;
    left: -2px;
    right: -2px;
    bottom: -2px;
    border-radius: 50%;
    background: linear-gradient(135deg, #25D366, #128C7E);
    z-index: -1;
    opacity: 0;
    animation: pulse 2s infinite;
}

@keyframes pulse {
    0% { opacity: 0; transform: scale(1); }
    50% { opacity: 0.3; transform: scale(1.05); }
    100% { opacity: 0; transform: scale(1); }
}

.chatbot-toggle.active {
    transform: rotate(180deg);
}

/* Chat Container */
.chatbot-container {
    position: absolute;
    bottom: 80px;
    right: 0;
    width: 380px;
    height: 500px;
    background: white;
    border-radius: 20px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.2);
    display: none;
    flex-direction: column;
    overflow: hidden;
    animation: slideUp 0.3s ease;
}

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

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

/* Chat Header */
.chatbot-header {
    background: linear-gradient(135deg, #25D366 0%, #128C7E 100%);
    color: white;
    padding: 20px;
    display: flex;
    align-items: center;
    gap: 15px;
}

.chatbot-header .avatar {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: white;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 18px;
    color: #25D366;
    font-weight: bold;
}

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

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

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

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

/* Chat Messages */
.chatbot-messages {
    flex: 1;
    padding: 20px;
    overflow-y: auto;
    background: #f8f9fa;
}

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

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

.message.bot {
    flex-direction: row;
}

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

.message .avatar {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 14px;
    flex-shrink: 0;
}

.message.bot .avatar {
    background: linear-gradient(135deg, #25D366, #128C7E);
    color: white;
}

.message.user .avatar {
    background: #e9ecef;
    color: #495057;
}

.message .content {
    max-width: 70%;
}

.message .bubble {
    padding: 12px 16px;
    border-radius: 18px;
    position: relative;
    word-wrap: break-word;
}

/* Text formatting inside bubbles */
.message .bubble ul,
.message .bubble ol {
    margin: 8px 0;
    padding-left: 20px;
}

.message .bubble li {
    margin: 4px 0;
    line-height: 1.4;
}

.message .bubble br {
    display: block;
    margin: 4px 0;
    content: "";
}

.message .bubble strong {
    font-weight: 600;
    color: #2c3e50;
}

.message .bubble p {
    margin: 8px 0;
    line-height: 1.4;
}

.message .bubble p:first-child {
    margin-top: 0;
}

.message .bubble p:last-child {
    margin-bottom: 0;
}

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

.message.user .bubble {
    background: linear-gradient(135deg, #dcf8c6, #d4f4dd);
    color: #333;
    border-bottom-right-radius: 4px;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.1);
}

.message .time {
    font-size: 11px;
    color: #999;
    margin-top: 4px;
    text-align: right;
}

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

.quick-reply {
    background: #f0f2f5;
    border: none;
    padding: 8px 12px;
    border-radius: 16px;
    font-size: 12px;
    cursor: pointer;
    transition: all 0.2s ease;
    color: #333;
}

.quick-reply:hover {
    background: #e4e6ea;
    transform: translateY(-1px);
}

/* Typing Indicator */
.typing-indicator {
    display: none;
    align-items: center;
    gap: 10px;
    margin-bottom: 15px;
}

.typing-indicator.show {
    display: flex;
}

.typing-indicator .avatar {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: linear-gradient(135deg, #25D366, #128C7E);
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 14px;
}

.typing-dots {
    background: white;
    padding: 12px 16px;
    border-radius: 18px;
    border-bottom-left-radius: 4px;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.1);
}

.typing-dots span {
    display: inline-block;
    width: 8px;
    height: 8px;
    background: #999;
    border-radius: 50%;
    margin: 0 2px;
    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); }
    30% { transform: translateY(-10px); }
}

/* Chat Input */
.chatbot-input {
    padding: 15px;
    background: white;
    border-top: 1px solid #e9ecef;
    display: flex;
    gap: 10px;
    align-items: center;
}

.chatbot-input input {
    flex: 1;
    border: 1px solid #e9ecef;
    border-radius: 20px;
    padding: 10px 15px;
    outline: none;
    font-size: 14px;
    transition: border-color 0.2s ease;
    color: #333;
    background: white;
}

.chatbot-input input::placeholder {
    color: #999;
}

.chatbot-input input:focus {
    border-color: #25D366;
}

.chatbot-input button {
    background: linear-gradient(135deg, #25D366, #128C7E);
    border: none;
    color: white;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
}

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

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

/* Responsive Design */
@media (max-width: 480px) {
    .chatbot-container {
        width: calc(100vw - 40px);
        height: 60vh;
        right: -10px;
    }
    
    .message .content {
        max-width: 85%;
    }
    
    .chatbot-header {
        padding: 15px;
    }
    
    .chatbot-messages {
        padding: 15px;
    }
}

/* Department Transfer Modal */
.department-modal {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.5);
    display: none;
    align-items: center;
    justify-content: center;
    z-index: 10000;
}

.department-modal.show {
    display: flex;
}

.modal-content {
    background: white;
    border-radius: 15px;
    padding: 30px;
    max-width: 400px;
    width: 90%;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
    animation: modalSlideIn 0.3s ease;
}

@keyframes modalSlideIn {
    from { opacity: 0; transform: scale(0.9); }
    to { opacity: 1; transform: scale(1); }
}

.modal-header {
    text-align: center;
    margin-bottom: 20px;
}

.modal-header h3 {
    color: #333;
    margin: 0;
    font-size: 18px;
}

.modal-header p {
    color: #666;
    margin: 5px 0 0;
    font-size: 14px;
}

.department-options {
    display: flex;
    flex-direction: column;
    gap: 10px;
    margin-bottom: 20px;
}

.department-btn {
    background: #f8f9fa;
    border: 1px solid #e9ecef;
    padding: 15px;
    border-radius: 10px;
    text-align: left;
    cursor: pointer;
    transition: all 0.2s ease;
}

.department-btn:hover {
    background: #e9ecef;
    transform: translateY(-2px);
}

.department-btn h4 {
    margin: 0 0 5px;
    color: #333;
    font-size: 14px;
}

/* Chatbot Footer */
.chatbot-footer {
    padding: 10px 15px;
    background: #f8f9fa;
    border-top: 1px solid #e9ecef;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.feedback {
    display: flex;
    gap: 8px;
}

.feedback-btn {
    background: none;
    border: 1px solid #e9ecef;
    padding: 6px 10px;
    border-radius: 12px;
    font-size: 11px;
    cursor: pointer;
    transition: all 0.2s ease;
    color: #666;
}

.feedback-btn:hover {
    background: #e9ecef;
    transform: translateY(-1px);
}

.powered-by {
    font-size: 10px;
    color: #999;
    font-style: italic;
}

/* Minimize button */
.btn-minimize {
    background: none;
    border: none;
    color: white;
    font-size: 18px;
    cursor: pointer;
    padding: 5px;
    border-radius: 50%;
    width: 30px;
    height: 30px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
}

.btn-minimize:hover {
    background: rgba(255, 255, 255, 0.2);
}

.department-btn p {
    margin: 0;
    color: #666;
    font-size: 12px;
}

.modal-actions {
    display: flex;
    gap: 10px;
}

.modal-btn {
    flex: 1;
    padding: 10px;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    font-size: 14px;
    transition: all 0.2s ease;
}

.modal-btn.primary {
    background: linear-gradient(135deg, #25D366, #128C7E);
    color: white;
}

.modal-btn.secondary {
    background: #f8f9fa;
    color: #333;
    border: 1px solid #e9ecef;
}

.modal-btn:hover {
    transform: translateY(-1px);
}
