/* AI Floating Button */
.ai-fab {
    position: fixed;
    bottom: 28px;
    right: 28px;
    width: 60px;
    height: 60px;
    border-radius: 18px;
    background: linear-gradient(135deg, #f97316, #ea580c);
    border: none;
    color: #fff;
    font-size: 22px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 6px 20px rgba(249, 115, 22, 0.4), 0 2px 8px rgba(0,0,0,0.15);
    transition: all 0.25s;
    z-index: 1000;
}

.ai-fab:hover {
    transform: translateY(-3px) scale(1.05);
    box-shadow: 0 8px 28px rgba(249, 115, 22, 0.5), 0 4px 12px rgba(0,0,0,0.2);
}

.ai-fab:active {
    transform: translateY(0) scale(0.98);
}

.ai-fab-pulse {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    border-radius: 18px;
    border: 2px solid rgba(249, 115, 22, 0.4);
    animation: fabPulse 2.5s ease-in-out infinite;
}

@keyframes fabPulse {
    0%, 100% { transform: scale(1); opacity: 1; }
    50% { transform: scale(1.3); opacity: 0; }
}

/* AI Modal Overlay */
.ai-modal-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.5);
    backdrop-filter: blur(4px);
    display: none;
    align-items: center;
    justify-content: center;
    z-index: 2000;
    opacity: 0;
    transition: opacity 0.25s;
}

.ai-modal-overlay.active {
    display: flex;
    opacity: 1;
}

/* AI Modal */
.ai-modal {
    width: 520px;
    max-width: 95vw;
    max-height: 90vh;
    background: #fff;
    border-radius: 20px;
    box-shadow: 0 24px 80px rgba(0, 0, 0, 0.2), 0 0 0 1px rgba(0, 0, 0, 0.05);
    display: flex;
    flex-direction: column;
    overflow: hidden;
    transform: translateY(20px) scale(0.95);
    transition: transform 0.25s;
}

.ai-modal-overlay.active .ai-modal {
    transform: translateY(0) scale(1);
}

/* Modal Header */
.ai-modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px 24px;
    border-bottom: 1px solid #f1f5f9;
}

.ai-modal-title {
    display: flex;
    align-items: center;
    gap: 12px;
}

.ai-modal-icon {
    width: 40px;
    height: 40px;
    border-radius: 12px;
    background: linear-gradient(135deg, #f97316, #ea580c);
    display: flex;
    align-items: center;
    justify-content: center;
    color: #fff;
    font-size: 16px;
}

.ai-modal-title-text {
    font-size: 16px;
    font-weight: 600;
    color: #1a1d29;
}

.ai-modal-subtitle {
    font-size: 12px;
    color: #8b8e99;
    margin-top: 2px;
}

.ai-modal-close {
    width: 32px;
    height: 32px;
    border-radius: 8px;
    border: none;
    background: #f1f5f9;
    color: #5a5d6b;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.15s;
}

.ai-modal-close:hover {
    background: #e2e8f0;
    color: #1a1d29;
}

/* Examples Section */
.ai-examples-section {
    padding: 16px 24px;
    border-bottom: 1px solid #f1f5f9;
}

.ai-examples-label {
    font-size: 11px;
    font-weight: 600;
    color: #8b8e99;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 10px;
    display: flex;
    align-items: center;
    gap: 5px;
}

.ai-examples-label i {
    color: #fbbf24;
}

.ai-examples-grid {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.ai-example-chip {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 8px 14px;
    border: 1px solid #e2e8f0;
    border-radius: 20px;
    background: #f8fafc;
    color: #475569;
    font-size: 12px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.15s;
    font-family: inherit;
}

.ai-example-chip:hover {
    border-color: #f97316;
    background: #fff7ed;
    color: #ea580c;
}

.ai-example-chip i {
    font-size: 11px;
    color: #8b8e99;
}

.ai-example-chip:hover i {
    color: #f97316;
}

/* Chat Area */
.ai-chat-area {
    flex: 1;
    padding: 20px 24px;
    overflow-y: auto;
    min-height: 150px;
    max-height: 280px;
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.ai-welcome-msg {
    text-align: center;
    padding: 20px;
    color: #8b8e99;
}

.ai-welcome-msg i {
    font-size: 28px;
    color: #f97316;
    margin-bottom: 10px;
    display: block;
}

.ai-welcome-msg p {
    font-size: 13px;
    line-height: 1.6;
}

/* AI Messages */
.ai-message {
    padding: 12px 16px;
    border-radius: 12px;
    font-size: 13px;
    line-height: 1.6;
    animation: msgFade 0.2s;
}

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

/* Score Ring Gradient */
.ring-fill {
    stroke: url(#scoreGradient);
}

@keyframes scoreGradient {
    0% { stop-color: #f97316; }
    100% { stop-color: #ea580c; }
}

.ai-message-user {
    background: linear-gradient(135deg, #f97316, #ea580c);
    color: #fff;
    align-self: flex-end;
    max-width: 85%;
}

.ai-message-ai {
    background: #f1f5f9;
    color: #1a1d29;
    align-self: flex-start;
    max-width: 90%;
}

.ai-message-ai p {
    margin: 6px 0;
}

.ai-message-ai strong {
    color: #f97316;
}

.ai-typing-indicator {
    display: flex;
    gap: 4px;
    padding: 12px 16px;
    background: #f1f5f9;
    border-radius: 12px;
    align-self: flex-start;
}

.ai-typing-dot {
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: #8b8e99;
    animation: typingBounce 1.4s ease-in-out infinite;
}

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

@keyframes typingBounce {
    0%, 60%, 100% { transform: translateY(0); }
    30% { transform: translateY(-6px); }
}

/* Input Area */
.ai-modal-input-area {
    padding: 16px 24px;
    border-top: 1px solid #f1f5f9;
    background: #fafbfc;
}

.ai-input-row {
    display: flex;
    gap: 8px;
    margin-bottom: 8px;
}

.ai-input-row textarea {
    flex: 1;
    padding: 10px 14px;
    border: 1px solid #e2e8f0;
    border-radius: 10px;
    font-size: 13px;
    resize: none;
    font-family: inherit;
    color: #1a1d29;
    min-height: 40px;
    max-height: 120px;
    transition: border-color 0.2s;
}

.ai-input-row textarea:focus {
    outline: none;
    border-color: #f97316;
    box-shadow: 0 0 0 3px rgba(249, 115, 22, 0.1);
}

.ai-send-btn {
    width: 40px;
    height: 40px;
    border-radius: 10px;
    background: linear-gradient(135deg, #f97316, #ea580c);
    border: none;
    color: #fff;
    font-size: 14px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s;
    flex-shrink: 0;
}

.ai-send-btn:hover {
    box-shadow: 0 4px 12px rgba(249, 115, 22, 0.3);
}

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

.ai-task-select {
    width: 100%;
    padding: 8px 12px;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    font-size: 12px;
    background: #fff;
    color: #5a5d6b;
    font-family: inherit;
}

/* Responsive */
@media (max-width: 560px) {
    .ai-modal {
        width: 100vw;
        max-height: 100vh;
        border-radius: 0;
    }
    .ai-fab {
        bottom: 20px;
        right: 20px;
        width: 52px;
        height: 52px;
        font-size: 20px;
    }
}
