.ai-btn-generate {
    background: #00BBE1;
    color: white;
    font-weight: 600;
    transition: all 0.3s ease;
    background-size: 200% auto;
    padding: 8px 20px;
    border-radius: 6px;
    font-size: 14px;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    border: 1px solid #00BBE1;
}

.ai-btn-generate:hover {
    background-position: right center;
    box-shadow: 0 0 12px #00BBE1;
    transform: translateY(-2px);
}

.ai-btn-generate i {
    margin-right: 6px;
}

.ai-btn-generate:disabled {
    opacity: 0.55;
    cursor: not-allowed;
}

.ai-btn-bar {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 6px;
}

.ai-btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-size: 13px;
    font-weight: 500;
    padding: 6px 14px;
    border-radius: 6px;
    border: 1px solid transparent;
    cursor: pointer;
    transition: opacity 0.15s ease, box-shadow 0.15s ease;
    line-height: 1;
    white-space: nowrap;
}

.ai-btn:hover:not(:disabled) {
    opacity: 0.88;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.12);
}

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

.ai-btn-autofill {
    background-color: #00BBE1;
    color: #fff;
    border-color: #00BBE1;
}

.ai-btn-ask {
    background-color: #fff;
    color: #3b82f6;
    border-color: #d1d5db;
}

.ai-btn-clear {
    background-color: #fef2f2;
    color: #ef4444;
    border-color: #fecaca;
}

.ai-sparkle-icon {
    width: 15px;
    height: 15px;
    flex-shrink: 0;
}

.ai-status-msg {
    font-size: 12px;
    margin-top: 5px;
    display: none;
    min-height: 16px;
}

.ai-status-msg.is-error {
    color: #dc3545;
}

.ai-status-msg.is-success {
    color: #28a745;
}

.ai-status-msg.is-muted {
    color: #6b7280;
}

.ai-textarea-loading {
    position: relative;
    pointer-events: none;
}

.ai-textarea-loading::after {
    content: '';
    position: absolute;
    inset: 0;
    border-radius: 4px;
    background: linear-gradient(90deg,
            rgba(0, 187, 225, 0.07) 25%,
            rgba(0, 187, 225, 0.18) 50%,
            rgba(0, 187, 225, 0.07) 75%);
    background-size: 200% 100%;
    animation: ai-shimmer 1.4s infinite;
}

/* Adding animation overlay */
.ai-overlay {
    position: absolute !important;
    inset: 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    background: rgba(255, 255, 255, 0.7);
    backdrop-filter: blur(3px);
    z-index: 10;
    border-radius: 6px;
}

.ai-icon {
    font-size: 50px !important;
    color: #FFB347 !important;
    margin-bottom: 8px;
    position: relative;

    animation: ai-pulse 1.2s infinite,
        ai-glow 2.5s ease-in-out infinite alternate;
}

.generating-text {
    font-weight: 400;
    color: #888888;

    animation: ai-pulse 1.2s infinite,
        ai-glow 2.5s ease-in-out infinite alternate;
}

/* Change color smooth background */
@keyframes ai-glow {
    from {
        text-shadow:
            0 0 8px rgba(64, 197, 230, 0.6),
            0 0 18px rgba(64, 197, 230, 0.4),
            0 0 30px rgba(64, 197, 230, 0.2);
    }

    to {
        text-shadow:
            0 0 15px rgba(64, 197, 230, 1),
            0 0 30px rgba(64, 197, 230, 0.8),
            0 0 60px rgba(64, 197, 230, 0.6);
    }
}

/* Smooth animation glow icon */
@keyframes ai-glow-pulse {
    from {
        opacity: 0.6;
        transform: translate(-50%, -50%) scale(1);
    }

    to {
        opacity: 1;
        transform: translate(-50%, -50%) scale(1.10);
    }
}

/* pulse animation icon */
@keyframes ai-pulse {
    0% {
        transform: scale(1);
        opacity: .7;
    }

    50% {
        transform: scale(1.2);
        opacity: 1;
    }

    100% {
        transform: scale(1);
        opacity: .7;
    }
}

@keyframes ai-shimmer {
    0% {
        background-position: 200% 0;
    }

    100% {
        background-position: -200% 0;
    }
}

