/* Chatbot Container Variables */
:root {
    --chat-primary: #D32027;
    /* School Red */
    --chat-secondary: #001535;
    /* School Navy */
    --chat-gold: #FFD700;
    /* School Gold */
    --chat-white: #ffffff;
    --chat-bg: #f8f9fa;
    --chat-text: #333333;
    --chat-shadow: 0 4px 20px rgba(0, 0, 0, 0.15);
}

/* Floating Action Button (FAB) */
.chat-fab-container {
    position: fixed;
    bottom: 30px;
    right: 30px;
    z-index: 9999;
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: 15px;
}

.chat-fab-btn {
    width: 60px;
    height: 60px;
    border-radius: 50%;
    background-color: var(--chat-primary);
    color: var(--chat-white);
    border: none;
    box-shadow: var(--chat-shadow);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 28px;
    transition: all 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    position: relative;
    overflow: hidden;
    animation: fab-pulse 2s infinite;
}

@keyframes fab-pulse {
    0% {
        box-shadow: 0 0 0 0 rgba(211, 32, 39, 0.7);
    }

    70% {
        box-shadow: 0 0 0 10px rgba(211, 32, 39, 0);
    }

    100% {
        box-shadow: 0 0 0 0 rgba(211, 32, 39, 0);
    }
}

.chat-fab-btn:hover {
    transform: scale(1.1);
    background-color: var(--chat-secondary);
}

.chat-fab-btn i {
    transition: all 0.3s ease;
}

.chat-icon-img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    border-radius: 50%;
    transition: transform 0.3s ease;
}

.chat-fab-btn:hover .chat-icon-img {
    transform: scale(1.1);
}

/* WhatsApp Specific Button (Mini) */
.whatsapp-fab-mini {
    width: 50px;
    height: 50px;
    background-color: #25D366;
    /* WhatsApp Green */
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 24px;
    box-shadow: var(--chat-shadow);
    text-decoration: none;
    transition: all 0.3s ease;
    opacity: 1;
    /* Always visible */
    transform: translateY(0);
    /* Always visible */
    pointer-events: all;
    /* Always clickable */
    /* Position handled by flex container gap */
}

/* Hover effect */
.whatsapp-fab-mini:hover {
    transform: scale(1.1) !important;
    background-color: #128C7E;
}

/* Chat Window */
.chat-window {
    position: fixed;
    bottom: 100px;
    right: 30px;
    width: 350px;
    height: 500px;
    background-color: var(--chat-white);
    border-radius: 20px;
    box-shadow: var(--chat-shadow);
    display: flex;
    flex-direction: column;
    overflow: hidden;
    z-index: 9998;
    transform-origin: bottom right;
    transform: scale(0);
    opacity: 0;
    transition: all 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

.chat-window.open {
    transform: scale(1);
    opacity: 1;
}

/* Chat Header */
.chat-header {
    background: linear-gradient(135deg, var(--chat-primary), var(--chat-secondary));
    color: var(--chat-white);
    padding: 20px;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.chat-header-info {
    display: flex;
    align-items: center;
    gap: 10px;
}

.chat-avatar {
    width: 40px;
    height: 40px;
    background-color: var(--chat-white);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--chat-primary);
    font-weight: bold;
    font-size: 18px;
}

.chat-title h4 {
    margin: 0;
    font-size: 16px;
    font-weight: 600;
}

.chat-title p {
    margin: 0;
    font-size: 12px;
    opacity: 0.8;
}

.chat-close-btn {
    background: none;
    border: none;
    color: var(--chat-white);
    font-size: 18px;
    cursor: pointer;
    opacity: 0.7;
    transition: opacity 0.2s;
}

.chat-close-btn:hover {
    opacity: 1;
}

/* Chat Body */
.chat-body {
    flex: 1;
    padding: 20px;
    overflow-y: auto;
    background-color: var(--chat-bg);
    display: flex;
    flex-direction: column;
    gap: 15px;
}

/* Messages */
.message {
    max-width: 80%;
    padding: 12px 16px;
    border-radius: 15px;
    font-size: 14px;
    line-height: 1.4;
    position: relative;
    animation: fadeIn 0.3s ease;
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.message.bot {
    align-self: flex-start;
    background-color: var(--chat-white);
    color: var(--chat-text);
    border-bottom-left-radius: 2px;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.05);
}

.message.user {
    align-self: flex-end;
    background-color: var(--chat-secondary);
    color: var(--chat-white);
    border-bottom-right-radius: 2px;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.1);
}

/* Chat Options / Quick Replies */
.chat-options {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-top: 5px;
}

.chat-option-btn {
    background-color: var(--chat-white);
    border: 1px solid var(--chat-primary);
    color: var(--chat-primary);
    padding: 8px 14px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
}

.chat-option-btn:hover {
    background-color: var(--chat-primary);
    color: var(--chat-white);
}

/* Chat Footer / Input */
.chat-footer {
    padding: 15px;
    background-color: var(--chat-white);
    border-top: 1px solid #eee;
    display: flex;
    align-items: center;
    gap: 10px;
}

.chat-input {
    flex: 1;
    border: 1px solid #ddd;
    border-radius: 25px;
    padding: 10px 15px;
    font-size: 14px;
    outline: none;
    transition: border-color 0.2s;
}

.chat-input:focus {
    border-color: var(--chat-secondary);
}

.chat-send-btn {
    background-color: var(--chat-secondary);
    color: var(--chat-white);
    border: none;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: background-color 0.2s;
}

.chat-send-btn:hover {
    background-color: var(--chat-primary);
}

/* Notification Badge */
.chat-badge {
    position: absolute;
    top: -5px;
    right: -5px;
    background-color: var(--chat-primary);
    /* Red badge */
    color: white;
    font-size: 12px;
    font-weight: bold;
    width: 20px;
    height: 20px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    border: 2px solid white;
    animation: pulse 2s infinite;
}

@keyframes pulse {
    0% {
        transform: scale(1);
        box-shadow: 0 0 0 0 rgba(211, 32, 39, 0.7);
    }

    70% {
        transform: scale(1.1);
        box-shadow: 0 0 0 10px rgba(211, 32, 39, 0);
    }

    100% {
        transform: scale(1);
        box-shadow: 0 0 0 0 rgba(211, 32, 39, 0);
    }
}

/* Responsive */
@media (max-width: 480px) {

    .chat-fab-container {
        bottom: 20px;
        right: 20px;
    }
}