/**
 * Ariel Help Widget - Floating Assistant
 * Future Is Now System Assistant
 */

/* ===== WIDGET CONTAINER ===== */
.ariel-widget {
    position: fixed;
    bottom: 24px;
    right: 24px;
    z-index: 10000;
    font-family: 'Segoe UI', system-ui, -apple-system, sans-serif;
}

/* ===== FLOATING BUTTON ===== */
.ariel-trigger {
    width: 50px;
    border-radius: 14px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border: none;
    cursor: pointer;
    box-shadow: 0 4px 20px rgba(102, 126, 234, 0.4);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 8px 4px 6px;
    gap: 2px;
    transition: all 0.3s ease;
    position: relative;
}

.ariel-trigger:hover {
    transform: scale(1.1);
    box-shadow: 0 6px 25px rgba(102, 126, 234, 0.5);
}

.ariel-trigger:active {
    transform: scale(0.95);
}

.ariel-trigger-icon {
    font-size: 22px;
    color: white;
    line-height: 1;
    transition: transform 0.3s ease;
}

.ariel-trigger-label {
    font-size: 9px;
    font-weight: 600;
    color: white;
    letter-spacing: 0.3px;
    text-transform: uppercase;
}

.ariel-widget.open .ariel-trigger-icon {
    transform: rotate(45deg);
}

/* Pulse animation when closed */
.ariel-trigger::before {
    content: '';
    position: absolute;
    width: 100%;
    height: 100%;
    border-radius: 50%;
    background: inherit;
    animation: ariel-pulse 2s infinite;
    z-index: -1;
}

@keyframes ariel-pulse {
    0% {
        transform: scale(1);
        opacity: 0.5;
    }
    100% {
        transform: scale(1.5);
        opacity: 0;
    }
}

.ariel-widget.open .ariel-trigger::before {
    animation: none;
}

/* Notification badge */
.ariel-badge {
    position: absolute;
    top: -2px;
    right: -2px;
    width: 18px;
    height: 18px;
    background: #ff4757;
    border-radius: 50%;
    font-size: 11px;
    font-weight: bold;
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    transform: scale(0);
    transition: all 0.3s ease;
}

.ariel-badge.show {
    opacity: 1;
    transform: scale(1);
}

/* ===== CHAT PANEL ===== */
.ariel-panel {
    position: fixed;
    bottom: 90px;
    right: 24px;
    width: 380px;
    max-height: calc(100vh - 120px);
    background: #1a1a2e;
    border-radius: 16px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.3);
    display: flex;
    flex-direction: column;
    overflow: hidden;
    opacity: 0;
    transform: translateY(20px) scale(0.95);
    pointer-events: none;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.ariel-widget.open .ariel-panel {
    opacity: 1;
    transform: translateY(0) scale(1);
    pointer-events: all;
}

/* ===== HEADER ===== */
.ariel-header {
    padding: 16px 20px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    display: flex;
    align-items: center;
    gap: 12px;
}

.ariel-avatar {
    width: 44px;
    height: 44px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.2);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 24px;
}

.ariel-info h3 {
    margin: 0;
    font-size: 16px;
    font-weight: 600;
    color: white;
}

.ariel-info p {
    margin: 2px 0 0;
    font-size: 12px;
    color: rgba(255, 255, 255, 0.8);
}

.ariel-status {
    display: inline-flex;
    align-items: center;
    gap: 4px;
}

.ariel-status-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: #2ecc71;
    animation: ariel-blink 2s infinite;
}

@keyframes ariel-blink {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.5; }
}

.ariel-close {
    margin-left: auto;
    background: rgba(255, 255, 255, 0.2);
    border: none;
    width: 32px;
    height: 32px;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 22px;
    font-weight: bold;
    line-height: 1;
    transition: background 0.2s;
}

.ariel-close:hover {
    background: rgba(255, 255, 255, 0.3);
}

/* ===== QUICK ACTIONS ===== */
.ariel-quick-actions {
    padding: 12px 16px;
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    background: rgba(0, 0, 0, 0.2);
}

.ariel-quick-btn {
    padding: 6px 12px;
    background: rgba(102, 126, 234, 0.2);
    border: 1px solid rgba(102, 126, 234, 0.3);
    border-radius: 20px;
    color: #a0aec0;
    font-size: 12px;
    cursor: pointer;
    transition: all 0.2s;
    display: flex;
    align-items: center;
    gap: 4px;
}

.ariel-quick-btn:hover {
    background: rgba(102, 126, 234, 0.4);
    color: white;
    border-color: rgba(102, 126, 234, 0.6);
}

.ariel-quick-btn .material-icons-round {
    font-size: 14px;
}

