/* AI Button Styles */
.fpai-ai-button {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 12px 20px;
    border-radius: 25px;
    cursor: pointer;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    font-weight: 600;
    font-size: 14px;
    box-shadow: 0 4px 15px rgba(102, 126, 234, 0.3);
    transition: all 0.3s ease;
    margin-bottom: 15px;
    border: none;
    position: relative;
    overflow: hidden;
}

.fpai-ai-button:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(102, 126, 234, 0.4);
    background: linear-gradient(135deg, #764ba2 0%, #667eea 100%);
}

.fpai-ai-button:active {
    transform: translateY(0);
}

.fpai-ai-button.active {
    background: linear-gradient(135deg, #764ba2 0%, #667eea 100%);
    transform: translateY(-1px);
}

/* Stars Container with Animation */
.fpai-stars-container {
    display: flex;
    gap: 2px;
}

.fpai-star {
    display: inline-block;
    animation: sparkle 2s infinite;
    font-size: 12px;
}

.fpai-star:nth-child(1) {
    animation-delay: 0s;
}

.fpai-star:nth-child(2) {
    animation-delay: 0.7s;
}

.fpai-star:nth-child(3) {
    animation-delay: 1.4s;
}

@keyframes sparkle {

    0%,
    100% {
        opacity: 0.3;
        transform: scale(0.8) rotate(0deg);
    }

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

/* Inline Form Styles */
.fpai-inline-form {
    background: #fff;
    border-radius: 12px;
    padding: 20px;
    margin-bottom: 20px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.1);
    border: 1px solid #e2e8f0;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
}

/* File Upload Area */
.fpai-file-upload-area {
    background: #f8fafc;
    border: 2px dashed #cbd5e1;
    border-radius: 12px;
    padding: 40px 20px;
    text-align: center;
    cursor: pointer;
    transition: all 0.3s ease;
    position: relative;
    margin-bottom: 20px;
}

.fpai-file-upload-area:hover {
    background: #f1f5f9;
    border-color: #94a3b8;
}

.fpai-file-upload-area.fpai-drag-over {
    background: #e0e7ff;
    border-color: #667eea;
    border-style: solid;
}

.fpai-upload-icon {
    font-size: 48px;
    margin-bottom: 15px;
    opacity: 0.8;
}

.fpai-upload-text {
    color: #475569;
    font-size: 16px;
    font-weight: 500;
    margin-bottom: 20px;
    line-height: 1.4;
}

.fpai-choose-file-btn {
    background: #fff;
    color: #475569;
    border: 1px solid #cbd5e1;
    padding: 10px 20px;
    border-radius: 6px;
    cursor: pointer;
    font-family: inherit;
    font-size: 14px;
    font-weight: 500;
    transition: all 0.3s ease;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}

.fpai-choose-file-btn:hover {
    background: #f8fafc;
    border-color: #94a3b8;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.15);
}

/* OR Divider */
.fpai-or-divider {
    text-align: center;
    font-size: 16px;
    font-weight: 600;
    color: #64748b;
    margin: 25px 0;
    position: relative;
}

.fpai-or-divider::before,
.fpai-or-divider::after {
    content: '';
    position: absolute;
    top: 50%;
    width: 45%;
    height: 1px;
    background: #e2e8f0;
}

.fpai-or-divider::before {
    left: 0;
}

.fpai-or-divider::after {
    right: 0;
}

/* Text Input Area */
.fpai-text-input-area {
    margin-bottom: 20px;
}

.fpai-content-textarea {
    width: 100%;
    min-height: 120px;
    padding: 15px;
    border: 2px solid #e2e8f0;
    border-radius: 8px;
    font-family: inherit;
    font-size: 14px;
    line-height: 1.5;
    resize: vertical;
    transition: border-color 0.3s ease;
    box-sizing: border-box;
    background: #f8fafc;
}

.fpai-content-textarea:focus {
    outline: none;
    border-color: #667eea;
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
    background: #fff;
}

.fpai-content-textarea::placeholder {
    color: #94a3b8;
}

/* Populate Form Button */
.fpai-populate-form-btn {
    width: 100%;
    background: linear-gradient(135deg, #3b82f6 0%, #8b5cf6 100%);
    color: white;
    border: none;
    padding: 15px 24px;
    border-radius: 8px;
    font-family: inherit;
    font-weight: 600;
    font-size: 16px;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    box-shadow: 0 4px 15px rgba(59, 130, 246, 0.3);
}

.fpai-populate-form-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(59, 130, 246, 0.4);
    background: linear-gradient(135deg, #2563eb 0%, #7c3aed 100%);
}

.fpai-populate-form-btn:active {
    transform: translateY(0);
}

.fpai-populate-form-btn.loading {
    background: #94a3b8;
    cursor: not-allowed;
    transform: none;
    box-shadow: none;
}

.fpai-btn-icon {
    animation: twinkle 1.5s infinite;
}

@keyframes twinkle {

    0%,
    100% {
        opacity: 0.7;
    }

    50% {
        opacity: 1;
    }
}

/* Response Messages */
.fpai-upload-response,
.fpai-response {
    margin-top: 10px;
    padding: 10px;
    border-radius: 6px;
    font-size: 14px;
    font-weight: 500;
}

.fpai-upload-response.fpai-success,
.fpai-response.fpai-success {
    background: #dcfce7;
    color: #166534;
    border: 1px solid #bbf7d0;
}

.fpai-upload-response.fpai-error,
.fpai-response.fpai-error {
    background: #fef2f2;
    color: #dc2626;
    border: 1px solid #fecaca;
}

/* Responsive Design */
@media (max-width: 768px) {
    .fpai-inline-form {
        padding: 15px;
        margin-left: -10px;
        margin-right: -10px;
    }

    .fpai-file-upload-area {
        padding: 30px 15px;
    }

    .fpai-upload-icon {
        font-size: 36px;
    }

    .fpai-upload-text {
        font-size: 14px;
    }
}

/* Loading Spinner */
.fpai-loading-spinner {
    display: inline-block;
    width: 16px;
    height: 16px;
    border: 2px solid #ffffff40;
    border-radius: 50%;
    border-top-color: #ffffff;
    animation: spin 1s ease-in-out infinite;
    margin-left: 8px;
    vertical-align: middle;
}

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