/* ========================================
   CyberSage AI Chatbot - MODERN PREMIUM EDITION
   Beautiful Glassmorphism Design
   ======================================== */

:root {
    /* Modern Premium Theme */
    --premium-primary: #6366f1;
    --premium-primary-dark: #4f46e5;
    --premium-primary-light: #818cf8;
    --premium-secondary: #ec4899;
    --premium-accent: #8b5cf6;
    --premium-success: #10b981;
    --premium-warning: #f59e0b;
    --premium-error: #ef4444;
    
    /* Backgrounds */
    --premium-bg-start: #0f172a;
    --premium-bg-end: #1e1b4b;
    --premium-glass: rgba(255, 255, 255, 0.1);
    --premium-glass-hover: rgba(255, 255, 255, 0.15);
    --premium-dark: rgba(15, 23, 42, 0.95);
    
    /* Text */
    --premium-text: #f8fafc;
    --premium-text-secondary: #cbd5e1;
    --premium-text-dim: #94a3b8;
    
    /* Effects */
    --premium-shadow: rgba(99, 102, 241, 0.4);
    --premium-glow: rgba(99, 102, 241, 0.6);
    --premium-border: rgba(255, 255, 255, 0.2);
}

/* Chatbot Button - Premium Floating Design */
.cybersage-modern-btn {
    position: fixed !important;
    bottom: 30px !important;
    right: 30px !important;
    width: 70px;
    height: 70px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--premium-primary) 0%, var(--premium-accent) 100%);
    border: none;
    cursor: pointer;
    box-shadow: 0 10px 40px var(--premium-shadow),
                0 0 0 0 rgba(99, 102, 241, 0.7);
    z-index: 10003 !important;
    display: flex !important;
    visibility: visible !important;
    opacity: 1 !important;
    align-items: center;
    justify-content: center;
    transition: all 0.4s cubic-bezier(0.34, 1.56, 0.64, 1);
    animation: premium-pulse 3s ease-in-out infinite;
    overflow: visible;
}

.cybersage-modern-btn::before {
    content: '';
    position: absolute;
    inset: -3px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--premium-primary-light), var(--premium-secondary), var(--premium-accent));
    opacity: 0;
    transition: opacity 0.3s ease;
    z-index: -1;
    animation: premium-rotate 3s linear infinite;
}

.cybersage-modern-btn:hover {
    transform: translateY(-5px) scale(1.1);
    box-shadow: 0 20px 60px var(--premium-shadow),
                0 0 0 8px rgba(99, 102, 241, 0.2);
}

.cybersage-modern-btn:hover::before {
    opacity: 1;
}

.cybersage-modern-btn.active {
    transform: scale(0.9);
}

.cybersage-modern-btn-icon {
    font-size: 34px;
    background: linear-gradient(135deg, #fff 0%, #f0f9ff 100%);
    background-clip: text;
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    filter: drop-shadow(0 2px 8px rgba(255, 255, 255, 0.3));
    transition: all 0.3s;
}

.cybersage-modern-btn:hover .cybersage-modern-btn-icon {
    transform: scale(1.1) rotate(10deg);
    filter: drop-shadow(0 4px 12px rgba(255, 255, 255, 0.5));
}

/* Premium Floating Badge */
.cybersage-modern-badge {
    position: absolute;
    top: -5px;
    right: -5px;
    width: 24px;
    height: 24px;
    background: linear-gradient(135deg, var(--premium-secondary), var(--premium-error));
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 11px;
    font-weight: 700;
    color: white;
    box-shadow: 0 4px 12px rgba(236, 72, 153, 0.6);
    animation: premium-bounce 2s ease-in-out infinite;
}

/* Premium Prompt Tooltip */
.cybersage-modern-prompt {
    position: absolute;
    bottom: 85px;
    right: 0;
    background: linear-gradient(135deg, rgba(255, 255, 255, 0.95), rgba(248, 250, 252, 0.98));
    backdrop-filter: blur(20px);
    color: var(--premium-bg-start);
    padding: 14px 20px;
    border-radius: 20px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3),
                inset 0 1px 0 rgba(255, 255, 255, 0.8);
    font-weight: 600;
    font-size: 14px;
    white-space: nowrap;
    animation: premium-float 3s ease-in-out infinite;
    pointer-events: none;
    display: none;
    border: 1px solid rgba(255, 255, 255, 0.8);
}

