/* Custom CSS for Emotional AI Chatbot - Purple Theme */

:root {
    --purple-primary: #8A2BE2;       /* Vibrant purple */
    --purple-secondary: #9370DB;     /* Soft purple */
    --purple-light: #D8BFD8;         /* Light purple */
    --purple-dark: #4B0082;          /* Deep purple */
    --accent-pink: #FF69B4;          /* Pink accent */
    --accent-teal: #20B2AA;          /* Teal accent */
    --happy-color: #FFD700;          /* Gold - Happiness */
    --sad-color: #6A5ACD;            /* Slate blue - Sadness */
    --anxious-color: #FF6347;        /* Tomato red - Anxiety */
    --excited-color: #32CD32;        /* Lime green - Excitement */
}

/* Purple Theme Colors */
.bg-purple {
    background-color: var(--purple-primary) !important;
}

.text-purple {
    color: var(--purple-primary) !important;
}

.border-purple {
    border-color: var(--purple-primary) !important;
}

.btn-purple {
    background-color: var(--purple-primary) !important;
    border-color: var(--purple-primary) !important;
    color: white !important;
}

.btn-purple:hover {
    background-color: var(--purple-dark) !important;
    border-color: var(--purple-dark) !important;
    color: white !important;
}

.btn-outline-purple {
    color: var(--purple-primary) !important;
    border-color: var(--purple-primary) !important;
}

.btn-outline-purple:hover {
    background-color: var(--purple-primary) !important;
    color: white !important;
}

.bg-gradient-purple {
    background: linear-gradient(90deg, var(--purple-primary), var(--purple-secondary)) !important;
}

.alert-purple {
    background-color: rgba(138, 43, 226, 0.1) !important;
    color: var(--purple-primary) !important;
    border-color: var(--purple-primary) !important;
    border-left: 3px solid var(--purple-primary);
}

/* Global Styles */
body {
    font-family: 'Poppins', sans-serif;
    background: linear-gradient(135deg, #f5f0ff 0%, #e6e6fa 100%);
    margin: 0;
    padding: 0;
    height: 100vh;
    overflow: hidden;
}

/* Fixed Header */
.header {
    color: white;
    position: sticky !important;
    top: 0;
    z-index: 1000;
}

.logo-icon {
    background: rgba(255, 255, 255, 0.2);
    width: 50px;
    height: 50px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* Main Container */
.container-fluid {
    height: 100vh;
}

/* Chat Container - Full width when sidebar hidden */
#chatContainer {
    transition: all 0.3s ease;
}

#chatContainer.full-width {
    width: 100%;
    max-width: 100%;
}

/* Chat Interface */
.chat-messages {
    overflow-y: auto;
    background-color: #f8f9fa;
    flex-grow: 1;
    background: linear-gradient(to bottom, #ffffff, #f8f9fa);
}

/* Message Styles */
.message {
    display: flex;
    margin-bottom: 1rem;
    animation: fadeIn 0.3s ease-in;
}

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(10px); }
    to { opacity: 1; transform: translateY(0); }
}

.bot-message {
    justify-content: flex-start;
}

.user-message {
    justify-content: flex-end;
}

.message-avatar {
    flex-shrink: 0;
    margin-right: 10px;
}

.user-message .message-avatar {
    order: 2;
    margin-right: 0;
    margin-left: 10px;
}

.avatar {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
}

.avatar.small {
    width: 32px;
    height: 32px;
    font-size: 0.9rem;
}

.ai-avatar {
    background: linear-gradient(135deg, var(--purple-primary), var(--purple-secondary));
    color: white;
}

