/**
 * SkyNova AI Chatbot Styles v2.0
 * Clean, minimal, professional design
 */

/* ============================================
   CHATBOT CONTAINER
   ============================================ */

#skynova-chatbot {
    position: fixed;
    bottom: 20px;
    right: 20px;
    z-index: 9999;
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
}

/* ============================================
   FLOATING TOGGLE BUTTON - Minimal Design
   ============================================ */

.chatbot-toggle {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 8px 14px 8px 10px;
    border: none;
    border-radius: 24px;
    cursor: pointer;
    background: #2563EB;
    color: white;
    box-shadow: 0 2px 12px rgba(37, 99, 235, 0.2);
    transition: all 0.25s ease;
    position: relative;
}

.chatbot-toggle:hover {
    background: #1d4ed8;
    box-shadow: 0 4px 16px rgba(37, 99, 235, 0.3);
    transform: translateY(-1px);
}

.chatbot-toggle:active {
    transform: scale(0.97);
}

.chatbot-toggle svg {
    width: 18px;
    height: 18px;
    flex-shrink: 0;
    transition: all 0.25s ease;
}

.chatbot-toggle-text {
    font-size: 13px;
    font-weight: 600;
    letter-spacing: 0.5px;
}

.chatbot-toggle .close-icon {
    position: absolute;
    left: 10px;
    opacity: 0;
    transform: rotate(-90deg) scale(0.5);
}

.chatbot-toggle.active .chat-icon {
    opacity: 0;
    transform: rotate(90deg) scale(0.5);
}

.chatbot-toggle.active .close-icon {
    opacity: 1;
    transform: rotate(0) scale(1);
}

.chatbot-toggle.active .chatbot-toggle-text {
    opacity: 0;
}

/* ============================================
   CHAT PANEL - Clean & Light
   ============================================ */

.chatbot-panel {
    position: absolute;
    bottom: 60px;
    right: 0;
    width: 360px;
    height: 480px;
    background: #ffffff;
    border-radius: 16px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.12);
    display: flex;
    flex-direction: column;
    overflow: hidden;
    opacity: 0;
    visibility: hidden;
    transform: translateY(12px) scale(0.98);
    transition: all 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
    border: 1px solid rgba(0, 0, 0, 0.06);
}

.chatbot-panel.open {
    opacity: 1;
    visibility: visible;
    transform: translateY(0) scale(1);
}

/* Dark mode */
body:not(.light-mode) .chatbot-panel {
    background: #1e293b;
    border-color: rgba(255, 255, 255, 0.08);
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.25);
}

/* ============================================
   HEADER - Simple & Clean
   ============================================ */

.chatbot-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 14px 16px;
    background: #2563EB;
    color: white;
    border-bottom: none;
}

.chatbot-header-info {
    display: flex;
    align-items: center;
    gap: 10px;
}

.chatbot-avatar {
    width: 32px;
    height: 32px;
    background: rgba(255, 255, 255, 0.15);
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.chatbot-avatar svg {
    width: 18px;
    height: 18px;
    stroke: white;
}

.chatbot-title h3 {
    font-size: 14px;
    font-weight: 600;
    margin: 0;
    line-height: 1.3;
}

.chatbot-close {
    width: 28px;
    height: 28px;
    border: none;
    background: rgba(255, 255, 255, 0.12);
    border-radius: 8px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
}

.chatbot-close:hover {
    background: rgba(255, 255, 255, 0.2);
}

.chatbot-close svg {
    width: 16px;
    height: 16px;
    stroke: white;
}

/* ============================================
   MESSAGES AREA - Spacious
   ============================================ */

.chatbot-messages {
    flex: 1;
    overflow-y: auto;
    padding: 20px 16px;
    display: flex;
    flex-direction: column;
    gap: 16px;
    scroll-behavior: smooth;
    background: #f8fafc;
}

body:not(.light-mode) .chatbot-messages {
    background: #0f172a;
}

.chatbot-messages::-webkit-scrollbar {
    width: 4px;
}

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

.chatbot-messages::-webkit-scrollbar-thumb {
    background: #cbd5e1;
    border-radius: 10px;
}

body:not(.light-mode) .chatbot-messages::-webkit-scrollbar-thumb {
    background: #334155;
}

/* ============================================
   MESSAGE BUBBLES - Clean & Modern
   ============================================ */

.chatbot-message {
    display: flex;
    max-width: 88%;
    animation: messageSlide 0.25s ease;
}

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

.chatbot-message.user {
    align-self: flex-end;
}

.chatbot-message.bot {
    align-self: flex-start;
}

.message-content {
    padding: 10px 14px;
    border-radius: 14px;
    position: relative;
}

.chatbot-message.user .message-content {
    background: #2563EB;
    color: white;
    border-bottom-right-radius: 4px;
}

.chatbot-message.bot .message-content {
    background: #ffffff;
    color: #0f172a;
    border-bottom-left-radius: 4px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.06);
}