.cybersage-modern-prompt::after {
    content: '';
    position: absolute;
    bottom: -8px;
    right: 20px;
    width: 16px;
    height: 16px;
    background: linear-gradient(135deg, rgba(255, 255, 255, 0.95), rgba(248, 250, 252, 0.98));
    transform: rotate(45deg);
    border-right: 1px solid rgba(255, 255, 255, 0.5);
    border-bottom: 1px solid rgba(255, 255, 255, 0.5);
}

/* Chatbot Container - Premium Glassmorphism */
.cybersage-modern-container {
    position: fixed !important;
    bottom: 30px !important;
    right: 30px !important;
    width: 420px;
    height: 680px;
    background: linear-gradient(135deg, 
                rgba(15, 23, 42, 0.95) 0%, 
                rgba(30, 27, 75, 0.95) 100%);
    backdrop-filter: blur(40px);
    border-radius: 28px;
    box-shadow: 0 30px 90px rgba(0, 0, 0, 0.5),
                0 0 0 1px rgba(255, 255, 255, 0.1),
                inset 0 1px 0 rgba(255, 255, 255, 0.15);
    z-index: 10004 !important;
    display: none;
    flex-direction: column;
    overflow: hidden;
    animation: premium-slideIn 0.5s cubic-bezier(0.34, 1.56, 0.64, 1);
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.cybersage-modern-container.show {
    display: flex;
}

/* Premium Animated Background */
.cybersage-modern-container::before {
    content: '';
    position: absolute;
    inset: 0;
    background: 
        radial-gradient(circle at 20% 20%, rgba(99, 102, 241, 0.15) 0%, transparent 50%),
        radial-gradient(circle at 80% 80%, rgba(139, 92, 246, 0.15) 0%, transparent 50%),
        radial-gradient(circle at 40% 60%, rgba(236, 72, 153, 0.1) 0%, transparent 50%);
    pointer-events: none;
    animation: premium-gradient 8s ease-in-out infinite;
}

/* Header - Premium Glass Design */
.cybersage-modern-header {
    background: linear-gradient(135deg, 
                rgba(255, 255, 255, 0.12) 0%, 
                rgba(255, 255, 255, 0.08) 100%);
    backdrop-filter: blur(20px);
    padding: 20px 24px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    position: relative;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    z-index: 10;
}

.cybersage-modern-header-content {
    display: flex;
    align-items: center;
    gap: 14px;
}

.cybersage-modern-avatar {
    width: 52px;
    height: 52px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--premium-primary), var(--premium-accent));
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 26px;
    box-shadow: 0 8px 24px rgba(99, 102, 241, 0.4),
                inset 0 2px 0 rgba(255, 255, 255, 0.2);
    animation: premium-avatar-float 3s ease-in-out infinite;
    border: 2px solid rgba(255, 255, 255, 0.2);
}

.cybersage-modern-info h3 {
    color: var(--premium-text);
    font-size: 20px;
    font-weight: 700;
    margin: 0 0 6px 0;
    background: linear-gradient(135deg, #fff 0%, var(--premium-primary-light) 100%);
    background-clip: text;
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.cybersage-modern-status {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 13px;
    color: var(--premium-text-secondary);
    font-weight: 500;
}

.status-dot-modern {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    background: var(--premium-success);
    box-shadow: 0 0 0 3px rgba(16, 185, 129, 0.2),
                0 0 12px rgba(16, 185, 129, 0.6);
    animation: premium-pulse-dot 2s infinite;
}

.cybersage-modern-header-actions {
    display: flex;
    gap: 8px;
}

.cybersage-modern-header-btn {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.15);
    color: var(--premium-text-secondary);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
    font-size: 15px;
}

.cybersage-modern-header-btn:hover {
    background: rgba(255, 255, 255, 0.2);
    transform: translateY(-2px) scale(1.1);
    color: var(--premium-text);
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.3);
}

