/* AI Chat Floating Widget Styles - HR Developer */
:root {
    --ai-primary: #4f46e5;
    --ai-primary-hover: #4338ca;
    --ai-bg-light: #ffffff;
    --ai-bg-dark: #0f172a;
    --ai-card-light: #f8fafc;
    --ai-card-dark: #1e293b;
    --ai-text-light: #1e293b;
    --ai-text-dark: #f8fafc;
    --ai-border-light: #e2e8f0;
    --ai-border-dark: #334155;
    --ai-radius: 16px;
    --ai-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.15), 0 8px 10px -6px rgba(0, 0, 0, 0.1);
}

/* Floating Action Button */
.ai-fab-button {
    position: fixed;
    bottom: 24px;
    right: 24px;
    width: 60px;
    height: 60px;
    border-radius: 30px;
    background: linear-gradient(135deg, #0d9488 0%, #0f766e 100%);
    color: #ffffff;
    border: none;
    box-shadow: 0 10px 25px -5px rgba(13, 148, 136, 0.5), 0 8px 10px -6px rgba(13, 148, 136, 0.3);
    cursor: pointer;
    z-index: 99999;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: transform 0.3s cubic-bezier(0.34, 1.56, 0.64, 1), box-shadow 0.3s ease;
    outline: none;
}

.ai-fab-button:hover {
    transform: scale(1.1) rotate(5deg);
    box-shadow: 0 15px 30px -5px rgba(13, 148, 136, 0.6);
}

.ai-fab-button svg {
    width: 28px;
    height: 28px;
    fill: currentColor;
    transition: transform 0.3s ease;
}

.ai-fab-badge {
    position: absolute;
    top: -2px;
    right: -2px;
    background: #059669;
    color: white;
    font-size: 11px;
    font-weight: bold;
    padding: 2px 6px;
    border-radius: 10px;
    border: 2px solid white;
    animation: pulse-badge 2s infinite;
}

@keyframes pulse-badge {
    0% { transform: scale(1); }
    50% { transform: scale(1.15); }
    100% { transform: scale(1); }
}

/* Floating Window Container */
.ai-widget-container {
    position: fixed;
    bottom: 96px;
    right: 24px;
    width: 380px;
    max-width: calc(100vw - 32px);
    height: 540px;
    max-height: calc(100vh - 120px);
    background: #ffffff;
    border-radius: var(--ai-radius);
    box-shadow: var(--ai-shadow);
    z-index: 99998;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    opacity: 0;
    visibility: hidden;
    transform: translateY(20px) scale(0.95);
    transition: all 0.3s cubic-bezier(0.16, 1, 0.3, 1);
    border: 1px solid var(--ai-border-light);
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
}

.ai-widget-container.active {
    opacity: 1;
    visibility: visible;
    transform: translateY(0) scale(1);
}

/* Header */
.ai-widget-header {
    background: linear-gradient(135deg, #1e1b4b 0%, #312e81 50%, #4338ca 100%);
    color: #ffffff;
    padding: 14px 18px;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.ai-widget-header-title {
    display: flex;
    align-items: center;
    gap: 10px;
}

.ai-widget-header-title h4 {
    margin: 0;
    font-size: 16px;
    font-weight: 600;
    color: #ffffff;
    line-height: 1.2;
}

.ai-widget-header-title p {
    margin: 2px 0 0 0;
    font-size: 11px;
    color: #a5b4fc;
}

.ai-avatar-icon {
    width: 36px;
    height: 36px;
    background: rgba(255, 255, 255, 0.15);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 18px;
    backdrop-filter: blur(4px);
}

.ai-widget-actions {
    display: flex;
    align-items: center;
    gap: 6px;
}

.ai-btn-icon {
    background: transparent;
    border: none;
    color: #c7d2fe;
    width: 30px;
    height: 30px;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.2s, color 0.2s;
}

.ai-btn-icon:hover {
    background: rgba(255, 255, 255, 0.2);
    color: #ffffff;
}

/* Body / Chat Stream */
.ai-widget-body {
    flex: 1;
    padding: 16px;
    overflow-y: auto;
    background: #f8fafc;
    display: flex;
    flex-direction: column;
    gap: 12px;
}

/* Quick Prompts Chip Bar */
.ai-quick-chips {
    display: flex;
    gap: 8px;
    overflow-x: auto;
    padding-bottom: 6px;
    scrollbar-width: thin;
}

.ai-chip {
    white-space: nowrap;
    background: #ffffff;
    border: 1px solid #cbd5e1;
    color: #475569;
    padding: 5px 12px;
    border-radius: 14px;
    font-size: 12px;
    cursor: pointer;
    transition: all 0.2s ease;
    font-weight: 500;
}

.ai-chip:hover {
    background: #4f46e5;
    color: #ffffff;
    border-color: #4f46e5;
    transform: translateY(-1px);
}

/* Messages */
.ai-msg {
    display: flex;
    gap: 8px;
    max-width: 88%;
    animation: fadeInMsg 0.3s ease;
}

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

.ai-msg.user {
    align-self: flex-end;
    flex-direction: row-reverse;
}

.ai-msg.bot {
    align-self: flex-start;
}

.ai-msg-bubble {
    padding: 10px 14px;
    border-radius: 16px;
    font-size: 13.5px;
    line-height: 1.5;
    word-break: break-word;
}

.ai-msg.user .ai-msg-bubble {
    background: linear-gradient(135deg, #4f46e5 0%, #4338ca 100%);
    color: #ffffff;
    border-bottom-right-radius: 4px;
}

.ai-msg.bot .ai-msg-bubble {
    background: #ffffff;
    color: #1e293b;
    border: 1px solid #e2e8f0;
    border-bottom-left-radius: 4px;
    box-shadow: 0 1px 3px rgba(0,0,0,0.05);
}

.ai-msg-bubble code {
    background: #f1f5f9;
    color: #d97706;
    padding: 2px 5px;
    border-radius: 4px;
    font-family: monospace;
    font-size: 12px;
}

.ai-msg-bubble pre {
    background: #0f172a;
    color: #f8fafc;
    padding: 10px;
    border-radius: 8px;
    overflow-x: auto;
    font-size: 12px;
    margin: 8px 0;
}

.ai-msg-bubble pre code {
    background: transparent;
    color: inherit;
    padding: 0;
}

/* Typing Indicator */
.ai-typing {
    display: flex;
    align-items: center;
    gap: 4px;
    padding: 8px 12px;
    background: #ffffff;
    border-radius: 16px;
    border: 1px solid #e2e8f0;
    width: fit-content;
}

.ai-typing span {
    width: 6px;
    height: 6px;
    background: #94a3b8;
    border-radius: 50%;
    animation: typing 1.4s infinite ease-in-out both;
}

.ai-typing span:nth-child(1) { animation-delay: -0.32s; }
.ai-typing span:nth-child(2) { animation-delay: -0.16s; }

@keyframes typing {
    0%, 80%, 100% { transform: scale(0); }
    40% { transform: scale(1); }
}

/* Footer / Input Bar */
.ai-widget-footer {
    padding: 10px 14px;
    background: #ffffff;
    border-top: 1px solid var(--ai-border-light);
    display: flex;
    align-items: center;
    gap: 8px;
}

.ai-widget-input {
    flex: 1;
    border: 1px solid #cbd5e1;
    border-radius: 20px;
    padding: 8px 14px;
    font-size: 13.5px;
    outline: none;
    transition: border-color 0.2s;
    background: #f8fafc;
}

.ai-widget-input:focus {
    border-color: #4f46e5;
    background: #ffffff;
}

.ai-send-btn {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: #4f46e5;
    color: white;
    border: none;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.2s, transform 0.2s;
}

.ai-send-btn:hover {
    background: #4338ca;
    transform: scale(1.05);
}

.ai-send-btn:disabled {
    background: #cbd5e1;
    cursor: not-allowed;
    transform: none;
}

/* Settings Modal Inside Widget */
.ai-settings-panel {
    position: absolute;
    top: 60px;
    left: 0;
    right: 0;
    bottom: 0;
    background: #ffffff;
    z-index: 10;
    padding: 20px;
    display: none;
    flex-direction: column;
    gap: 16px;
    overflow-y: auto;
}

.ai-settings-panel.active {
    display: flex;
}

.ai-settings-panel h5 {
    margin: 0 0 8px 0;
    font-size: 15px;
    font-weight: 600;
    color: #1e293b;
}

.ai-settings-panel label {
    font-size: 12px;
    font-weight: 600;
    color: #64748b;
    margin-bottom: 4px;
    display: block;
}

.ai-settings-panel input[type="text"] {
    width: 100%;
    padding: 8px 12px;
    border: 1px solid #cbd5e1;
    border-radius: 8px;
    font-size: 13px;
    box-sizing: border-box;
}

/* Mobile Responsive */
@media (max-width: 480px) {
    .ai-widget-container {
        right: 12px;
        left: 12px;
        width: auto;
        bottom: 84px;
        height: 75vh;
    }
    .ai-fab-button {
        bottom: 16px;
        right: 16px;
    }
}