.user-avatar {
    background: linear-gradient(135deg, var(--accent-pink), #FF1493);
    color: white;
}

.online-dot {
    position: absolute;
    bottom: 0;
    right: 0;
    width: 8px;
    height: 8px;
    background-color: #32CD32;
    border-radius: 50%;
    border: 2px solid white;
}

.message-content {
    max-width: 80%;
    padding: 12px 16px;
    border-radius: 18px;
    position: relative;
    animation: messageSlide 0.3s ease-out;
}

@keyframes messageSlide {
    from { 
        transform: translateY(20px); 
        opacity: 0; 
    }
    to { 
        transform: translateY(0); 
        opacity: 1; 
    }
}

.bot-message .message-content {
    background-color: white;
    border-top-left-radius: 5px;
    box-shadow: 0 3px 10px rgba(0, 0, 0, 0.08);
    border-left: 4px solid var(--purple-primary);
}

.user-message .message-content {
    background: linear-gradient(135deg, var(--accent-pink), #FF1493);
    color: white;
    border-top-right-radius: 5px;
    box-shadow: 0 3px 10px rgba(255, 105, 180, 0.2);
}

.message-text {
    line-height: 1.5;
    font-size: 0.95rem;
}

.user-name-mention {
    color: var(--purple-primary);
    font-weight: 600;
    background: rgba(138, 43, 226, 0.1);
    padding: 2px 6px;
    border-radius: 4px;
}

.message-time {
    font-size: 0.75rem;
    opacity: 0.7;
    margin-top: 5px;
    text-align: right;
}

.user-message .message-time {
    color: rgba(255, 255, 255, 0.8);
}

/* Mood Display */
.mood-display {
    display: flex;
    align-items: center;
    gap: 8px;
    background: white;
    padding: 5px 15px;
    border-radius: 20px;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.05);
}

.mood-label {
    font-size: 0.8rem;
    color: #6c757d;
    font-weight: 500;
}

.mood {
    display: inline-flex;
    align-items: center;
    padding: 5px 12px;
    border-radius: 20px;
    font-size: 0.85rem;
    font-weight: 500;
    transition: all 0.3s ease;
}

.mood.neutral {
    background-color: #f0e6ff;
    color: var(--purple-primary);
    border-left: 3px solid var(--purple-primary);
}

.mood.happy {
    background-color: #fff9e6;
    color: var(--happy-color);
    border-left: 3px solid var(--happy-color);
}

.mood.sad {
    background-color: #f0e6ff;
    color: var(--sad-color);
    border-left: 3px solid var(--sad-color);
}

.mood.anxious {
    background-color: #ffe6e6;
    color: var(--anxious-color);
    border-left: 3px solid var(--anxious-color);
}

.mood.excited {
    background-color: #f0ffe6;
    color: var(--excited-color);
    border-left: 3px solid var(--excited-color);
}

/* Emotion Buttons */
.emotion-btn {
    border-radius: 20px;
    font-weight: 500;
    border: none;
    transition: all 0.3s ease;
    padding: 6px 14px;
    font-size: 0.85rem;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.emotion-btn.happy {
    background: linear-gradient(135deg, #fff9e6, #fff0b3);
    color: var(--happy-color);
    border: 1px solid rgba(255, 215, 0, 0.3);
}

.emotion-btn.happy:hover {
    background: linear-gradient(135deg, #fff0b3, #ffe680);
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(255, 215, 0, 0.2);
}

.emotion-btn.sad {
    background: linear-gradient(135deg, #f0e6ff, #d9c8ff);
    color: var(--sad-color);
    border: 1px solid rgba(106, 90, 205, 0.3);
}

.emotion-btn.sad:hover {
    background: linear-gradient(135deg, #d9c8ff, #c2a8ff);
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(106, 90, 205, 0.2);
}

.emotion-btn.excited {
    background: linear-gradient(135deg, #f0ffe6, #d1ffb8);
    color: var(--excited-color);
    border: 1px solid rgba(50, 205, 50, 0.3);
}

.emotion-btn.excited:hover {
    background: linear-gradient(135deg, #d1ffb8, #b2ff8a);
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(50, 205, 50, 0.2);
}

.emotion-btn.anxious {
    background: linear-gradient(135deg, #ffe6e6, #ffb3b3);
    color: var(--anxious-color);
    border: 1px solid rgba(255, 99, 71, 0.3);
}

.emotion-btn.anxious:hover {
    background: linear-gradient(135deg, #ffb3b3, #ff8080);
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(255, 99, 71, 0.2);
}

/* Quick Actions */
.quick-actions {
    background: linear-gradient(to bottom, #ffffff, #f8f9fa);
    transition: all 0.5s ease;
    max-height: 100px;
    overflow: hidden;
    opacity: 1;
    border-top: 2px solid var(--purple-light) !important;
}

.quick-actions.hidden {
    max-height: 0;
    padding-top: 0;
    padding-bottom: 0;
    border: none;
    opacity: 0;
}

/* Sidebar Styles */
#sidebar {
    transition: all 0.3s ease;
    background: white;
    box-shadow: -5px 0 15px rgba(0, 0, 0, 0.1);
}

#sidebar.hidden {
    display: none;
}

.sidebar-header {
    background: linear-gradient(90deg, var(--purple-primary), var(--purple-secondary)) !important;
}

/* Sidebar Tabs */
.sidebar-tabs .nav-link {
    color: #6c757d;
    border-radius: 0;
    padding: 12px;
    font-size: 0.9rem;
    transition: all 0.3s ease;
}

.sidebar-tabs .nav-link.active {
    color: var(--purple-primary);
    background-color: rgba(138, 43, 226, 0.1);
    border-bottom: 3px solid var(--purple-primary);
}

.sidebar-tabs .nav-link:hover {
    color: var(--purple-primary);
    background-color: rgba(138, 43, 226, 0.05);
}

/* Student Card */
.student-card {
    border: 2px solid var(--purple-light);
}

.student-info .info-item {
    padding: 8px 0;
    border-bottom: 1px solid rgba(138, 43, 226, 0.1);
}

.student-info .info-item:last-child {
    border-bottom: none;
}

.info-icon {
    width: 36px;
    height: 36px;
    background: rgba(138, 43, 226, 0.1);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* Feature List */
.feature-list {
    list-style: none;
    padding-left: 0;
}

.feature-item {
    padding: 8px 0;
    border-bottom: 1px solid rgba(0, 0, 0, 0.05);
}

.feature-item:last-child {
    border-bottom: none;
}

/* Tech Badges */
.tech-badges {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.tech-badge {
    display: inline-block;
    padding: 6px 12px;
    background: linear-gradient(135deg, rgba(138, 43, 226, 0.1), rgba(147, 112, 219, 0.1));
    color: var(--purple-primary);
    border-radius: 20px;
    font-size: 0.8rem;
    font-weight: 500;
    border: 1px solid rgba(138, 43, 226, 0.2);
}

/* Objectives */
.objectives {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.objective {
    padding: 8px 12px;
    background: rgba(138, 43, 226, 0.05);
    border-radius: 8px;
    border-left: 3px solid var(--purple-primary);
}

/* List Group Items */
.list-group-item {
    border: none;
    padding: 10px 15px;
    margin-bottom: 5px;
    border-radius: 10px !important;
    transition: all 0.2s ease;
    border-left: 3px solid transparent;
    background: rgba(138, 43, 226, 0.02);
}

.list-group-item-action:hover {
    background: rgba(138, 43, 226, 0.08);
    border-left-color: var(--purple-primary);
    transform: translateX(5px);
}

.list-group-item-action:active {
    background: rgba(138, 43, 226, 0.12);
}

/* Status Indicator */
.status-indicator {
    display: inline-block;
    width: 8px;
    height: 8px;
    border-radius: 50%;
    margin-right: 6px;
    animation: pulse 2s infinite;
}

@keyframes pulse {
    0% { opacity: 1; }
    50% { opacity: 0.5; }
    100% { opacity: 1; }
}

.status-indicator.online {
    background-color: #32CD32;
}

/* Typing Indicator */
.typing-indicator {
    display: flex;
    align-items: center;
    padding: 10px 16px;
    background-color: white;
    border-radius: 18px;
    width: fit-content;
    box-shadow: 0 3px 10px rgba(0, 0, 0, 0.08);
    margin-left: 42px;
    border-left: 4px solid var(--purple-primary);
}

.typing-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background-color: var(--purple-primary);
    margin: 0 3px;
    animation: typingAnimation 1.4s infinite ease-in-out;
}

.typing-dot:nth-child(1) { animation-delay: -0.32s; }
.typing-dot:nth-child(2) { animation-delay: -0.16s; }

@keyframes typingAnimation {
    0%, 80%, 100% { transform: scale(0.8); opacity: 0.5; }
    40% { transform: scale(1); opacity: 1; }
}

/* Footer */
.footer {
    background: linear-gradient(to right, #ffffff, #f8f9fa);
}

/* Custom Scrollbar */
.chat-messages::-webkit-scrollbar,
.tab-content::-webkit-scrollbar {
    width: 8px;
}

.chat-messages::-webkit-scrollbar-track,
.tab-content::-webkit-scrollbar-track {
    background: #f1f1f1;
    border-radius: 10px;
}

.chat-messages::-webkit-scrollbar-thumb,
.tab-content::-webkit-scrollbar-thumb {
    background: var(--purple-light);
    border-radius: 10px;
}

.chat-messages::-webkit-scrollbar-thumb:hover,
.tab-content::-webkit-scrollbar-thumb:hover {
    background: var(--purple-secondary);
}

/* Input Group */
.form-control:focus {
    border-color: var(--purple-primary);
    box-shadow: 0 0 0 0.25rem rgba(138, 43, 226, 0.25);
}

/* Responsive Adjustments */
@media (max-width: 992px) {
    .header {
        padding: 12px 0 !important;
    }
    
    .logo-icon {
        width: 40px;
        height: 40px;
    }
    
    .message-content {
        max-width: 85%;
    }
    
    .chat-messages {
        padding: 15px !important;
    }
    
    #sidebar {
        position: fixed;
        top: 0;
        right: 0;
        width: 100%;
        max-width: 350px;
        height: 100%;
        z-index: 1050;
        transform: translateX(100%);
    }
    
    #sidebar:not(.hidden) {
        transform: translateX(0);
    }
    
    #toggleSidebar {
        display: block;
    }
    
    #chatContainer {
        width: 100% !important;
        max-width: 100% !important;
    }
}

@media (max-width: 768px) {
    .mood-display {
        display: none;
    }
    
    .chat-header {
        padding: 10px !important;
    }
    
    .quick-actions {
        padding: 10px !important;
    }
    
    .chat-input {
        padding: 15px !important;
    }
}

/* Card Styles */
.card {
    border-radius: 12px;
    border: 1px solid #e9ecef;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.05);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.card:hover {
    transform: translateY(-5px);
    box-shadow: 0 8px 15px rgba(0, 0, 0, 0.1);
}

/* Suggestion Message */
.suggestion-message .message-content {
    background: linear-gradient(135deg, #f0e6ff, #e6d6ff);
    border-left: 4px solid var(--accent-teal);
}

.suggestion-message .message-text {
    color: var(--purple-dark);
}

/* Welcome Animation */
@keyframes welcomeFade {
    from { opacity: 0; transform: translateY(20px); }
    to { opacity: 1; transform: translateY(0); }
}

.welcome-message {
    animation: welcomeFade 0.8s ease-out;
}