/* Messages Area - Premium Scrolling */
.cybersage-modern-messages {
    flex: 1;
    overflow-y: auto;
    padding: 24px;
    display: flex;
    flex-direction: column;
    gap: 20px;
    background: transparent;
    position: relative;
    z-index: 5;
}

.cybersage-modern-messages::-webkit-scrollbar {
    width: 8px;
}

.cybersage-modern-messages::-webkit-scrollbar-track {
    background: rgba(255, 255, 255, 0.05);
    border-radius: 10px;
    margin: 8px 0;
}

.cybersage-modern-messages::-webkit-scrollbar-thumb {
    background: linear-gradient(135deg, var(--premium-primary), var(--premium-accent));
    border-radius: 10px;
    border: 2px solid rgba(15, 23, 42, 0.5);
}

.cybersage-modern-messages::-webkit-scrollbar-thumb:hover {
    background: linear-gradient(135deg, var(--premium-primary-light), var(--premium-secondary));
}

/* Message Bubbles - Premium Design */
.message-modern {
    display: flex;
    gap: 12px;
    animation: premium-message-in 0.4s cubic-bezier(0.34, 1.56, 0.64, 1);
    max-width: 85%;
}

.message-modern.user {
    align-self: flex-end;
    flex-direction: row-reverse;
}

.message-avatar-modern {
    width: 38px;
    height: 38px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 18px;
    flex-shrink: 0;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
}

.message-modern.bot .message-avatar-modern {
    background: linear-gradient(135deg, var(--premium-primary), var(--premium-accent));
    border: 2px solid rgba(255, 255, 255, 0.2);
}

