/* Main Wrapper */
.jf-container {
    background: #f8fafc;
    padding: 20px;
    border-radius: 12px;
    font-family: 'Inter', system-ui, sans-serif;
}

/* Header & Toggle */
.jf-header-controls {
    display: flex;
    flex-direction: column;
    margin-bottom: 20px;
    gap: 10px;
}
@media (min-width: 768px) {
    .jf-header-controls {
        flex-direction: row;
        justify-content: space-between;
        align-items: flex-start;
    }
}
.btn-toggle-saved {
    background: #fff;
    border: 1px solid #cbd5e1;
    color: #475569;
    padding: 6px 16px;
    border-radius: 6px;
    font-size: 0.85rem;
    font-weight: 600;
    transition: all 0.2s;
}
.btn-toggle-saved:hover { background: #f1f5f9; color: #1e293b; }

/* Saved Area */
.jf-saved-area {
    display: none;
    background: #fff;
    border: 1px solid #e2e8f0;
    border-radius: 12px;
    padding: 20px;
    margin-bottom: 20px;
}
.saved-fit-card {
    cursor: pointer;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    background: #fff;
    transition: transform 0.2s;
}
.saved-fit-card:hover { border-color: #6366f1; transform: translateY(-2px); }

/* Input Card */
.jf-card {
    background: #fff;
    border: 1px solid #e2e8f0;
    border-radius: 12px;
    padding: 24px;
    box-shadow: 0 4px 6px -1px rgba(0,0,0,0.05);
    height: 100%;
}
.jf-label { font-weight: 600; color: #475569; margin-bottom: 8px; display: block; }
.jf-textarea {
    width: 100%;
    border: 1px solid #cbd5e1;
    border-radius: 8px;
    padding: 12px;
    font-size: 0.9rem;
    min-height: 150px;
    resize: vertical;
}
.jf-textarea:focus { outline: none; border-color: #6366f1; box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.1); }

.jf-btn {
    background: linear-gradient(135deg, #4f46e5 0%, #6366f1 100%);
    color: #fff;
    font-weight: 600;
    padding: 12px 24px;
    border: none;
    border-radius: 8px;
    width: 100%;
    cursor: pointer;
    transition: opacity 0.2s;
}
.jf-btn:hover { opacity: 0.9; color: #fff; }
.jf-btn:disabled { background: #94a3b8; cursor: not-allowed; }

/* Empty State */
.jf-empty {
    text-align: center;
    padding: 60px 20px;
    color: #94a3b8;
    border: 2px dashed #e2e8f0;
    border-radius: 12px;
    background: #fff;
}

/* Results Area */
.jf-score-wrapper {
    position: relative;
    width: 120px;
    height: 120px;
    margin: 0 auto 15px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    background: conic-gradient(#e2e8f0 0%, #e2e8f0 100%); /* JS updates this */
    transition: background 1s ease-out;
}
.jf-score-inner {
    position: absolute;
    width: 100px;
    height: 100px;
    background: #fff;
    border-radius: 50%;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
}
.jf-score-num { font-size: 32px; font-weight: 800; color: #1e293b; line-height: 1; }
.jf-score-label { font-size: 11px; text-transform: uppercase; color: #64748b; font-weight: 700; margin-top: 4px; }

/* Result Lists */
.jf-list-item {
    padding: 10px;
    border-radius: 8px;
    margin-bottom: 8px;
    font-size: 0.9rem;
}
.jf-list-success { background: #f0fdf4; color: #166534; border-left: 4px solid #22c55e; }
.jf-list-danger { background: #fef2f2; color: #991b1b; border-left: 4px solid #ef4444; }
.jf-list-warning { background: #fffbeb; color: #92400e; border-left: 4px solid #f59e0b; }

.jf-tag {
    display: inline-block;
    padding: 4px 10px;
    background: #fee2e2;
    color: #b91c1c;
    border-radius: 20px;
    font-size: 0.8rem;
    font-weight: 600;
    margin: 0 5px 5px 0;
}

/* Rate Limit Modal */
.ai-modal-overlay {
    position: fixed; top: 0; left: 0; width: 100%; height: 100%;
    background: rgba(0, 0, 0, 0.6); z-index: 9999; display: none;
    align-items: center; justify-content: center; backdrop-filter: blur(4px);
}
.ai-modal-card {
    background: #fff; width: 90%; max-width: 450px; border-radius: 16px;
    padding: 30px; text-align: center; position: relative;
    box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.1);
}
.ai-modal-icon {
    width: 60px; height: 60px; background: #fee2e2; color: #ef4444;
    border-radius: 50%; display: flex; align-items: center; justify-content: center;
    font-size: 24px; margin: 0 auto 20px;
}
.btn-modal-primary {
    background: linear-gradient(135deg, #4f46e5 0%, #6366f1 100%);
    color: white !important; width: 100%; padding: 12px; border-radius: 8px;
    font-weight: 700; display: block; text-decoration: none;
}
.btn-modal-primary:hover{
    color: #fafafa !important;    
}
.ai-modal-close {
    position: absolute; top: 15px; right: 15px; background: transparent;
    border: none; color: #94a3b8; font-size: 20px; cursor: pointer;
}
.ai-modal-close:hover { color: #ef4444; }