body:not(.light-mode) .chatbot-message.bot .message-content {
    background: #1e293b;
    color: #f1f5f9;
    box-shadow: none;
    border: 1px solid rgba(255, 255, 255, 0.06);
}

.message-content p {
    margin: 0;
    font-size: 14px;
    line-height: 1.55;
    word-wrap: break-word;
}

.message-time {
    display: none; /* Hide time for cleaner look */
}

/* ============================================
   TYPING INDICATOR - Subtle
   ============================================ */

.chatbot-typing {
    display: none;
    align-items: center;
    gap: 4px;
    padding: 8px 16px;
    background: #f8fafc;
}

body:not(.light-mode) .chatbot-typing {
    background: #0f172a;
}

.chatbot-typing.active {
    display: flex;
}

.chatbot-typing span {
    width: 6px;
    height: 6px;
    background: #2563EB;
    border-radius: 50%;
    animation: typingBounce 1.2s infinite ease-in-out;
}

.chatbot-typing span:nth-child(1) { animation-delay: 0s; }
.chatbot-typing span:nth-child(2) { animation-delay: 0.15s; }
.chatbot-typing span:nth-child(3) { animation-delay: 0.3s; }

@keyframes typingBounce {
    0%, 80%, 100% {
        transform: scale(0.85);
        opacity: 0.4;
    }
    40% {
        transform: scale(1.1);
        opacity: 1;
    }
}

/* ============================================
   INPUT AREA - Clean
   ============================================ */

.chatbot-input-area {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 12px 16px;
    background: #ffffff;
    border-top: 1px solid #e2e8f0;
}

body:not(.light-mode) .chatbot-input-area {
    background: #1e293b;
    border-top-color: rgba(255, 255, 255, 0.06);
}

.chatbot-input {
    flex: 1;
    padding: 10px 14px;
    border: 1px solid #e2e8f0;
    border-radius: 12px;
    background: #f8fafc;
    color: #0f172a;
    font-size: 14px;
    font-family: inherit;
    outline: none;
    transition: all 0.2s ease;
}

.chatbot-input::placeholder {
    color: #94a3b8;
}

.chatbot-input:focus {
    border-color: #2563EB;
    background: #ffffff;
}

body:not(.light-mode) .chatbot-input {
    background: #0f172a;
    border-color: #334155;
    color: #f1f5f9;
}

body:not(.light-mode) .chatbot-input::placeholder {
    color: #64748b;
}

body:not(.light-mode) .chatbot-input:focus {
    border-color: #3b82f6;
    background: #0f172a;
}

.chatbot-send {
    width: 38px;
    height: 38px;
    border: none;
    background: #2563EB;
    border-radius: 10px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
    flex-shrink: 0;
}

.chatbot-send:hover {
    background: #1d4ed8;
}

.chatbot-send:active {
    transform: scale(0.95);
}

.chatbot-send svg {
    width: 16px;
    height: 16px;
    stroke: white;
    margin-left: 1px;
}

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

@media (max-width: 480px) {
    #skynova-chatbot {
        bottom: 12px;
        right: 12px;
    }

    .chatbot-toggle {
        padding: 7px 12px 7px 8px;
        gap: 5px;
    }

    .chatbot-toggle svg {
        width: 16px;
        height: 16px;
    }

    .chatbot-toggle-text {
        font-size: 12px;
    }

    .chatbot-panel {
        width: calc(100vw - 24px);
        height: calc(100vh - 100px);
        max-height: 500px;
        right: 0;
        bottom: 52px;
        border-radius: 14px;
    }

    .chatbot-header {
        padding: 12px 14px;
    }

    .chatbot-title h3 {
        font-size: 13px;
    }

    .chatbot-messages {
        padding: 16px 12px;
        gap: 14px;
    }

    .chatbot-input-area {
        padding: 10px 12px;
        gap: 6px;
    }

    .chatbot-input {
        padding: 9px 12px;
        font-size: 13px;
    }

    .chatbot-send {
        width: 36px;
        height: 36px;
    }
}

/* ============================================
   ACCESSIBILITY
   ============================================ */

.chatbot-toggle:focus-visible,
.chatbot-close:focus-visible,
.chatbot-send:focus-visible {
    outline: 2px solid #3b82f6;
    outline-offset: 2px;
}

/* Reduced motion preference */
@media (prefers-reduced-motion: reduce) {
    .chatbot-panel,
    .chatbot-toggle,
    .chatbot-message,
    .chatbot-typing span {
        transition: none;
        animation: none;
    }
}
