/* ===========================
   AI ASSISTANT STYLES
   Lati - Asistente Inteligente
   =========================== */

/* AI Assistant Card in Feed */
.ai-assistant-card {
    background: linear-gradient(135deg, 
        rgba(255, 107, 53, 0.1), 
        rgba(255, 60, 172, 0.1), 
        rgba(120, 75, 160, 0.1));
    border: 2px solid rgba(255, 60, 172, 0.3);
    border-radius: 20px;
    padding: 24px;
    margin-bottom: 24px;
    backdrop-filter: blur(10px);
    box-shadow: 0 8px 32px rgba(255, 60, 172, 0.15);
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
}

.ai-assistant-card::before {
    content: '';
    position: absolute;
    top: -50%;
    right: -50%;
    width: 200%;
    height: 200%;
    background: radial-gradient(circle, rgba(255, 60, 172, 0.1) 0%, transparent 70%);
    animation: aiGlow 6s ease-in-out infinite;
}

@keyframes aiGlow {
    0%, 100% {
        transform: translate(0, 0);
        opacity: 0.5;
    }
    50% {
        transform: translate(-20px, -20px);
        opacity: 0.8;
    }
}

.ai-assistant-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 12px 40px rgba(255, 60, 172, 0.25);
    border-color: rgba(255, 60, 172, 0.5);
}

/* AI Header */
.ai-header {
    display: flex;
    align-items: center;
    gap: 16px;
    margin-bottom: 20px;
    position: relative;
    z-index: 1;
}

.ai-avatar {
    position: relative;
}

.ai-icon {
    width: 60px;
    height: 60px;
    border-radius: 50%;
    background: var(--gradient);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 28px;
    color: white;
    box-shadow: 0 4px 16px rgba(255, 60, 172, 0.4);
    animation: aiPulse 2s ease-in-out infinite;
}

@keyframes aiPulse {
    0%, 100% {
        transform: scale(1);
        box-shadow: 0 4px 16px rgba(255, 60, 172, 0.4);
    }
    50% {
        transform: scale(1.05);
        box-shadow: 0 6px 24px rgba(255, 60, 172, 0.6);
    }
}

.ai-status-dot {
    position: absolute;
    bottom: 4px;
    right: 4px;
    width: 14px;
    height: 14px;
    background: #10B981;
    border: 3px solid var(--bg-card);
    border-radius: 50%;
    animation: aiDotPulse 2s ease-in-out infinite;
}

@keyframes aiDotPulse {
    0%, 100% {
        box-shadow: 0 0 0 0 rgba(16, 185, 129, 0.7);
    }
    50% {
        box-shadow: 0 0 0 6px rgba(16, 185, 129, 0);
    }
}

.ai-info {
    flex: 1;
}

.ai-name {
    font-size: 20px;
    font-weight: 700;
    margin-bottom: 4px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.ai-badge {
    padding: 2px 8px;
    background: var(--gradient);
    color: white;
    border-radius: 6px;
    font-size: 12px;
    font-weight: 600;
}

.ai-subtitle {
    color: var(--text-dim);
    font-size: 14px;
}

.ai-expand-btn {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    border: none;
    background: rgba(255, 255, 255, 0.1);
    color: var(--text-light);
    font-size: 16px;
    cursor: pointer;
    transition: all 0.3s ease;
}

.ai-expand-btn:hover {
    background: rgba(255, 255, 255, 0.2);
    transform: scale(1.1);
}

/* AI Quick Search */
.ai-quick-search {
    margin-bottom: 20px;
    position: relative;
    z-index: 1;
}

.ai-search-input-wrapper {
    position: relative;
    display: flex;
    align-items: center;
}

.ai-search-input-wrapper > i {
    position: absolute;
    left: 16px;
    color: var(--text-dim);
    font-size: 18px;
}

.ai-search-input {
    width: 100%;
    padding: 16px 50px 16px 50px;
    background: rgba(255, 255, 255, 0.08);
    border: 2px solid rgba(255, 255, 255, 0.1);
    border-radius: 16px;
    color: var(--text-light);
    font-size: 16px;
    font-family: 'Inter', sans-serif;
    transition: all 0.3s ease;
}

.ai-search-input:focus {
    outline: none;
    border-color: var(--primary);
    background: rgba(255, 255, 255, 0.12);
    box-shadow: 0 0 0 4px rgba(255, 60, 172, 0.1);
}

.ai-search-input::placeholder {
    color: var(--text-dim);
}

.ai-voice-btn {
    position: absolute;
    right: 8px;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    border: none;
    background: var(--gradient);
    color: white;
    font-size: 16px;
    cursor: pointer;
    transition: all 0.3s ease;
}

.ai-voice-btn:hover {
    transform: scale(1.1);
    box-shadow: 0 4px 12px rgba(255, 60, 172, 0.4);
}

.ai-voice-btn.listening {
    animation: voicePulse 1s ease-in-out infinite;
}

@keyframes voicePulse {
    0%, 100% {
        transform: scale(1);
        box-shadow: 0 0 0 0 rgba(255, 60, 172, 0.7);
    }
    50% {
        transform: scale(1.1);
        box-shadow: 0 0 0 10px rgba(255, 60, 172, 0);
    }
}

/* AI Suggestions */
.ai-suggestions {
    position: relative;
    z-index: 1;
}

.suggestions-label {
    font-size: 13px;
    color: var(--text-dim);
    margin-bottom: 12px;
    font-weight: 600;
}

.suggestions-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
    gap: 10px;
}

