/* ================================================
   LEO CHATBOT - PREMIUM MODERN DESIGN
   Dark Mode with Neon Glassmorphism Effect
   ================================================ */

/* CSS Variables for Easy Customization */
:root {
    /* Primary Colors */
    --primary-color: #6366f1;        /* Indigo - Main brand color */
    --secondary-color: #8b5cf6;      /* Purple - Accent color */
    --neon-cyan: #06b6d4;            /* Cyan - Highlight */
    --neon-pink: #ec4899;            /* Pink - Accent */
    
    /* Backgrounds */
    --bg-dark: #0f172a;              /* Very dark blue */
    --bg-darker: #0a0f1f;            /* Darker background */
    --surface-light: #1e293b;        /* Surface color */
    --surface-lighter: #334155;      /* Lighter surface */
    
    /* Text Colors */
    --text-primary: #f1f5f9;         /* Main text */
    --text-secondary: #cbd5e1;       /* Secondary text */
    --text-muted: #94a3b8;           /* Muted text */
    
    /* Borders & Effects */
    --border-color: rgba(99, 102, 241, 0.2);
    --glow-color: rgba(99, 102, 241, 0.5);
    
    /* Spacing */
    --spacing-xs: 0.5rem;
    --spacing-sm: 0.75rem;
    --spacing-md: 1rem;
    --spacing-lg: 1.5rem;
    --spacing-xl: 2rem;
    
    /* Transitions */
    --transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

/* ================================================
   GLOBAL STYLES
   ================================================ */

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background: linear-gradient(135deg, var(--bg-darker) 0%, var(--bg-dark) 100%);
    color: var(--text-primary);
    line-height: 1.6;
    min-height: 100vh;
    overflow: hidden;
}

/* Animated Background Gradient */
body::before {
    content: '';
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: radial-gradient(
        circle at 20% 50%,
        rgba(99, 102, 241, 0.1) 0%,
        transparent 50%
    ), radial-gradient(
        circle at 80% 80%,
        rgba(139, 92, 246, 0.1) 0%,
        transparent 50%
    );
    pointer-events: none;
    z-index: 0;
    animation: gradientShift 8s ease-in-out infinite;
}

@keyframes gradientShift {
    0%, 100% {
        opacity: 1;
    }
    50% {
        opacity: 0.8;
    }
}

/* ================================================
   MAIN LAYOUT
   ================================================ */

.container {
    display: flex;
    height: 100vh;
    position: relative;
    z-index: 1;
    gap: var(--spacing-md);
    padding: var(--spacing-md);
}

/* Sidebar */
.sidebar {
    width: 280px;
    background: rgba(30, 41, 59, 0.7);
    backdrop-filter: blur(10px);
    border: 1px solid var(--border-color);
    border-radius: 16px;
    display: flex;
    flex-direction: column;
    padding: var(--spacing-lg);
    gap: var(--spacing-lg);
    animation: slideInLeft 0.5s ease-out;
    overflow-y: auto;
}

@keyframes slideInLeft {
    from {
        transform: translateX(-100%);
        opacity: 0;
    }
    to {
        transform: translateX(0);
        opacity: 1;
    }
}

.sidebar-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 1px solid var(--border-color);
    padding-bottom: var(--spacing-md);
}

.sidebar-header h2 {
    font-size: 1.1rem;
    font-weight: 600;
    background: linear-gradient(135deg, var(--primary-color), var(--neon-cyan));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.close-sidebar {
    display: none;
    background: none;
    border: none;
    color: var(--text-secondary);
    font-size: 1.5rem;
    cursor: pointer;
}

/* Quick Questions */
.quick-questions {
    display: flex;
    flex-direction: column;
    gap: var(--spacing-sm);
}

.quick-btn {
    padding: var(--spacing-sm) var(--spacing-md);
    background: rgba(99, 102, 241, 0.1);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    color: var(--text-primary);
    cursor: pointer;
    transition: var(--transition);
    font-size: 0.9rem;
    text-align: left;
    overflow: hidden;
    position: relative;
}

.quick-btn::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 0;
    height: 0;
    background: rgba(99, 102, 241, 0.3);
    border-radius: 50%;
    transform: translate(-50%, -50%);
    transition: width 0.6s, height 0.6s;
}

