/* ============================================
   AI ASSISTANT STYLES
   ============================================ */

/* AI Floating Button */
.ai-assistant-trigger {
    position: fixed;
    bottom: 100px;
    right: 30px;
    width: 60px;
    height: 60px;
    border-radius: 50%;
    background: linear-gradient(135deg, #8b5cf6 0%, #ec4899 100%);
    border: none;
    box-shadow: 0 4px 12px rgba(139, 92, 246, 0.3);
    cursor: pointer;
    z-index: 999;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    transition: all 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}

.ai-assistant-trigger:hover {
    transform: scale(1.1) rotate(5deg);
    box-shadow: 0 6px 20px rgba(139, 92, 246, 0.5);
}

.ai-tooltip {
    position: absolute;
    right: 70px;
    background: #1c1c22;
    color: #f4f4f5;
    padding: 8px 16px;
    border-radius: 6px;
    font-size: 0.85rem;
    font-weight: 500;
    white-space: nowrap;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
    border: 1px solid rgba(255, 255, 255, 0.12);
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.8);
}

.ai-assistant-trigger:hover .ai-tooltip {
    opacity: 1;
    visibility: visible;
    right: 75px;
}

/* AI Modal */
.ai-modal {
    position: fixed;
    inset: 0;
    z-index: 10000;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 1.5rem;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
}

.ai-modal.active {
    opacity: 1;
    visibility: visible;
}

.ai-modal-overlay {
    position: absolute;
    inset: 0;
    background: rgba(5, 5, 7, 0.85);
    backdrop-filter: blur(20px) saturate(180%);
}

.ai-modal-content {
    position: relative;
    width: 100%;
    max-width: 700px;
    max-height: 90vh;
    background: #141418;
    border: 1px solid rgba(255, 255, 255, 0.12);
    border-radius: 32px;
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.8);
    overflow: hidden;
    display: flex;
    flex-direction: column;
    transform: scale(0.95) translateY(20px);
    transition: transform 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}

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

.ai-modal-close {
    position: absolute;
    top: 1rem;
    right: 1rem;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.06);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #71717a;
    transition: all 0.15s ease;
    z-index: 1;
}

.ai-modal-close:hover {
    background: rgba(255, 255, 255, 0.1);
    color: #f4f4f5;
    transform: rotate(90deg);
}

/* AI Modal Header */
.ai-modal-header {
    background: linear-gradient(135deg, rgba(139, 92, 246, 0.15) 0%, rgba(236, 72, 153, 0.1) 100%);
    padding: 2rem;
    text-align: center;
    border-bottom: 1px solid rgba(255, 255, 255, 0.06);
}

.ai-icon {
    width: 64px;
    height: 64px;
    margin: 0 auto 1rem;
    border-radius: 50%;
    background: linear-gradient(135deg, #8b5cf6 0%, #ec4899 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    box-shadow: 0 8px 24px rgba(139, 92, 246, 0.3);
    animation: pulse-glow 3s ease-in-out infinite;
}

@keyframes pulse-glow {

    0%,
    100% {
        box-shadow: 0 8px 24px rgba(139, 92, 246, 0.3);
    }

    50% {
        box-shadow: 0 8px 32px rgba(139, 92, 246, 0.5);
    }
}

.ai-modal-header h3 {
    font-size: 1.5rem;
    margin-bottom: 0.5rem;
    background: linear-gradient(135deg, #8b5cf6 0%, #ec4899 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.ai-modal-header p {
    color: #a1a1aa;
    font-size: 0.95rem;
}

/* AI Modal Body */
.ai-modal-body {
    padding: 2rem;
    overflow-y: auto;
    flex: 1;
}

.ai-input-section label {
    display: block;
    font-weight: 600;
    margin-bottom: 0.75rem;
    color: #f4f4f5;
    font-size: 0.95rem;
}

.ai-input-section textarea {
    width: 100%;
    background: #0c0c10;
    border: 1px solid rgba(255, 255, 255, 0.12);
    border-radius: 12px;
    padding: 1rem;
    color: #f4f4f5;
    font-family: inherit;
    font-size: 0.95rem;
    line-height: 1.6;
    resize: vertical;
    min-height: 120px;
    transition: all 0.15s ease;
}

.ai-input-section textarea:focus {
    outline: none;
    border-color: #8b5cf6;
    box-shadow: 0 0 0 3px rgba(139, 92, 246, 0.1);
}

.ai-input-section textarea::placeholder {
    color: #71717a;
}

.ai-input-footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-top: 1rem;
    flex-wrap: wrap;
    gap: 1rem;
}

.char-count {
    font-size: 0.8rem;
    color: #71717a;
    font-weight: 500;
}

/* AI Suggestions Section */
.ai-suggestions-section {
    margin-top: 2rem;
    padding-top: 2rem;
    border-top: 1px solid rgba(255, 255, 255, 0.06);
}

.ai-loading {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 3rem 1.5rem;
    gap: 1rem;
}

.loading-spinner {
    width: 48px;
    height: 48px;
    border: 4px solid rgba(139, 92, 246, 0.2);
    border-top-color: #8b5cf6;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    to {
        transform: rotate(360deg);
    }
}

.ai-loading p {
    color: #a1a1aa;
    font-size: 0.95rem;
}

/* AI Results */
.ai-results-header {
    margin-bottom: 1.5rem;
}

.ai-results-header h4 {
    font-size: 1.25rem;
    margin-bottom: 0.5rem;
}

.ai-results-content {
    background: #0c0c10;
    border: 1px solid rgba(255, 255, 255, 0.06);
    border-radius: 12px;
    padding: 1.5rem;
    margin-bottom: 1.5rem;
    line-height: 1.8;
}

.ai-results-content p {
    margin-bottom: 1rem;
    color: #a1a1aa;
}

.ai-results-content ul {
    margin-left: 1.5rem;
    margin-bottom: 1rem;
}

.ai-results-content li {
    margin-bottom: 0.75rem;
    color: #a1a1aa;
}

.ai-results-content strong {
    color: #f4f4f5;
    font-weight: 600;
}

.ai-results-content em {
    color: #fbbf24;
    font-style: normal;
}

.ai-results-footer {
    display: flex;
    gap: 1rem;
    flex-wrap: wrap;
}

/* AI Error */
.ai-error {
    text-align: center;
    padding: 3rem 1.5rem;
}

.error-icon {
    font-size: 3rem;
    margin-bottom: 1rem;
}

.ai-error h4 {
    font-size: 1.25rem;
    margin-bottom: 0.75rem;
    color: #ef4444;
}

.ai-error p {
    color: #a1a1aa;
    margin-bottom: 1.5rem;
}

/* Responsive Design */
@media (max-width: 768px) {
    .ai-assistant-trigger {
        bottom: 85px;
        right: 20px;
        width: 50px;
        height: 50px;
    }

    .ai-modal {
        padding: 1rem;
    }

    .ai-modal-content {
        max-height: 95vh;
    }

    .ai-modal-header,
    .ai-modal-body {
        padding: 1.5rem;
    }

    .ai-input-footer {
        flex-direction: column;
        align-items: stretch;
    }

    .ai-results-footer {
        flex-direction: column;
    }
}