.suggestion-chip {
    padding: 12px 16px;
    background: rgba(255, 255, 255, 0.08);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 12px;
    color: var(--text-light);
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    gap: 8px;
    text-align: left;
}

.suggestion-chip i {
    color: var(--primary);
    font-size: 16px;
}

.suggestion-chip:hover {
    background: rgba(255, 60, 172, 0.15);
    border-color: var(--primary);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(255, 60, 172, 0.2);
}

.suggestion-chip:active {
    transform: translateY(0);
}

/* AI Results */
.ai-results {
    margin-top: 20px;
    padding: 20px;
    background: rgba(255, 255, 255, 0.05);
    border-radius: 16px;
    border: 1px solid rgba(255, 255, 255, 0.1);
    animation: slideIn 0.3s ease;
}

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

.ai-result-item {
    padding: 16px;
    background: rgba(255, 255, 255, 0.05);
    border-radius: 12px;
    margin-bottom: 12px;
    border: 1px solid rgba(255, 255, 255, 0.08);
    transition: all 0.3s ease;
    cursor: pointer;
}

.ai-result-item:hover {
    background: rgba(255, 255, 255, 0.1);
    border-color: var(--primary);
    transform: translateX(4px);
}

.ai-result-item:last-child {
    margin-bottom: 0;
}

/* AI Chat Modal */
.ai-chat-container {
    max-width: 700px !important;
    height: 80vh;
    display: flex;
    flex-direction: column;
}

.ai-chat-header {
    display: flex;
    align-items: center;
    gap: 16px;
    padding: 20px 24px;
    border-bottom: 1px solid var(--border);
}

.ai-chat-avatar {
    position: relative;
}

.ai-icon-large {
    width: 50px;
    height: 50px;
    border-radius: 50%;
    background: var(--gradient);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 24px;
    color: white;
    box-shadow: 0 4px 16px rgba(255, 60, 172, 0.4);
}

.ai-status-dot-large {
    position: absolute;
    bottom: 2px;
    right: 2px;
    width: 12px;
    height: 12px;
    background: #10B981;
    border: 2px solid var(--bg-card);
    border-radius: 50%;
}

.ai-chat-info {
    flex: 1;
}

.ai-chat-info h3 {
    font-size: 18px;
    font-weight: 700;
    margin-bottom: 4px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.ai-chat-status {
    color: var(--success);
    font-size: 13px;
}

.ai-chat-body {
    flex: 1;
    overflow-y: auto;
    padding: 24px;
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.ai-chat-body::-webkit-scrollbar {
    width: 6px;
}

.ai-chat-body::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.2);
    border-radius: 3px;
}

/* Welcome Message */
.ai-welcome-message {
    display: flex;
    gap: 12px;
    animation: fadeInUp 0.5s ease;
}

.ai-message-avatar {
    width: 40px;
    height: 40px;
    min-width: 40px;
    border-radius: 50%;
    background: var(--gradient);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 18px;
    color: white;
}

.ai-message-content {
    flex: 1;
    padding: 16px;
    background: rgba(255, 60, 172, 0.1);
    border-radius: 16px;
    border: 1px solid rgba(255, 60, 172, 0.2);
}

.ai-message-content p {
    margin-bottom: 12px;
    line-height: 1.6;
}