/* --- Modal --- */
.ai-modal-backdrop {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.35);
    z-index: 1050;
    align-items: center;
    justify-content: center;
}

.ai-modal-backdrop.is-open {
    display: flex;
}

.ai-modal {
    background: #fff;
    border-radius: 12px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.18);
    width: 100%;
    max-width: 500px;
    padding: 28px 28px 24px;
    position: relative;
    animation: ai-modal-in 0.18s ease;
}

@keyframes ai-modal-in {
    from {
        transform: translateY(-12px);
        opacity: 0;
    }

    to {
        transform: translateY(0);
        opacity: 1;
    }
}

.ai-modal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 20px;
}

.ai-modal-title {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 17px;
    font-weight: 600;
    color: #111827;
    margin: 0;
}

.ai-modal-close {
    background: none;
    border: none;
    cursor: pointer;
    color: #9ca3af;
    font-size: 40px;
    line-height: 1;
    padding: 0;
    transition: color 0.15s;
}

.ai-modal-close:hover {
    color: #374151;
}

.ai-modal-label {
    font-size: 14px;
    font-weight: 500;
    color: #374151;
    margin-bottom: 8px;
    display: block;
}

.ai-modal-textarea-wrap {
    position: relative;
    margin-bottom: 14px;
}

.ai-modal-prompt {
    width: 100%;
    border: 1px solid #e5e7eb;
    border-radius: 8px;
    padding: 12px 12px 24px;
    font-size: 14px;
    color: #374151;
    resize: none;
    height: 110px;
    background: #f9fafb;
    box-sizing: border-box;
    transition: border-color 0.15s;
    font-family: inherit;
}

.ai-modal-prompt:focus {
    outline: none;
    border-color: #3b82f6;
    background: #fff;
}

.ai-modal-prompt.is-invalid {
    border-color: #ef4444;
}

.ai-modal-char-count {
    position: absolute;
    bottom: 8px;
    right: 10px;
    font-size: 11px;
    color: #9ca3af;
}

.ai-modal-char-count.is-over {
    color: #ef4444;
}

.ai-modal-validation {
    font-size: 12px;
    color: #ef4444;
    margin-top: -10px;
    margin-bottom: 10px;
    display: none;
}

.ai-modal-disclaimer {
    background: #eff6ff;
    border: 1px solid #bfdbfe;
    border-radius: 8px;
    padding: 10px 14px;
    font-size: 12.5px;
    color: #3b82f6;
    display: flex;
    align-items: flex-start;
    gap: 8px;
    margin-bottom: 20px;
    line-height: 1.5;
}

.ai-modal-disclaimer svg {
    flex-shrink: 0;
    margin-top: 1px;
}

.ai-modal-footer {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 10px;
}

.ai-btn-cancel {
    background: #fff;
    color: #374151;
    border: 1px solid #d1d5db;
    padding: 8px 20px;
    border-radius: 6px;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    /* transition: background 0.15s; */
    transition: all 0.3s ease;
}

.ai-btn-cancel:hover {
    background: #f3f4f6;
    box-shadow: 0 0 12px #9ca3af;
    transform: translateY(-2px);
}

.ai-spin {
    display: inline-block;
    width: 13px;
    height: 13px;
    border: 2px solid rgba(255, 255, 255, 0.4);
    border-top-color: #fff;
    border-radius: 50%;
    animation: ai-spinner 0.65s linear infinite;
}

@keyframes ai-spinner {
    to {
        transform: rotate(360deg);
    }
}

.ai-autofill-wrap {
    position: relative;
    display: inline-block;
}

.ai-autofill-wrap .ai-disabled-tip {
    display: none;
    position: absolute;
    bottom: calc(100% + 6px);
    left: 0;
    background: #1f2937;
    color: #fff;
    font-size: 12px;
    padding: 6px 10px;
    border-radius: 6px;
    white-space: nowrap;
    z-index: 10;
    max-width: 280px;
    white-space: normal;
    line-height: 1.4;
    pointer-events: none;
}

.ai-autofill-wrap:hover .ai-disabled-tip {
    display: block;
}