.message-modern.user .message-avatar-modern {
    background: linear-gradient(135deg, var(--premium-success), #059669);
    border: 2px solid rgba(255, 255, 255, 0.2);
}

.message-content-modern {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.message-bubble-modern {
    padding: 16px 20px;
    border-radius: 20px;
    font-size: 14px;
    line-height: 1.6;
    word-wrap: break-word;
    position: relative;
    backdrop-filter: blur(20px);
}

.message-modern.bot .message-bubble-modern {
    background: linear-gradient(135deg, 
                rgba(255, 255, 255, 0.12) 0%, 
                rgba(255, 255, 255, 0.08) 100%);
    color: var(--premium-text);
    border: 1px solid rgba(255, 255, 255, 0.15);
    border-radius: 20px 20px 20px 6px;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.2),
                inset 0 1px 0 rgba(255, 255, 255, 0.2);
}

.message-modern.user .message-bubble-modern {
    background: linear-gradient(135deg, var(--premium-primary), var(--premium-accent));
    color: white;
    border-radius: 20px 20px 6px 20px;
    box-shadow: 0 8px 24px rgba(99, 102, 241, 0.4);
    border: 1px solid rgba(255, 255, 255, 0.2);
}

.message-time-modern {
    font-size: 11px;
    color: var(--premium-text-dim);
    margin-top: 4px;
    padding: 0 6px;
    font-weight: 500;
}

/* Welcome Message - Premium Style */
.welcome-message-modern {
    text-align: center;
    padding: 40px 24px;
    color: var(--premium-text-secondary);
}

.welcome-message-icon-modern {
    font-size: 72px;
    margin-bottom: 20px;
    background: linear-gradient(135deg, var(--premium-primary), var(--premium-secondary), var(--premium-accent));
    background-clip: text;
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    animation: premium-avatar-float 3s ease-in-out infinite;
    filter: drop-shadow(0 8px 24px rgba(99, 102, 241, 0.4));
}

.welcome-message-modern h4 {
    color: var(--premium-text);
    font-size: 26px;
    font-weight: 700;
    margin: 0 0 10px 0;
    background: linear-gradient(135deg, #fff, var(--premium-primary-light));
    background-clip: text;
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.welcome-message-modern p {
    font-size: 15px;
    margin: 0 0 28px 0;
    color: var(--premium-text-secondary);
    line-height: 1.6;
}

/* Quick Actions - Premium Pills */
.quick-actions-modern {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin-top: 20px;
    justify-content: center;
}

.quick-action-btn-modern {
    padding: 12px 18px;
    background: linear-gradient(135deg, 
                rgba(255, 255, 255, 0.1) 0%, 
                rgba(255, 255, 255, 0.05) 100%);
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.15);
    border-radius: 16px;
    color: var(--premium-text);
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
    display: flex;
    align-items: center;
    gap: 8px;
}

.quick-action-btn-modern:hover {
    background: linear-gradient(135deg, var(--premium-primary), var(--premium-accent));
    transform: translateY(-3px);
    box-shadow: 0 12px 28px rgba(99, 102, 241, 0.4);
    border-color: transparent;
}

.quick-action-btn-modern i {
    font-size: 15px;
}

/* Typing Indicator - Premium Animation */
.typing-indicator-modern {
    display: flex;
    gap: 12px;
    padding: 20px 0;
}

.typing-indicator-modern .message-avatar-modern {
    background: linear-gradient(135deg, var(--premium-primary), var(--premium-accent));
    border: 2px solid rgba(255, 255, 255, 0.2);
}

.typing-dots-modern {
    background: linear-gradient(135deg, 
                rgba(255, 255, 255, 0.12) 0%, 
                rgba(255, 255, 255, 0.08) 100%);
    backdrop-filter: blur(20px);
    border: 1px solid rgba(255, 255, 255, 0.15);
    padding: 16px 24px;
    border-radius: 20px 20px 20px 6px;
    display: flex;
    gap: 8px;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.2);
}

.typing-dot-modern {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    background: var(--premium-primary);
    box-shadow: 0 0 12px rgba(99, 102, 241, 0.6);
    animation: premium-typing 1.4s infinite;
}

.typing-dot-modern:nth-child(2) {
    animation-delay: 0.2s;
}

.typing-dot-modern:nth-child(3) {
    animation-delay: 0.4s;
}

/* Input Area - Premium Glass Design */
.cybersage-modern-input-area {
    padding: 20px 24px 24px;
    background: linear-gradient(135deg, 
                rgba(255, 255, 255, 0.08) 0%, 
                rgba(255, 255, 255, 0.04) 100%);
    backdrop-filter: blur(20px);
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    position: relative;
    z-index: 10;
}

.cybersage-modern-input-wrapper {
    display: flex;
    gap: 12px;
    align-items: flex-start;
}

.cybersage-modern-input-container {
    flex: 1;
    position: relative;
}

.cybersage-modern-input {
    width: 100%;
    padding: 8px 52px 8px 20px;
    background: rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(10px);
    border: 2px solid rgba(255, 255, 255, 0.15);
    border-radius: 20px;
    color: var(--premium-text);
    font-size: 14px;
    font-family: inherit;
    resize: none;
    max-height: 120px;
    height: 60px;
    transition: all 0.3s ease;
    overflow-y: auto;
    line-height: 18px;
    box-sizing: border-box;
}

.cybersage-modern-input::-webkit-scrollbar {
    display: none;
}

.cybersage-modern-input:focus {
    outline: none;
    border-color: var(--premium-primary);
    box-shadow: 0 0 0 4px rgba(99, 102, 241, 0.15),
                0 8px 24px rgba(99, 102, 241, 0.2);
    background: rgba(255, 255, 255, 0.15);
}

.cybersage-modern-input::placeholder {
    color: var(--premium-text-dim);
}

.input-actions-modern {
    position: absolute;
    right: 14px;
    bottom: 14px;
    display: flex;
    gap: 6px;
}

.input-action-btn-modern {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: transparent;
    border: none;
    color: var(--premium-text-dim);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s;
    font-size: 16px;
}

.input-action-btn-modern:hover {
    background: rgba(255, 255, 255, 0.1);
    color: var(--premium-primary);
    transform: scale(1.1);
}

.cybersage-modern-send-btn {
    width: 52px;
    height: 52px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--premium-primary), var(--premium-accent));
    border: none;
    color: white;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 20px;
    transition: all 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
    flex-shrink: 0;
    box-shadow: 0 8px 24px rgba(99, 102, 241, 0.4);
    border: 2px solid rgba(255, 255, 255, 0.2);
}