.quick-btn:hover::before {
    width: 300px;
    height: 300px;
}

.quick-btn:hover {
    border-color: var(--primary-color);
    background: rgba(99, 102, 241, 0.2);
    transform: translateX(4px);
}

/* Chat Container */
.chat-container {
    flex: 1;
    display: flex;
    flex-direction: column;
    background: rgba(15, 23, 42, 0.5);
    backdrop-filter: blur(10px);
    border: 1px solid var(--border-color);
    border-radius: 16px;
    animation: slideInRight 0.5s ease-out;
}

@keyframes slideInRight {
    from {
        transform: translateX(100%);
        opacity: 0;
    }
    to {
        transform: translateX(0);
        opacity: 1;
    }
}

/* Chat Header */
.chat-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: var(--spacing-lg);
    border-bottom: 1px solid var(--border-color);
    background: rgba(30, 41, 59, 0.3);
    border-radius: 16px 16px 0 0;
}

.header-left {
    display: flex;
    align-items: center;
    gap: var(--spacing-lg);
}

.menu-toggle {
    display: none;
    background: none;
    border: none;
    color: var(--text-primary);
    font-size: 1.5rem;
    cursor: pointer;
}

.bot-info h1 {
    font-size: 1.5rem;
    font-weight: 700;
    background: linear-gradient(135deg, var(--primary-color), var(--neon-cyan));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.status {
    font-size: 0.85rem;
    color: var(--text-muted);
    margin-top: 2px;
}

.clear-btn {
    background: rgba(99, 102, 241, 0.1);
    border: 1px solid var(--border-color);
    padding: var(--spacing-sm) var(--spacing-md);
    border-radius: 8px;
    color: var(--text-primary);
    cursor: pointer;
    transition: var(--transition);
    font-size: 1rem;
}

.clear-btn:hover {
    background: rgba(236, 72, 153, 0.2);
    border-color: var(--neon-pink);
}

/* ================================================
   MESSAGES CONTAINER
   ================================================ */

.messages-container {
    flex: 1;
    overflow-y: auto;
    padding: var(--spacing-xl);
    display: flex;
    flex-direction: column;
    gap: var(--spacing-lg);
}

/* Scrollbar Styling */
.messages-container::-webkit-scrollbar {
    width: 8px;
}

.messages-container::-webkit-scrollbar-track {
    background: transparent;
}

.messages-container::-webkit-scrollbar-thumb {
    background: rgba(99, 102, 241, 0.3);
    border-radius: 4px;
}

.messages-container::-webkit-scrollbar-thumb:hover {
    background: rgba(99, 102, 241, 0.5);
}

/* Message Base Styles */
.message {
    display: flex;
    gap: var(--spacing-md);
    animation: messageSlideIn 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

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

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

.bot-avatar {
    background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
    box-shadow: 0 0 20px rgba(99, 102, 241, 0.4);
}

.user-avatar {
    background: linear-gradient(135deg, var(--neon-cyan), var(--neon-pink));
    box-shadow: 0 0 20px rgba(6, 182, 212, 0.4);
}

/* Message Content */
.message-content {
    display: flex;
    flex-direction: column;
    gap: var(--spacing-xs);
}

.message-content p {
    padding: var(--spacing-md) var(--spacing-lg);
    border-radius: 12px;
    word-wrap: break-word;
    max-width: 500px;
}

/* Bot Messages */
.bot-message .message-content p {
    background: rgba(99, 102, 241, 0.15);
    border: 1px solid var(--border-color);
    color: var(--text-primary);
}

/* User Messages */
.user-message {
    flex-direction: row-reverse;
}

.user-message .message-content {
    align-items: flex-end;
}

.user-message .message-content p {
    background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
    color: white;
    border: none;
}

/* Timestamp */
.message-time {
    font-size: 0.75rem;
    color: var(--text-muted);
    padding: 0 var(--spacing-lg);
}

/* Welcome Message */
.welcome-message {
    animation: fadeInScale 0.6s ease-out;
}

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

/* Loading Indicator */
.loading-dots {
    display: flex;
    gap: 4px;
    padding: var(--spacing-md) var(--spacing-lg);
}

.loading-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: var(--primary-color);
    animation: bounce 1.4s infinite;
}

.loading-dot:nth-child(1) {
    animation-delay: 0s;
}

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

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

@keyframes bounce {
    0%, 80%, 100% {
        opacity: 0.3;
        transform: translateY(0);
    }
    40% {
        opacity: 1;
        transform: translateY(-10px);
    }
}

/* ================================================
   INPUT AREA
   ================================================ */

.chat-footer {
    padding: var(--spacing-lg);
    border-top: 1px solid var(--border-color);
    background: rgba(30, 41, 59, 0.3);
    border-radius: 0 0 16px 16px;
}

.input-wrapper {
    display: flex;
    gap: var(--spacing-sm);
    margin-bottom: var(--spacing-md);
}

.message-input {
    flex: 1;
    padding: var(--spacing-md) var(--spacing-lg);
    background: rgba(99, 102, 241, 0.1);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    color: var(--text-primary);
    font-size: 0.95rem;
    outline: none;
    transition: var(--transition);
}

.message-input::placeholder {
    color: var(--text-muted);
}

.message-input:focus {
    border-color: var(--primary-color);
    background: rgba(99, 102, 241, 0.15);
    box-shadow: 0 0 20px rgba(99, 102, 241, 0.2);
}

.send-btn {
    padding: var(--spacing-md) var(--spacing-lg);
    background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
    border: none;
    border-radius: 8px;
    color: white;
    font-size: 1.1rem;
    cursor: pointer;
    transition: var(--transition);
    display: flex;
    align-items: center;
    justify-content: center;
    min-width: 48px;
    position: relative;
    overflow: hidden;
}

.send-btn::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 0;
    height: 0;
    background: rgba(255, 255, 255, 0.3);
    border-radius: 50%;
    transform: translate(-50%, -50%);
    transition: width 0.6s, height 0.6s;
}

