/**
 * ================================================================================
 * KOMICO - AI Smart Replies CSS
 * ================================================================================
 * 
 * Styles for AI-powered smart reply suggestions on comments/replies
 * 
 * ================================================================================
 */

/* Smart Replies Container */
.ai-smart-replies {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin-bottom: 20px;
    padding: 0;
    animation: slideInUp 0.3s ease-out;
    width: 100%;
}

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

/* Individual Smart Reply Chip */
.ai-smart-reply-chip {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 10px 20px;
    background: var(--km-secondary-bg-color);
    border: 1px solid var(--km-primary-border-color);
    border-radius: 50px;
    font-size: 14px;
    font-weight: 400;
    color: var(--km-primary-text-color);
    cursor: pointer;
    transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
    user-select: none;
    white-space: normal;
    word-wrap: break-word;
    word-break: break-word;
    max-width: 100%;
    text-align: center;
    outline: none;
    box-shadow: none;
    line-height: 1.4;
}

.ai-smart-reply-chip:hover {
    background: var(--km-primary-color);
    color: #ffffff;
    border-color: var(--km-primary-color);
    transform: translateY(-2px) scale(1.02);
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.12);
}

.ai-smart-reply-chip:active {
    transform: translateY(0) scale(0.98);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
}

.ai-smart-reply-chip:focus {
    outline: 2px solid var(--km-primary-color);
    outline-offset: 2px;
}

/* Loading State */
.ai-smart-replies.loading {
    opacity: 0.6;
    pointer-events: none;
}

.ai-smart-replies.loading .ai-smart-reply-chip {
    animation: pulse 1.5s ease-in-out infinite;
}

@keyframes pulse {
    0%, 100% {
        opacity: 1;
    }
    50% {
        opacity: 0.5;
    }
}

/* Smart Reply Icon (optional) */
.ai-smart-reply-chip svg {
    width: 14px;
    height: 14px;
    margin-right: 6px;
    fill: currentColor;
}

/* Dark Mode Support */
body[data-bg="dark"] .ai-smart-reply-chip {
    background: rgba(255, 255, 255, 0.08);
    border-color: rgba(255, 255, 255, 0.15);
    color: rgba(255, 255, 255, 0.9);
}

body[data-bg="dark"] .ai-smart-reply-chip:hover {
    background: var(--km-primary-color);
    border-color: var(--km-primary-color);
    color: #ffffff;
}

/* Light Mode Enhancement */
body[data-bg="default"] .ai-smart-reply-chip {
    background: #f5f8fa;
    border-color: #e1e8ed;
}

body[data-bg="default"] .ai-smart-reply-chip:hover {
    background: var(--km-primary-color);
    border-color: var(--km-primary-color);
}

/* Disabled State */
.ai-smart-replies.disabled {
    display: none;
}

/* Responsive Design */
@media (max-width: 768px) {
    .ai-smart-replies {
        gap: 8px;
        margin-bottom: 15px;
    }

    .ai-smart-reply-chip {
        padding: 8px 16px;
        font-size: 13px;
    }
}

@media (max-width: 480px) {
    .ai-smart-replies {
        gap: 6px;
        margin-bottom: 12px;
    }

    .ai-smart-reply-chip {
        padding: 7px 14px;
        font-size: 12px;
        max-width: 100%;
    }
}

/* Loading Skeleton (before suggestions load) */
.ai-smart-replies-skeleton {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin-bottom: 20px;
}

.ai-smart-replies-skeleton .skeleton-chip {
    height: 38px;
    background: linear-gradient(90deg, 
        var(--km-secondary-bg-color) 0%, 
        rgba(var(--km-primary-color-rgb, 29, 161, 242), 0.1) 50%, 
        var(--km-secondary-bg-color) 100%);
    background-size: 200% 100%;
    border-radius: 50px;
    animation: shimmer 2s infinite;
}

.ai-smart-replies-skeleton .skeleton-chip:nth-child(1) {
    width: 140px;
}

.ai-smart-replies-skeleton .skeleton-chip:nth-child(2) {
    width: 110px;
}

.ai-smart-replies-skeleton .skeleton-chip:nth-child(3) {
    width: 160px;
}

@keyframes shimmer {
    0% {
        background-position: -200% 0;
        opacity: 0.7;
    }
    50% {
        opacity: 0.9;
    }
    100% {
        background-position: 200% 0;
        opacity: 0.7;
    }
}

/* Error State */
.ai-smart-replies-error {
    display: none;
    padding: 8px 12px;
    background: rgba(244, 67, 54, 0.1);
    border: 1px solid rgba(244, 67, 54, 0.3);
    border-radius: 8px;
    color: #F44336;
    font-size: 13px;
    margin-bottom: 10px;
}

.ai-smart-replies-error.show {
    display: block;
}