.cybersage-modern-send-btn:hover:not(:disabled) {
    transform: translateY(-3px) scale(1.1) rotate(15deg);
    box-shadow: 0 12px 32px rgba(99, 102, 241, 0.6);
}

.cybersage-modern-send-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

/* Premium Animations */
@keyframes premium-pulse {
    0%, 100% {
        box-shadow: 0 10px 40px var(--premium-shadow),
                    0 0 0 0 rgba(99, 102, 241, 0.7);
    }
    50% {
        box-shadow: 0 10px 40px var(--premium-shadow),
                    0 0 0 12px rgba(99, 102, 241, 0);
    }
}

@keyframes premium-rotate {
    from {
        transform: rotate(0deg);
    }
    to {
        transform: rotate(360deg);
    }
}

@keyframes premium-bounce {
    0%, 100% {
        transform: translateY(0) scale(1);
    }
    50% {
        transform: translateY(-6px) scale(1.1);
    }
}

@keyframes premium-float {
    0%, 100% {
        transform: translateY(0);
    }
    50% {
        transform: translateY(-10px);
    }
}

@keyframes premium-slideIn {
    from {
        opacity: 0;
        transform: translateY(30px) scale(0.9);
    }
    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

@keyframes premium-gradient {
    0%, 100% {
        opacity: 1;
    }
    50% {
        opacity: 0.8;
    }
}

@keyframes premium-avatar-float {
    0%, 100% {
        transform: translateY(0) rotate(0deg);
    }
    50% {
        transform: translateY(-8px) rotate(5deg);
    }
}

@keyframes premium-pulse-dot {
    0%, 100% {
        transform: scale(1);
        opacity: 1;
    }
    50% {
        transform: scale(1.2);
        opacity: 0.8;
    }
}

@keyframes premium-message-in {
    from {
        opacity: 0;
        transform: translateY(20px) scale(0.95);
    }
    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

@keyframes premium-typing {
    0%, 60%, 100% {
        transform: translateY(0);
        opacity: 0.7;
    }
    30% {
        transform: translateY(-12px);
        opacity: 1;
    }
}

/* Responsive Design */
@media (max-width: 768px) {
    .cybersage-modern-container {
        width: calc(100vw - 32px);
        height: calc(100vh - 80px);
        bottom: 16px;
        right: 16px;
        border-radius: 24px;
    }
    
    .cybersage-modern-btn {
        width: 64px;
        height: 64px;
        bottom: 20px;
        right: 20px;
    }
    
    .cybersage-modern-btn-icon {
        font-size: 30px;
    }
    
    .message-modern {
        max-width: 92%;
    }
}

@media (max-width: 480px) {
    .cybersage-modern-container {
        width: 100%;
        height: 100vh;
        bottom: 0;
        right: 0;
        border-radius: 0;
    }
    
    .quick-actions-modern {
        flex-direction: column;
    }
    
    .quick-action-btn-modern {
        width: 100%;
        justify-content: center;
    }
}

/* Dark Mode Enhancements */
@media (prefers-color-scheme: dark) {
    .cybersage-modern-container {
        box-shadow: 0 30px 90px rgba(0, 0, 0, 0.7),
                    0 0 0 1px rgba(255, 255, 255, 0.15),
                    inset 0 1px 0 rgba(255, 255, 255, 0.2);
    }
}
