/* AI Counsellor Styles */
:root {
    --reva-red: #E22A27;
    --reva-dark: #222222;
    --reva-accent: #0096a1;
    --glass-bg: rgba(255, 255, 255, 0.7);
    --glass-border: rgba(255, 255, 255, 0.3);
}

/* Floating Trigger Button */
.ai-bot-trigger {
    position: fixed;
    bottom: 30px;
    right: 30px;
    width: 60px;
    height: 60px;
    background: #E22A27;
    color: white;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 24px;
    cursor: pointer;
    box-shadow: 0 4px 15px rgba(226, 42, 39, 0.4);
    z-index: 10000;
    transition: all 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    animation: pulse 2s infinite;
    pointer-events: auto !important;
}

.ai-bot-trigger:hover {
    transform: scale(1.1);
}

.ai-bot-trigger i {
    font-size: 28px;
}

.ai-bot-trigger::after {
    content: '';
    position: absolute;
    width: 100%;
    height: 100%;
    border-radius: 50%;
    background-color: var(--reva-red);
    opacity: 0.6;
    animation: bot-pulse 2s infinite;
    z-index: -1;
}

@keyframes bot-pulse {
    0% {
        transform: scale(1);
        opacity: 0.6;
    }

    100% {
        transform: scale(1.6);
        opacity: 0;
    }
}

/* Chat Window */
.ai-bot-window {
    position: fixed;
    bottom: 100px;
    right: 30px;
    width: 380px;
    height: 550px;
    max-height: calc(100vh - 150px);
    background: var(--glass-bg);
    backdrop-filter: blur(15px);
    -webkit-backdrop-filter: blur(15px);
    border: 1px solid var(--glass-border);
    border-radius: 20px;
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.15);
    z-index: 10001;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    transform: translateY(20px) scale(0.95);
    opacity: 0;
    visibility: hidden;
    transition: all 0.4s cubic-bezier(0.165, 0.84, 0.44, 1);
    pointer-events: auto !important;
}

.ai-bot-window.active {
    transform: translateY(0) scale(1);
    opacity: 1;
    visibility: visible;
}

/* Header */
.ai-bot-header {
    background-color: var(--reva-red);
    padding: 15px 20px;
    color: white;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.ai-bot-header .bot-info {
    display: flex;
    align-items: center;
    gap: 12px;
}

.ai-bot-header .bot-info img {
    height: 35px;
    width: auto;
    background: transparent;
    padding: 0;
    border-radius: 0;
}

.ai-bot-header h5 {
    margin: 0;
    font-size: 16px;
    font-weight: 600;
    font-family: 'Montserrat', sans-serif;
}

.ai-bot-header .close-bot {
    cursor: pointer;
    font-size: 20px;
    opacity: 0.8;
    transition: opacity 0.2s;
}

.ai-bot-header .close-bot:hover {
    opacity: 1;
}

/* Chat History */
.ai-bot-messages {
    flex: 1;
    padding: 20px;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    gap: 15px;
    scroll-behavior: smooth;
}

.message {
    max-width: 80%;
    padding: 12px 16px;
    border-radius: 15px;
    font-size: 14px;
    line-height: 1.5;
    font-family: 'Montserrat', sans-serif;
}

.message.bot {
    align-self: flex-start;
    background: white;
    color: var(--reva-dark);
    border-bottom-left-radius: 2px;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.05);
}

.message.user {
    align-self: flex-end;
    background: var(--reva-accent);
    color: white;
    border-bottom-right-radius: 2px;
}

/* Formatted Text Styles inside Messages */
.message p {
    margin: 0 0 8px 0;
}

.message p:last-child {
    margin: 0;
}

.message strong {
    font-weight: 600;
}

.message.bot strong {
    color: var(--reva-red);
}

.message ul.bot-list {
    margin: 8px 0 12px 0;
    padding-left: 20px;
    list-style-type: none;
    /* We will use custom bullets for better UI */
}

.message ul.bot-list li {
    position: relative;
    margin-bottom: 8px;
    line-height: 1.5;
    padding-left: 15px;
}

.message ul.bot-list li::before {
    content: "•";
    color: var(--reva-red);
    font-weight: bold;
    font-size: 1.2em;
    position: absolute;
    left: 0;
    top: -2px;
}

.message ul.bot-list li:last-child {
    margin-bottom: 0;
}

/* Typing Indicator */
.typing {
    font-style: italic;
    font-size: 12px;
    color: #666;
    display: none;
}

/* Input Area */
.ai-bot-input {
    padding: 15px;
    background: rgba(255, 255, 255, 0.5);
    border-top: 1px solid var(--glass-border);
    display: flex;
    gap: 10px;
}

.ai-bot-input input {
    flex: 1;
    border: 1px solid #ddd;
    border-radius: 25px;
    padding: 10px 20px;
    font-size: 14px;
    outline: none;
    transition: border-color 0.3s;
}

.ai-bot-input input:focus {
    border-color: var(--reva-accent);
}

.ai-bot-input button {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background-color: var(--reva-red);
    color: white;
    border: none;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: transform 0.2s;
}

.ai-bot-input button:hover {
    transform: scale(1.1);
}

.ai-bot-input .mic-btn {
    background-color: #f1f1f1;
    color: var(--reva-dark);
    animation: bounce-attention 2s infinite ease-in-out;
}

@keyframes bounce-attention {

    0%,
    100% {
        transform: translateY(0);
    }

    50% {
        transform: translateY(-3px);
    }
}

.ai-bot-input .mic-btn:hover {
    background-color: #e0e0e0;
    animation: none;
    /* Stop bounce on hover */
}

.ai-bot-input .mic-btn.recording {
    background-color: #ff4444;
    color: white;
    animation: pulse 1s infinite;
}

@keyframes pulse {
    0% {
        transform: scale(1);
        box-shadow: 0 0 0 0 rgba(255, 68, 68, 0.7);
    }

    70% {
        transform: scale(1.1);
        box-shadow: 0 0 0 10px rgba(255, 68, 68, 0);
    }

    100% {
        transform: scale(1);
        box-shadow: 0 0 0 0 rgba(255, 68, 68, 0);
    }
}

/* Quick Replies */
.quick-replies {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-bottom: 10px;
    padding: 0 5px;
}

.quick-reply-btn {
    background: transparent;
    border: 1px solid var(--reva-red);
    color: var(--reva-red);
    padding: 8px 12px;
    border-radius: 15px;
    font-size: 13px;
    cursor: pointer;
    transition: all 0.3s ease;
}

.quick-reply-btn:hover {
    background: var(--reva-red);
    color: white;
}

/* Mobile Responsive */
@media (max-width: 480px) {
    .ai-bot-window {
        bottom: 0;
        right: 0;
        width: 100%;
        height: 100%;
        border-radius: 0;
        max-height: none;
    }

    .ai-bot-trigger {
        bottom: 20px;
        right: 20px;
    }
}