.send-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 10px 25px rgba(99, 102, 241, 0.4);
}

.send-btn:hover::before {
    width: 300px;
    height: 300px;
}

.send-btn:active {
    transform: translateY(0);
}

.footer-note {
    text-align: center;
    font-size: 0.75rem;
    color: var(--text-muted);
}

/* ================================================
   RESPONSIVE DESIGN
   ================================================ */

@media (max-width: 1024px) {
    .sidebar {
        width: 220px;
    }

    .message-content p {
        max-width: 350px;
    }
}

@media (max-width: 768px) {
    .container {
        padding: var(--spacing-sm);
        gap: 0;
    }

    .sidebar {
        position: absolute;
        left: -280px;
        top: 0;
        bottom: 0;
        width: 280px;
        height: 100vh;
        z-index: 100;
        transition: left 0.3s ease;
        border-radius: 0 16px 16px 0;
    }

    .sidebar.active {
        left: 0;
    }

    .close-sidebar {
        display: block;
    }

    .menu-toggle {
        display: block;
    }

    .message {
        flex-wrap: wrap;
    }

    .message-content p {
        max-width: 90vw;
    }

    .chat-header {
        flex-wrap: wrap;
        gap: var(--spacing-md);
    }

    .bot-info h1 {
        font-size: 1.2rem;
    }

    .status {
        display: none;
    }
}

@media (max-width: 480px) {
    .container {
        padding: 0;
    }

    .chat-container {
        border-radius: 0;
    }

    .message-content p {
        max-width: 85vw;
        padding: var(--spacing-sm) var(--spacing-md);
        font-size: 0.9rem;
    }

    .sidebar-header h2 {
        font-size: 1rem;
    }

    .quick-btn {
        font-size: 0.85rem;
        padding: var(--spacing-xs) var(--spacing-sm);
    }
}

/* ================================================
   ANIMATION UTILITIES
   ================================================ */

@keyframes pulse {
    0%, 100% {
        opacity: 1;
    }
    50% {
        opacity: 0.7;
    }
}

@keyframes glow {
    0%, 100% {
        box-shadow: 0 0 20px rgba(99, 102, 241, 0.4);
    }
    50% {
        box-shadow: 0 0 30px rgba(99, 102, 241, 0.6);
    }
}

/* Smooth fade-in for content */
.fade-in {
    animation: fadeIn 0.5s ease-out;
}

@keyframes fadeIn {
    from {
        opacity: 0;
    }
    to {
        opacity: 1;
    }
}