/* ===== MESSAGES AREA ===== */
.ariel-messages {
    flex: 1;
    overflow-y: auto;
    padding: 16px;
    display: flex;
    flex-direction: column;
    gap: 12px;
    min-height: 200px;
    max-height: 400px;
}

.ariel-message {
    display: flex;
    gap: 8px;
    max-width: 85%;
    animation: ariel-fadeIn 0.3s ease;
}

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

.ariel-message.ariel {
    align-self: flex-start;
}

.ariel-message.user {
    align-self: flex-end;
    flex-direction: row-reverse;
}

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

.ariel-message.ariel .ariel-message-avatar {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
}

.ariel-message.user .ariel-message-avatar {
    background: #4a5568;
}

.ariel-message-bubble {
    padding: 10px 14px;
    border-radius: 16px;
    font-size: 14px;
    line-height: 1.5;
    word-wrap: break-word;
    overflow-wrap: break-word;
    max-width: 100%;
}

.ariel-message.ariel .ariel-message-bubble {
    background: #2d3748;
    color: #e2e8f0;
    border-bottom-left-radius: 4px;
}

.ariel-message.user .ariel-message-bubble {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border-bottom-right-radius: 4px;
}

/* Typing indicator */
.ariel-typing {
    display: flex;
    gap: 4px;
    padding: 10px 14px;
}

.ariel-typing span {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: #667eea;
    animation: ariel-typing 1.4s infinite ease-in-out;
}

.ariel-typing span:nth-child(2) { animation-delay: 0.2s; }
.ariel-typing span:nth-child(3) { animation-delay: 0.4s; }

@keyframes ariel-typing {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-6px); }
}

/* ===== INPUT AREA ===== */
.ariel-input-area {
    padding: 16px;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    display: flex;
    gap: 10px;
    background: rgba(0, 0, 0, 0.2);
}

.ariel-input {
    flex: 1;
    background: #2d3748;
    border: 1px solid #4a5568;
    border-radius: 24px;
    padding: 10px 16px;
    color: white;
    font-size: 14px;
    outline: none;
    transition: border-color 0.2s;
}

.ariel-input:focus {
    border-color: #667eea;
}

.ariel-input::placeholder {
    color: #718096;
}

.ariel-send {
    width: 44px;
    height: 44px;
    border-radius: 50%;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border: none;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    transition: transform 0.2s, opacity 0.2s;
}

.ariel-send:hover {
    transform: scale(1.05);
}

.ariel-send:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.ariel-send .material-icons-round {
    font-size: 20px;
}

/* ===== WELCOME MESSAGE ===== */
.ariel-welcome {
    text-align: center;
    padding: 20px;
    color: #a0aec0;
}

.ariel-welcome-emoji {
    font-size: 48px;
    margin-bottom: 12px;
}

.ariel-welcome h4 {
    margin: 0 0 8px;
    color: #e2e8f0;
    font-size: 16px;
}

.ariel-welcome p {
    margin: 0;
    font-size: 13px;
    line-height: 1.5;
}

/* ===== SUGGESTIONS ===== */
.ariel-suggestions {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    margin-top: 10px;
}

.ariel-suggestion {
    padding: 6px 12px;
    background: rgba(102, 126, 234, 0.15);
    border: 1px solid rgba(102, 126, 234, 0.3);
    border-radius: 16px;
    color: #a0aec0;
    font-size: 12px;
    cursor: pointer;
    transition: all 0.2s;
}

.ariel-suggestion:hover {
    background: rgba(102, 126, 234, 0.3);
    color: white;
}

/* ===== SCROLLBAR ===== */
.ariel-messages::-webkit-scrollbar {
    width: 6px;
}

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

.ariel-messages::-webkit-scrollbar-thumb {
    background: #4a5568;
    border-radius: 3px;
}

.ariel-messages::-webkit-scrollbar-thumb:hover {
    background: #667eea;
}

/* ===== RESPONSIVE ===== */
@media (max-width: 480px) {
    .ariel-widget {
        bottom: 16px;
        right: 16px;
    }

    .ariel-panel {
        width: calc(100vw - 32px);
        max-height: calc(100vh - 100px);
        right: 16px;
        bottom: 80px;
    }

    .ariel-trigger {
        width: 54px;
        height: 54px;
    }
}

/* ===== DARK/LIGHT MODE ===== */
@media (prefers-color-scheme: light) {
    .ariel-panel {
        background: #ffffff;
    }

    .ariel-message.ariel .ariel-message-bubble {
        background: #f1f5f9;
        color: #1e293b;
    }

    .ariel-input {
        background: #f1f5f9;
        border-color: #e2e8f0;
        color: #1e293b;
    }

    .ariel-input-area {
        background: #f8fafc;
    }

    .ariel-quick-actions {
        background: #f8fafc;
        border-color: #e2e8f0;
    }
}