.ai-message-content p:last-child {
    margin-bottom: 0;
}

.ai-capabilities {
    list-style: none;
    padding: 0;
    margin: 16px 0;
}

.ai-capabilities li {
    padding: 8px 0;
    display: flex;
    align-items: center;
    gap: 12px;
    color: var(--text-light);
}

.ai-capabilities i {
    color: var(--primary);
    width: 20px;
}

.ai-prompt {
    font-weight: 600;
    color: var(--primary);
    margin-top: 16px !important;
}

/* Chat Messages */
.ai-message {
    display: flex;
    gap: 12px;
    animation: fadeInUp 0.3s ease;
}

.ai-message.user {
    flex-direction: row-reverse;
}

.user-message-content {
    padding: 12px 16px;
    background: var(--gradient);
    border-radius: 16px;
    color: white;
    max-width: 70%;
}

.ai-response-content {
    padding: 12px 16px;
    background: rgba(255, 255, 255, 0.08);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 16px;
    max-width: 70%;
}

.ai-typing-indicator {
    display: flex;
    gap: 4px;
    padding: 16px;
}

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

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

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

@keyframes typing {
    0%, 60%, 100% {
        transform: translateY(0);
        opacity: 0.5;
    }
    30% {
        transform: translateY(-10px);
        opacity: 1;
    }
}

/* Chat Input */
.ai-chat-input-container {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 16px 24px;
    border-top: 1px solid var(--border);
}

.ai-attach-btn,
.ai-voice-chat-btn {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    border: none;
    background: rgba(255, 255, 255, 0.1);
    color: var(--text-light);
    font-size: 16px;
    cursor: pointer;
    transition: all 0.3s ease;
}

.ai-attach-btn:hover,
.ai-voice-chat-btn:hover {
    background: rgba(255, 255, 255, 0.2);
    transform: scale(1.1);
}

.ai-chat-input {
    flex: 1;
    padding: 12px 16px;
    background: rgba(255, 255, 255, 0.08);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 24px;
    color: var(--text-light);
    font-size: 14px;
    font-family: 'Inter', sans-serif;
}

.ai-chat-input:focus {
    outline: none;
    border-color: var(--primary);
    background: rgba(255, 255, 255, 0.12);
}

.ai-send-btn {
    width: 44px;
    height: 44px;
    border-radius: 50%;
    border: none;
    background: var(--gradient);
    color: white;
    font-size: 16px;
    cursor: pointer;
    transition: all 0.3s ease;
}

.ai-send-btn:hover {
    transform: scale(1.1) rotate(15deg);
    box-shadow: 0 4px 16px rgba(255, 60, 172, 0.4);
}

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

/* Chat Suggestions */
.ai-chat-suggestions {
    display: flex;
    gap: 8px;
    padding: 12px 24px;
    overflow-x: auto;
    border-top: 1px solid var(--border);
}

.ai-chat-suggestions::-webkit-scrollbar {
    height: 4px;
}

.ai-chat-suggestions::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.2);
    border-radius: 2px;
}

.ai-suggestion-btn {
    padding: 8px 16px;
    background: rgba(255, 255, 255, 0.08);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 20px;
    color: var(--text-light);
    font-size: 13px;
    white-space: nowrap;
    cursor: pointer;
    transition: all 0.3s ease;
}

.ai-suggestion-btn:hover {
    background: rgba(255, 60, 172, 0.15);
    border-color: var(--primary);
}

/* Responsive */
@media (max-width: 768px) {
    .ai-assistant-card {
        padding: 16px;
        margin-bottom: 16px;
    }

    .ai-icon {
        width: 50px;
        height: 50px;
        font-size: 24px;
    }

    .ai-name {
        font-size: 18px;
    }

    .suggestions-grid {
        grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
        gap: 8px;
    }

    .suggestion-chip {
        padding: 10px 12px;
        font-size: 13px;
    }

    .ai-chat-container {
        height: 90vh;
        max-width: 100% !important;
        border-radius: 0 !important;
    }

    .ai-chat-body {
        padding: 16px;
    }

    .user-message-content,
    .ai-response-content {
        max-width: 85%;
    }
}

@media (max-width: 480px) {
    .ai-search-input {
        font-size: 14px;
        padding: 14px 45px 14px 45px;
    }

    .suggestions-grid {
        grid-template-columns: 1fr;
    }

    .ai-chat-input-container {
        padding: 12px 16px;
    }
}
